2 * Copyright 2006 Robert Shearman for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 interface IInternetTransport;
22 interface ISMTPTransport;
23 interface IPOP3Transport;
24 interface IIMAPTransport;
28 cpp_quote("DEFINE_GUID(CLSID_IInternetMessageUrl, 0xca30cc91, 0xb1b3, 0x11d0, 0x85, 0xd0, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
29 cpp_quote("DEFINE_GUID(CLSID_ISMTPTransport, 0xfd853ce6, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
30 cpp_quote("DEFINE_GUID(CLSID_IPOP3Transport, 0xfd853ce7, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
31 cpp_quote("DEFINE_GUID(CLSID_INNTPTransport, 0xfd853ce8, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
32 cpp_quote("DEFINE_GUID(CLSID_IRASTransport, 0xfd853ce9, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
33 cpp_quote("DEFINE_GUID(CLSID_IRangeList, 0xfd853cea, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
34 cpp_quote("DEFINE_GUID(CLSID_IIMAPTransport, 0xfd853ceb, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
35 cpp_quote("DEFINE_GUID(CLSID_IHTTPMailTransport, 0x5a580c11, 0xe5eb, 0x11d1, 0xa8, 0x6e, 0x00, 0x00, 0xf8, 0x08, 0x4f, 0x96);")
36 cpp_quote("DEFINE_GUID(CLSID_IPropFindRequest, 0xbb847b8a, 0x054a, 0x11d2, 0xa8, 0x94, 0x00, 0x00, 0xf8, 0x08, 0x4f, 0x96);")
37 cpp_quote("DEFINE_GUID(CLSID_IPropPatchRequest, 0xea678830, 0x235d, 0x11d2, 0xa8, 0xb6, 0x00, 0x00, 0xf8, 0x08, 0x4f, 0x96);")
41 cpp_quote("#ifndef HR_E")
42 cpp_quote("#define HR_E(n) MAKE_SCODE(SEVERITY_ERROR, FACILITY_INTERNET, n)")
44 cpp_quote("#ifndef HR_S")
45 cpp_quote("#define HR_S(n) MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_INTERNET, n)")
48 /* General Error Codes */
49 cpp_quote("#define IXP_E_LOAD_SICILY_FAILED HR_E(0xCC00)")
50 cpp_quote("#define IXP_E_INVALID_CERT_CN HR_E(0xCC01)")
51 cpp_quote("#define IXP_E_INVALID_CERT_DATE HR_E(0xCC02)")
52 cpp_quote("#define IXP_E_ALREADY_CONNECTED HR_E(0xCC03)")
53 cpp_quote("#define IXP_E_CONN HR_E(0xCC04)")
54 cpp_quote("#define IXP_E_NOT_CONNECTED HR_E(0xCC05)")
55 cpp_quote("#define IXP_E_CONN_SEND HR_E(0xCC06)")
56 cpp_quote("#define IXP_E_WOULD_BLOCK HR_E(0xCC07)")
57 cpp_quote("#define IXP_E_INVALID_STATE HR_E(0xCC08)")
58 cpp_quote("#define IXP_E_CONN_RECV HR_E(0xCC09)")
59 cpp_quote("#define IXP_E_INCOMPLETE HR_E(0xCC0A)")
60 cpp_quote("#define IXP_E_BUSY HR_E(0xCC0B)")
61 cpp_quote("#define IXP_E_NOT_INIT HR_E(0xCC0C)")
62 cpp_quote("#define IXP_E_CANT_FIND_HOST HR_E(0xCC0D)")
63 cpp_quote("#define IXP_E_FAILED_TO_CONNECT HR_E(0xCC0E)")
64 cpp_quote("#define IXP_E_CONNECTION_DROPPED HR_E(0xCC0F)")
65 cpp_quote("#define IXP_E_INVALID_ADDRESS HR_E(0xCC10)")
66 cpp_quote("#define IXP_E_INVALID_ADDRESS_LIST HR_E(0xCC11)")
67 cpp_quote("#define IXP_E_SOCKET_READ_ERROR HR_E(0xCC12)")
68 cpp_quote("#define IXP_E_SOCKET_WRITE_ERROR HR_E(0xCC13)")
69 cpp_quote("#define IXP_E_SCOKET_INIT_ERROR HR_E(0xCC14)")
70 cpp_quote("#define IXP_E_SOCKET_CONNECT_ERROR HR_E(0xCC15)")
71 cpp_quote("#define IXP_E_INVALID_ACCOUNT HR_E(0xCC16)")
72 cpp_quote("#define IXP_E_USER_CANCEL HR_E(0xCC17)")
73 cpp_quote("#define IXP_E_SICILY_LOGON_FAILED HR_E(0xCC18)")
74 cpp_quote("#define IXP_E_TIMEOUT HR_E(0xCC19)")
75 cpp_quote("#define IXP_E_SECURE_CONNECT_FAILED HR_E(0xCC1A)")
77 /* SMTP Failure Statuses */
78 cpp_quote("#define IXP_E_SMTP_RESPONSE_ERROR HR_E(0xCC60)")
79 cpp_quote("#define IXP_E_SMTP_UNKNOWN_RESPONSE_CODE HR_E(0xCC61)")
80 cpp_quote("#define IXP_E_SMTP_500_SYNTAX_ERROR HR_E(0xCC62)")
81 cpp_quote("#define IXP_E_SMTP_501_PARAM_SYNTAX HR_E(0xCC63)")
82 cpp_quote("#define IXP_E_SMTP_502_COMMAND_NOTIMPL HR_E(0xCC64)")
83 cpp_quote("#define IXP_E_SMTP_503_COMMAND_SEQ HR_E(0xCC65)")
84 cpp_quote("#define IXP_E_SMTP_504_COMMAND_PARAM_NOTIMPL HR_E(0xCC66)")
85 cpp_quote("#define IXP_E_SMTP_421_NOT_AVAILABLE HR_E(0xCC67)")
86 cpp_quote("#define IXP_E_SMTP_450_MAILBOX_BUSY HR_E(0xCC68)")
87 cpp_quote("#define IXP_E_SMTP_550_MAILBOX_NOT_FOUND HR_E(0xCC69)")
88 cpp_quote("#define IXP_E_SMTP_451_ERROR_PROCESSING HR_E(0xCC6A)")
89 cpp_quote("#define IXP_E_SMTP_551_USER_NOT_LOCAL HR_E(0xCC6B)")
90 cpp_quote("#define IXP_E_SMTP_452_NO_SYSTEM_STORAGE HR_E(0xCC6C)")
91 cpp_quote("#define IXP_E_SMTP_552_STORAGE_OVERFLOW HR_E(0xCC6D)")
92 cpp_quote("#define IXP_E_SMTP_553_MAILBOX_NAME_SYNTAX HR_E(0xCC6E)")
93 cpp_quote("#define IXP_E_SMTP_554_TRANSACT_FAILED HR_E(0xCC6F)")
95 /* SMTP Success Statuses */
96 cpp_quote("#define IXP_E_SMTP_211_SYSTEM_STATUS HR_S(0xCC70)")
97 cpp_quote("#define IXP_E_SMTP_214_HELP_MESSAGE HR_S(0xCC71)")
98 cpp_quote("#define IXP_E_SMTP_220_READY HR_S(0xCC72)")
99 cpp_quote("#define IXP_E_SMTP_221_CLOSING HR_S(0xCC73)")
100 cpp_quote("#define IXP_E_SMTP_250_MAIL_ACTION_OKAY HR_S(0xCC74)")
101 cpp_quote("#define IXP_E_SMTP_251_FORWARDING_MAIL HR_S(0xCC75)")
102 cpp_quote("#define IXP_E_SMTP_354_START_MAIL_INPUT HR_S(0xCC76)")
103 cpp_quote("#define IXP_E_SMTP_CONTINUE HR_S(0xCC77)")
104 cpp_quote("#define IXP_E_SMTP_334_AUTH_READY_RESPONSE HR_S(0xCC78)")
105 cpp_quote("#define IXP_E_SMTP_245_AUTH_SUCCESS HR_S(0xCC79)")
107 /* More SMTP Failure Statuses */
108 cpp_quote("#define IXP_E_SMTP_REJECTED_SENDER HR_E(0xCC78)")
109 cpp_quote("#define IXP_E_SMTP_REJECTED_RECIPIENTS HR_E(0xCC79)")
110 cpp_quote("#define IXP_E_SMTP_NO_SENDER HR_E(0xCC7A)")
111 cpp_quote("#define IXP_E_SMTP_NO_RECIPIENTS HR_E(0xCC7B)")
112 cpp_quote("#define IXP_E_SMTP_530_STARTTLS_REQUIRED HR_E(0xCC7C)")
113 cpp_quote("#define IXP_E_SMTP_NO_STARTTLS_SUPPORT HR_E(0xCC7D)")
114 cpp_quote("#define IXP_E_SMTP_NO_DSN_SUPPORT HR_E(0xCC7E)")
115 cpp_quote("#define IXP_E_SMTP_454_STARTTLS_FAILED HR_E(0xCC7F)")
117 const SHORT CCHMAX_DOMAIN = 256;
118 const SHORT CCHMAX_PHONE_NUMBER = 128;
120 const DWORD DEFAULT_IMAP_PORT = 143;
121 const DWORD DEFAULT_POP3_PORT = 110;
122 const DWORD DEFAULT_SMTP_PORT = 25;
123 const DWORD DEFAULT_NNTP_PORT = 119;
125 typedef enum tagINETADDRTYPE
130 ADDR_DSN_SUCCESS = 32,
131 ADDR_DSN_FAILURE = 64,
135 const DWORD ADDR_TOFROM_MASK = 0x1;
136 const DWORD ADDR_DSN_MASK = 0xf0;
138 typedef enum tagDSNRET
145 typedef struct tagINETADDR
147 INETADDRTYPE addrtype;
148 CHAR szEmail[CCHMAX_EMAIL_ADDRESS];
149 } INETADDR, *LPINETADDR;
151 typedef struct tagINETADDRLIST
154 LPINETADDR prgAddress;
155 } INETADDRLIST, *LPINETADDRLIST;
157 typedef enum tagRASCONNTYPE
164 typedef enum tagHTTPMAILPROPTYPE
166 HTTPMAIL_PROP_INVALID,
168 HTTPMAIL_PROP_CONTACTS,
170 HTTPMAIL_PROP_OUTBOX,
171 HTTPMAIL_PROP_SENDMSG,
172 HTTPMAIL_PROP_SENTITEMS,
173 HTTPMAIL_PROP_DELETEDITEMS,
174 HTTPMAIL_PROP_DRAFTS,
175 HTTPMAIL_PROP_MSGFOLDERROOT,
180 typedef enum tagHTTPMAILSPECIALFOLDER
183 HTTPMAIL_SF_UNRECOGNIZED,
185 HTTPMAIL_SF_DELETEDITEMS,
188 HTTPMAIL_SF_SENTITEMS,
189 HTTPMAIL_SF_CONTACTS,
190 HTTPMAIL_SF_CALENDAR,
191 HTTPMAIL_SF_MSNPROMO,
193 } HTTPMAILSPECIALFOLDER;
195 typedef enum tagHTTPMAILCONTACTTYPE
200 } HTTPMAILCONTACTTYPE;
202 const DWORD DAVNAMESPACE_UNKNOWN = 0xFFFFFFFF;
203 const DWORD DAVNAMESPACE_DAV = 0;
204 const DWORD DAVNAMESPACE_HOTMAIL = 1;
205 const DWORD DAVNAMESPACE_HTTPMAIL = 2;
206 const DWORD DAVNAMESPACE_MAIL = 3;
207 const DWORD DAVNAMESPACE_CONTACTS = 4;
209 cpp_quote("#define ISF_SMTP_USEIPFORHELO 0x01")
210 cpp_quote("#define ISF_ALWAYSPROMPTFORPASSWORD 0x02")
211 /* for SMTP - send EHLO and use STARTTLS if available: */
212 cpp_quote("#define ISF_SSLONSAMEPORT 0x04")
213 cpp_quote("#define ISF_QUERYDSNSUPPORT 0x08")
214 /* for SMTP - send EHLO and use AUTH if available: */
215 cpp_quote("#define ISF_QUERYAUTHSUPPORT 0x10")
217 typedef struct INETSERVER
219 CHAR szAccount[CCHMAX_ACCOUNT_NAME];
220 CHAR szUserName[CCHMAX_USERNAME];
221 CHAR szPassword[CCHMAX_PASSWORD];
222 CHAR szServerName[CCHMAX_SERVER_NAME];
223 CHAR szConnectoid[CCHMAX_CONNECTOID];
224 RASCONNTYPE rasconntype;
230 } INETSERVER, *LPINETSERVER;
232 typedef enum tagIXPTYPE
242 typedef enum tagIXPSTATUS
256 const DWORD DEPTH_INFINITY = 0xFFFFFFFE;
258 typedef DWORD MEMBERINFOFLAGS;
260 const MEMBERINFOFLAGS HTTP_MEMBERINFO_COMMONPROPS = 0x0;
261 const MEMBERINFOFLAGS HTTP_MEMBERINFO_FOLDERPROPS = 0x1;
262 const MEMBERINFOFLAGS HTTP_MEMBERINFO_MESSAGEPROPS = 0x2;
263 const MEMBERINFOFLAGS HTTP_MEMBERINFO_ALLPROPS = HTTP_MEMBERINFO_FOLDERPROPS | HTTP_MEMBERINFO_MESSAGEPROPS;
265 typedef DWORD IMAP_MSGFLAGS;
267 const IMAP_MSGFLAGS IMAP_MSG_NOFLAGS = 0x00;
268 const IMAP_MSGFLAGS IMAP_MSG_ANSWERED = 0x01;
269 const IMAP_MSGFLAGS IMAP_MSG_FLAGGED = 0x02;
270 const IMAP_MSGFLAGS IMAP_MSG_DELETED = 0x04;
271 const IMAP_MSGFLAGS IMAP_MSG_SEEN = 0x08;
272 const IMAP_MSGFLAGS IMAP_MSG_DRAFT = 0x10;
273 const IMAP_MSGFLAGS IMAP_MSG_ALLFLAGS = 0x1f;
277 uuid(CA30F3FF-C9AC-11D1-9A3A-00C04FA309D4),
280 interface ITransportCallbackService : IUnknown
282 HRESULT GetParentWindow(
283 [in] DWORD dwReserved,
284 [out] HWND *phwndParent);
287 [out] LPDWORD pdwServerType,
288 [out] IImnAccount **ppAccount);
293 uuid(0DF2C7E1-3435-11D0-81D0-00C04FD85AB4),
296 interface ITransportCallback : IUnknown
298 typedef struct tagIXPRESULT
303 HRESULT hrServerError;
306 } IXPRESULT, *LPIXPRESULT;
308 typedef enum tagCMDTYPE
315 [in,out] DWORD *pdwTimeout,
316 [in] IInternetTransport *pTransport);
318 HRESULT OnLogonPrompt(
319 [in,out] LPINETSERVER pInetServer,
320 [in] IInternetTransport *pTransport);
323 [in] HRESULT hrError,
325 [in] LPCSTR pszCaption,
327 [in] IInternetTransport *pTransport);
330 [in] IXPSTATUS ixpstatus,
331 [in] IInternetTransport *pTransport);
334 [in] IXPSTATUS ixpstatus,
335 [in] LPIXPRESULT pResult,
336 [in] IInternetTransport *pTransport);
339 [in] CMDTYPE cmdtype,
341 [in] HRESULT hrResponse,
342 [in] IInternetTransport *pTransport);
347 uuid(1F636C01-364E-11D0-81D3-00C04FD85AB4),
350 interface IInternetTransport : IUnknown
352 const boolean iitAUTHENTICATE = TRUE;
353 const boolean iitDONT_AUTHENTICATe = FALSE;
354 const boolean iitENABLE_ONCOMMAND = TRUE;
355 const boolean iitDISABLE_ONCOMMAND = FALSE;
357 typedef enum tagIXPISSTATE
365 HRESULT GetServerInfo(
366 [in,out] LPINETSERVER pInetServer);
368 IXPTYPE GetIXPType();
371 [in] IXPISSTATE isstate);
373 HRESULT InetServerFromAccount(
374 [in] IImnAccount *pAccount,
375 [in,out] LPINETSERVER pInetServer);
378 [in] LPINETSERVER pInetServer,
379 [in] boolean fAuthenticate,
380 [in] boolean fCommandLogging);
382 HRESULT HandsOffCallback();
384 HRESULT Disconnect();
386 HRESULT DropConnection();
389 [out] IXPSTATUS *pCurrentStatus);
394 uuid(1F636C02-364E-11D0-81D3-00C04FD85AB4),
397 interface ISMTPCallback : ITransportCallback
399 typedef enum tagSMTPCOMMAND
418 typedef struct tagSMTPSTREAM
423 } SMTPSTREAM, *LPSMTPSTREAM;
425 typedef struct tagSMTPRESPONSE
429 IXPRESULT rIxpResult;
430 ISMTPTransport *pTransport;
432 [switch_type(SMTPCOMMAND), switch_is(command)]
435 [case(SMTP_SEND_STREAM)] SMTPSTREAM rStreamInfo;
438 } SMTPRESPONSE, *LPSMTPRESPONSE;
441 [in] LPSMTPRESPONSE pResponse);
446 uuid(0DF2C7E2-3435-11D0-81D0-00C04FD85AB4),
449 interface ISMTPTransport : IInternetTransport
451 typedef struct tagSMTPMESSAGE
455 INETADDRLIST rAddressList;
456 } SMTPMESSAGE, *LPSMTPMESSAGE;
459 [in] LPSTR pszLogFilePath,
460 [in] ISMTPCallback *pCallback);
462 cpp_quote("#ifdef WINE_NO_UNICODE_MACROS")
463 cpp_quote("#undef SendMessage")
467 [in] LPSMTPMESSAGE pMessage);
470 [in] LPSTR pszEmailFrom);
473 [in] LPSTR pszEmailTo);
475 HRESULT CommandEHLO();
477 HRESULT CommandHELO();
480 [in] LPSTR pszAuthType);
482 HRESULT CommandQUIT();
484 HRESULT CommandRSET();
486 HRESULT CommandDATA();
488 HRESULT CommandDOT();
490 HRESULT SendDataStream(
491 [in] IStream *pStream,
497 uuid(0DF2C7EC-3435-11D0-81D0-00C04FD85AB4),
500 interface ISMTPTransport2 : ISMTPTransport
502 typedef struct tagSMTPMESSAGE2
509 } SMTPMESSAGE2, *LPSMTPMESSAGE2;
513 HRESULT ResetWindow();
515 HRESULT SendMessage2(
516 [in] LPSMTPMESSAGE2 pMessage);
518 HRESULT CommandRCPT2(
519 [in] LPSTR pszEmailTo,
520 [in] INETADDRTYPE atDSN);
523 /* FIXME: IDAVNamespaceArbiter, IPropPatchRequest, IPropFindRequest, IPropFindMultiResponse, IPropFindResponse, IHTTPMailCallback, IHTTPMailTransport */
527 uuid(0DF2C7E3-3435-11D0-81D0-00C04FD85AB4),
530 interface IPOP3Callback : ITransportCallback
532 typedef enum tagPOP3COMMAND
552 typedef struct tagPOP3RETR
560 } POP3RETR, *LPPOP3RETR;
562 typedef struct tagPOP3TOP
571 } POP3TOP, *LPPOP3TOP;
573 typedef struct tagPOP3LIST
577 } POP3LIST, *LPPOP3LIST;
579 typedef struct tagPOP3UIDL
583 } POP3UIDL, *LPPOP3UIDL;
585 typedef struct tagPOP3STAT
589 } POP3STAT, *LPPOP3STAT;
591 typedef struct tagPOP3RESPONSE
595 IXPRESULT rIxpResult;
596 IPOP3Transport *pTransport;
598 [switch_type(POP3COMMAND), switch_is(command)]
601 [case(POP3_UIDL)] POP3UIDL rUidlInfo;
602 [case(POP3_STAT)] POP3STAT rStatInfo;
603 [case(POP3_LIST)] POP3LIST rListInfo;
604 [case(POP3_DELE)] DWORD dwPopId;
605 [case(POP3_RETR)] POP3RETR rRetrInfo;
606 [case(POP3_TOP)] POP3TOP rTopInfo;
609 } POP3RESPONSE, *LPPOP3RESPONSE;
612 [in] LPPOP3RESPONSE pResponse);
617 uuid(0DF2C7E4-3435-11D0-81D0-00C04FD85AB4),
620 interface IPOP3Transport : IInternetTransport
622 typedef enum tagPOP3CMDTYPE
629 typedef enum tagPOP3MARKTYPE
631 POP3_MARK_FOR_TOP = 0x01,
632 POP3_MARK_FOR_RETR = 0x02,
633 POP3_MARK_FOR_DELE = 0x04,
634 POP3_MARK_FOR_UIDL = 0x08,
635 POP3_MARK_FOR_LIST = 0x10
639 [in] LPSTR pszLogFilePath,
640 [in] IPOP3Callback *pCallback);
643 [in] POP3MARKTYPE marktype,
645 [in] boolean fMarked);
648 [in] LPSTR pszAuthType);
651 [in] LPSTR pszUserName);
654 [in] LPSTR pszPassword);
657 [in] POP3CMDTYPE cmdtype,
661 [in] POP3CMDTYPE cmdtype,
663 [in] DWORD cPreviewLines);
665 HRESULT CommandQUIT();
667 HRESULT CommandSTAT();
669 HRESULT CommandNOOP();
671 HRESULT CommandRSET();
674 [in] POP3CMDTYPE cmdtype,
678 [in] POP3CMDTYPE cmdtype,
682 [in] POP3CMDTYPE cmdtype,
686 /* FIXME: INNTPCallback, INNTPTransport */
690 uuid(8C438160-4EF6-11d0-874F-00AA00530EE9),
693 interface IRangeList : IUnknown
695 const ULONG RL_RANGE_ERROR = ((ULONG)-1);
696 const ULONG RL_LAST_MESSAGE = ((ULONG)-1);
701 [in] const ULONG value);
704 [out] ULONG *pulMin);
707 [out] ULONG *pulMax);
710 [out] byte **ppbDestination,
711 [out] ULONG *pulSizeOfDestination);
714 [in, size_is(ulSizeOfSource)] byte *pbSource,
715 [in] const ULONG ulSizeOfSource);
718 [in] const ULONG low,
719 [in] const ULONG high);
721 HRESULT AddSingleValue(
722 [in] const ULONG value);
724 HRESULT AddRangeList(
725 [in] const IRangeList *prl);
728 [in] const ULONG low,
729 [in] const ULONG high);
731 HRESULT DeleteSingleValue(
732 [in] const ULONG value);
734 HRESULT DeleteRangeList(
735 [in] const IRangeList *prl);
738 [in] const ULONG value,
739 [out] ULONG *pulMinOfRange);
742 [in] const ULONG value,
743 [out] ULONG *pulMaxOfRange);
745 HRESULT RangeToIMAPString(
746 [out] LPSTR *ppszDestination,
747 [out] LPDWORD pdwLengthOfDestination);
750 [in] const ULONG current,
751 [out] ULONG *pulNext);
754 [in] const ULONG current,
755 [out] ULONG *pulPrev);
758 [out] ULONG *pulCardinality);
760 HRESULT CardinalityFrom(
761 [in] const ULONG ulStartPoint,
762 [out] ULONG *pulCardinalityFrom);
767 uuid(E9E9D8A3-4EDD-11d0-874F-00AA00530EE9),
770 interface IIMAPCallback : ITransportCallback
772 typedef DWORD IMAP_MBOXFLAGS;
773 const IMAP_MBOXFLAGS IMAP_MBOX_NOFLAGS = 0x0;
774 const IMAP_MBOXFLAGS IMAP_MBOX_MARKED = 0x1;
775 const IMAP_MBOXFLAGS IMAP_MBOX_NOINFERIORS = 0x2;
776 const IMAP_MBOXFLAGS IMAP_MBOX_NOSELECT = 0x4;
777 const IMAP_MBOXFLAGS IMAP_MBOX_UNMARKED = 0x8;
778 const IMAP_MBOXFLAGS IMAP_MBOX_ALLFLAGS = 0xf;
780 typedef enum tagIMAP_RESPONSE_TYPE
782 irtERROR_NOTIFICATION,
783 irtCOMMAND_COMPLETION,
800 } IMAP_RESPONSE_TYPE;
802 typedef struct tagFETCH_BODY_PART
811 LPARAM lpFetchCookie1;
812 LPARAM lpFetchCookie2;
815 typedef struct tagFETCH_CMD_RESULTS
819 IMAP_MSGFLAGS mfMsgFlags;
825 FILETIME ftInternalDate;
826 LPARAM lpFetchCookie1;
827 LPARAM lpFetchCookie2;
830 typedef struct tagIMAPADDR
836 struct tagIMAPADDR *pNext;
839 typedef struct tagFETCH_CMD_RESULTS_EX
843 IMAP_MSGFLAGS mfMsgFlags;
849 FILETIME ftInternalDate;
850 LPARAM lpFetchCookie1;
851 LPARAM lpFetchCookie2;
855 IMAPADDR *piaENVFrom;
856 IMAPADDR *piaENVSender;
857 IMAPADDR *piaENVReplyTo;
861 LPSTR pszENVInReplyTo;
862 LPSTR pszENVMessageID;
866 } FETCH_CMD_RESULTS_EX;
868 typedef struct tagMBOX_MSGCOUNT
870 BOOL bGotExistsResponse;
872 BOOL bGotRecentResponse;
874 BOOL bGotUnseenResponse;
878 typedef struct tagIMAP_LISTLSUB_RESPONSE
880 LPSTR pszMailboxName;
881 IMAP_MBOXFLAGS imfMboxFlags;
883 } IMAP_LISTLSUB_RESPONSE;
885 typedef struct tagIMAP_STATUS_RESPONSE
887 LPSTR pszMailboxName;
898 } IMAP_STATUS_RESPONSE;
900 typedef struct tagAPPEND_PROGRESS
906 typedef [switch_type(IMAP_RESPONSE_TYPE)] union tagIMAP_RESPONSE_DATA
908 [case (irtMAILBOX_UPDATE)] MBOX_MSGCOUNT *pmcMsgCount;
909 [case (irtDELETED_MSG)] DWORD dwDeletedMsgSeqNum;
910 [case (irtFETCH_BODY)] FETCH_BODY_PART *pFetchBodyPart;
911 [case (irtUPDATE_MSG)] FETCH_CMD_RESULTS *pFetchResults;
912 [case (irtAPPLICABLE_FLAGS, irtPERMANENT_FLAGS)] IMAP_MSGFLAGS imfImapMessageFlags;
913 [case (irtUIDVALIDITY)] DWORD dwUIDValidity;
914 [case (irtREADWRITE_STATUS)] BOOL bReadWrite;
915 [case (irtSEARCH)] IRangeList *prlSearchResults;
916 [case (irtMAILBOX_LISTING)] IMAP_LISTLSUB_RESPONSE illrdMailboxListing;
917 [case (irtMAILBOX_STATUS)] IMAP_STATUS_RESPONSE *pisrStatusResponse;
918 [case (irtAPPEND_PROGRESS)] APPEND_PROGRESS *papAppendProgress;
919 [case (irtUPDATE_MSG_EX)] FETCH_CMD_RESULTS_EX *pFetchResultsEx;
920 } IMAP_RESPONSE_DATA;
922 typedef struct tagIMAP_RESPONSE
927 LPSTR lpszResponseText;
928 IMAP_RESPONSE_TYPE irtResponseType;
929 [switch_is(irtResponseType)] IMAP_RESPONSE_DATA irdResponseData;
932 HRESULT OnResponse([in] const IMAP_RESPONSE *pirIMAPResponse);
937 uuid(E9E9D8A8-4EDD-11d0-874F-00AA00530EE9),
940 interface IIMAPTransport : IInternetTransport
942 const DWORD IMAP_CAPABILITY_IMAP4 = 0x1;
943 const DWORD IMAP_CAPABILITY_IMAP4rev1 = 0x2;
944 const DWORD IMAP_CAPABILITY_IDLE = 0x4;
945 const DWORD IMAP_CAPABILITY_ALLFLAGS = 0x7;
948 [in] LPSTR pszLogFilePath,
949 [in] IIMAPCallback *pCBHandler);
951 HRESULT NewIRangeList(
952 [out] IRangeList **pprlNewRangeList);
955 [out] DWORD *pdwCapabilityFlags);
960 [in] IIMAPCallback *pCBHandler,
961 [in] LPSTR lpszMailboxName);
966 [in] IIMAPCallback *pCBHandler,
967 [in] LPSTR lpszMailboxName);
972 [in] IIMAPCallback *pCBHandler,
973 [in] LPSTR lpszMailboxName);
978 [in] IIMAPCallback *pCBHandler,
979 [in] LPSTR lpszMailboxName);
984 [in] IIMAPCallback *pCBHandler,
985 [in] LPSTR lpszMailboxName,
986 [in] LPSTR lpszNewMailboxName);
991 [in] IIMAPCallback *pCBHandler,
992 [in] LPSTR lpszMailboxName);
997 [in] IIMAPCallback *pCBHandler,
998 [in] LPSTR lpszMailboxName);
1003 [in] IIMAPCallback *pCBHandler,
1004 [in] LPSTR lpszMailboxNameReference,
1005 [in] LPSTR lpszMailboxNamePattern);
1010 [in] IIMAPCallback *pCBHandler,
1011 [in] LPSTR lpszMailboxNameReference,
1012 [in] LPSTR lpszMailboxNamePattern);
1017 [in] IIMAPCallback *pCBHandler,
1018 [in] LPSTR lpszMailboxName,
1019 [in] LPSTR lpszMessageFlags,
1020 [in] FILETIME ftMessageDateTime,
1021 [in] LPSTREAM lpstmMessageToSave);
1026 [in] IIMAPCallback *pCBHandler);
1031 [in] IIMAPCallback *pCBHandler);
1036 [in] IIMAPCallback *pCBHandler,
1037 [in] LPSTR lpszSearchCriteria,
1038 [in] boolean bReturnUIDs,
1039 [in] IRangeList *pMsgRange,
1040 [in] boolean bUIDRangeList);
1045 [in] IIMAPCallback *pCBHandler,
1046 [in] IRangeList *pMsgRange,
1047 [in] boolean bUIDMsgRange,
1048 [in] LPSTR lpszFetchArgs);
1053 [in] IIMAPCallback *pCBHandler,
1054 [in] IRangeList *pMsgRange,
1055 [in] boolean bUIDRangeList,
1056 [in] LPSTR lpszStoreArgs);
1061 [in] IIMAPCallback *pCBHandler,
1062 [in] IRangeList *pMsgRange,
1063 [in] boolean bUIDRangeList,
1064 [in] LPSTR lpszMailboxName);
1069 [in] IIMAPCallback *pCBHandler);
1071 HRESULT ResizeMsgSeqNumTable(
1072 [in] DWORD dwSizeOfMbox);
1074 HRESULT UpdateSeqNumToUID(
1075 [in] DWORD dwMsgSeqNum,
1078 HRESULT RemoveSequenceNum(
1079 [in] DWORD dwDeletedMsgSeqNum);
1081 HRESULT MsgSeqNumToUID(
1082 [in] DWORD dwMsgSeqNum,
1083 [out] DWORD *pdwUID);
1085 HRESULT GetMsgSeqNumToUIDArray(
1086 [out] DWORD **ppdwMsgSeqNumToUIDArray,
1087 [out] DWORD *pdwNumberOfElements);
1089 HRESULT GetHighestMsgSeqNum(
1090 [out] DWORD *pdwHighestMSN);
1092 HRESULT ResetMsgSeqNumToUID();
1094 HRESULT SetDefaultCBHandler(
1095 [in] IIMAPCallback *pCBHandler);
1100 [in] IIMAPCallback *pCBHandler,
1101 [in] LPSTR pszMailboxName,
1102 [in] LPSTR pszStatusCmdArgs);
1106 cpp_quote("HRESULT WINAPI CreateRASTransport(IRASTransport **ppTransport);")
1107 cpp_quote("HRESULT WINAPI CreateNNTPTransport(INNTPTransport **ppTransport);")
1108 cpp_quote("HRESULT WINAPI CreateIMAPTransport2(IIMAPTransport2 **ppTransport);")
1110 cpp_quote("HRESULT WINAPI CreateRangeList(IRangeList **ppRangeList);")
1111 cpp_quote("HRESULT WINAPI CreateSMTPTransport(ISMTPTransport **ppTransport);")
1112 cpp_quote("HRESULT WINAPI CreatePOP3Transport(IPOP3Transport **ppTransport);")
1113 cpp_quote("HRESULT WINAPI CreateIMAPTransport(IIMAPTransport **ppTransport);")