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_ISMTPTransport2, 0xdf2c7eC, 0x3435, 0x11d0, 0x81, 0xd0, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
31 cpp_quote("DEFINE_GUID(CLSID_IPOP3Transport, 0xfd853ce7, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
32 cpp_quote("DEFINE_GUID(CLSID_INNTPTransport, 0xfd853ce8, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
33 cpp_quote("DEFINE_GUID(CLSID_IRASTransport, 0xfd853ce9, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
34 cpp_quote("DEFINE_GUID(CLSID_IRangeList, 0xfd853cea, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
35 cpp_quote("DEFINE_GUID(CLSID_IIMAPTransport, 0xfd853ceb, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
36 cpp_quote("DEFINE_GUID(CLSID_IHTTPMailTransport, 0x5a580c11, 0xe5eb, 0x11d1, 0xa8, 0x6e, 0x00, 0x00, 0xf8, 0x08, 0x4f, 0x96);")
37 cpp_quote("DEFINE_GUID(CLSID_IPropFindRequest, 0xbb847b8a, 0x054a, 0x11d2, 0xa8, 0x94, 0x00, 0x00, 0xf8, 0x08, 0x4f, 0x96);")
38 cpp_quote("DEFINE_GUID(CLSID_IPropPatchRequest, 0xea678830, 0x235d, 0x11d2, 0xa8, 0xb6, 0x00, 0x00, 0xf8, 0x08, 0x4f, 0x96);")
42 cpp_quote("#ifndef HR_E")
43 cpp_quote("#define HR_E(n) MAKE_SCODE(SEVERITY_ERROR, FACILITY_INTERNET, n)")
45 cpp_quote("#ifndef HR_S")
46 cpp_quote("#define HR_S(n) MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_INTERNET, n)")
49 /* General Error Codes */
50 cpp_quote("#define IXP_E_LOAD_SICILY_FAILED HR_E(0xCC00)")
51 cpp_quote("#define IXP_E_INVALID_CERT_CN HR_E(0xCC01)")
52 cpp_quote("#define IXP_E_INVALID_CERT_DATE HR_E(0xCC02)")
53 cpp_quote("#define IXP_E_ALREADY_CONNECTED HR_E(0xCC03)")
54 cpp_quote("#define IXP_E_CONN HR_E(0xCC04)")
55 cpp_quote("#define IXP_E_NOT_CONNECTED HR_E(0xCC05)")
56 cpp_quote("#define IXP_E_CONN_SEND HR_E(0xCC06)")
57 cpp_quote("#define IXP_E_WOULD_BLOCK HR_E(0xCC07)")
58 cpp_quote("#define IXP_E_INVALID_STATE HR_E(0xCC08)")
59 cpp_quote("#define IXP_E_CONN_RECV HR_E(0xCC09)")
60 cpp_quote("#define IXP_E_INCOMPLETE HR_E(0xCC0A)")
61 cpp_quote("#define IXP_E_BUSY HR_E(0xCC0B)")
62 cpp_quote("#define IXP_E_NOT_INIT HR_E(0xCC0C)")
63 cpp_quote("#define IXP_E_CANT_FIND_HOST HR_E(0xCC0D)")
64 cpp_quote("#define IXP_E_FAILED_TO_CONNECT HR_E(0xCC0E)")
65 cpp_quote("#define IXP_E_CONNECTION_DROPPED HR_E(0xCC0F)")
66 cpp_quote("#define IXP_E_INVALID_ADDRESS HR_E(0xCC10)")
67 cpp_quote("#define IXP_E_INVALID_ADDRESS_LIST HR_E(0xCC11)")
68 cpp_quote("#define IXP_E_SOCKET_READ_ERROR HR_E(0xCC12)")
69 cpp_quote("#define IXP_E_SOCKET_WRITE_ERROR HR_E(0xCC13)")
70 cpp_quote("#define IXP_E_SCOKET_INIT_ERROR HR_E(0xCC14)")
71 cpp_quote("#define IXP_E_SOCKET_CONNECT_ERROR HR_E(0xCC15)")
72 cpp_quote("#define IXP_E_INVALID_ACCOUNT HR_E(0xCC16)")
73 cpp_quote("#define IXP_E_USER_CANCEL HR_E(0xCC17)")
74 cpp_quote("#define IXP_E_SICILY_LOGON_FAILED HR_E(0xCC18)")
75 cpp_quote("#define IXP_E_TIMEOUT HR_E(0xCC19)")
76 cpp_quote("#define IXP_E_SECURE_CONNECT_FAILED HR_E(0xCC1A)")
78 /* SMTP Failure Statuses */
79 cpp_quote("#define IXP_E_SMTP_RESPONSE_ERROR HR_E(0xCC60)")
80 cpp_quote("#define IXP_E_SMTP_UNKNOWN_RESPONSE_CODE HR_E(0xCC61)")
81 cpp_quote("#define IXP_E_SMTP_500_SYNTAX_ERROR HR_E(0xCC62)")
82 cpp_quote("#define IXP_E_SMTP_501_PARAM_SYNTAX HR_E(0xCC63)")
83 cpp_quote("#define IXP_E_SMTP_502_COMMAND_NOTIMPL HR_E(0xCC64)")
84 cpp_quote("#define IXP_E_SMTP_503_COMMAND_SEQ HR_E(0xCC65)")
85 cpp_quote("#define IXP_E_SMTP_504_COMMAND_PARAM_NOTIMPL HR_E(0xCC66)")
86 cpp_quote("#define IXP_E_SMTP_421_NOT_AVAILABLE HR_E(0xCC67)")
87 cpp_quote("#define IXP_E_SMTP_450_MAILBOX_BUSY HR_E(0xCC68)")
88 cpp_quote("#define IXP_E_SMTP_550_MAILBOX_NOT_FOUND HR_E(0xCC69)")
89 cpp_quote("#define IXP_E_SMTP_451_ERROR_PROCESSING HR_E(0xCC6A)")
90 cpp_quote("#define IXP_E_SMTP_551_USER_NOT_LOCAL HR_E(0xCC6B)")
91 cpp_quote("#define IXP_E_SMTP_452_NO_SYSTEM_STORAGE HR_E(0xCC6C)")
92 cpp_quote("#define IXP_E_SMTP_552_STORAGE_OVERFLOW HR_E(0xCC6D)")
93 cpp_quote("#define IXP_E_SMTP_553_MAILBOX_NAME_SYNTAX HR_E(0xCC6E)")
94 cpp_quote("#define IXP_E_SMTP_554_TRANSACT_FAILED HR_E(0xCC6F)")
96 /* SMTP Success Statuses */
97 cpp_quote("#define IXP_E_SMTP_211_SYSTEM_STATUS HR_S(0xCC70)")
98 cpp_quote("#define IXP_E_SMTP_214_HELP_MESSAGE HR_S(0xCC71)")
99 cpp_quote("#define IXP_E_SMTP_220_READY HR_S(0xCC72)")
100 cpp_quote("#define IXP_E_SMTP_221_CLOSING HR_S(0xCC73)")
101 cpp_quote("#define IXP_E_SMTP_250_MAIL_ACTION_OKAY HR_S(0xCC74)")
102 cpp_quote("#define IXP_E_SMTP_251_FORWARDING_MAIL HR_S(0xCC75)")
103 cpp_quote("#define IXP_E_SMTP_354_START_MAIL_INPUT HR_S(0xCC76)")
104 cpp_quote("#define IXP_E_SMTP_CONTINUE HR_S(0xCC77)")
105 cpp_quote("#define IXP_E_SMTP_334_AUTH_READY_RESPONSE HR_S(0xCC78)")
106 cpp_quote("#define IXP_E_SMTP_245_AUTH_SUCCESS HR_S(0xCC79)")
108 /* More SMTP Failure Statuses */
109 cpp_quote("#define IXP_E_SMTP_REJECTED_SENDER HR_E(0xCC78)")
110 cpp_quote("#define IXP_E_SMTP_REJECTED_RECIPIENTS HR_E(0xCC79)")
111 cpp_quote("#define IXP_E_SMTP_NO_SENDER HR_E(0xCC7A)")
112 cpp_quote("#define IXP_E_SMTP_NO_RECIPIENTS HR_E(0xCC7B)")
113 cpp_quote("#define IXP_E_SMTP_530_STARTTLS_REQUIRED HR_E(0xCC7C)")
114 cpp_quote("#define IXP_E_SMTP_NO_STARTTLS_SUPPORT HR_E(0xCC7D)")
115 cpp_quote("#define IXP_E_SMTP_NO_DSN_SUPPORT HR_E(0xCC7E)")
116 cpp_quote("#define IXP_E_SMTP_454_STARTTLS_FAILED HR_E(0xCC7F)")
118 const SHORT CCHMAX_DOMAIN = 256;
119 const SHORT CCHMAX_PHONE_NUMBER = 128;
121 const DWORD DEFAULT_IMAP_PORT = 143;
122 const DWORD DEFAULT_POP3_PORT = 110;
123 const DWORD DEFAULT_SMTP_PORT = 25;
124 const DWORD DEFAULT_NNTP_PORT = 119;
126 typedef enum tagINETADDRTYPE
131 ADDR_DSN_SUCCESS = 32,
132 ADDR_DSN_FAILURE = 64,
136 const DWORD ADDR_TOFROM_MASK = 0x1;
137 const DWORD ADDR_DSN_MASK = 0xf0;
139 typedef enum tagDSNRET
146 typedef struct tagINETADDR
148 INETADDRTYPE addrtype;
149 CHAR szEmail[CCHMAX_EMAIL_ADDRESS];
150 } INETADDR, *LPINETADDR;
152 typedef struct tagINETADDRLIST
155 LPINETADDR prgAddress;
156 } INETADDRLIST, *LPINETADDRLIST;
158 typedef enum tagRASCONNTYPE
165 typedef enum tagHTTPMAILPROPTYPE
167 HTTPMAIL_PROP_INVALID,
169 HTTPMAIL_PROP_CONTACTS,
171 HTTPMAIL_PROP_OUTBOX,
172 HTTPMAIL_PROP_SENDMSG,
173 HTTPMAIL_PROP_SENTITEMS,
174 HTTPMAIL_PROP_DELETEDITEMS,
175 HTTPMAIL_PROP_DRAFTS,
176 HTTPMAIL_PROP_MSGFOLDERROOT,
181 typedef enum tagHTTPMAILSPECIALFOLDER
184 HTTPMAIL_SF_UNRECOGNIZED,
186 HTTPMAIL_SF_DELETEDITEMS,
189 HTTPMAIL_SF_SENTITEMS,
190 HTTPMAIL_SF_CONTACTS,
191 HTTPMAIL_SF_CALENDAR,
192 HTTPMAIL_SF_MSNPROMO,
194 } HTTPMAILSPECIALFOLDER;
196 typedef enum tagHTTPMAILCONTACTTYPE
201 } HTTPMAILCONTACTTYPE;
203 const DWORD DAVNAMESPACE_UNKNOWN = 0xFFFFFFFF;
204 const DWORD DAVNAMESPACE_DAV = 0;
205 const DWORD DAVNAMESPACE_HOTMAIL = 1;
206 const DWORD DAVNAMESPACE_HTTPMAIL = 2;
207 const DWORD DAVNAMESPACE_MAIL = 3;
208 const DWORD DAVNAMESPACE_CONTACTS = 4;
210 cpp_quote("#define ISF_SMTP_USEIPFORHELO 0x01")
211 cpp_quote("#define ISF_ALWAYSPROMPTFORPASSWORD 0x02")
212 /* for SMTP - send EHLO and use STARTTLS if available: */
213 cpp_quote("#define ISF_SSLONSAMEPORT 0x04")
214 cpp_quote("#define ISF_QUERYDSNSUPPORT 0x08")
215 /* for SMTP - send EHLO and use AUTH if available: */
216 cpp_quote("#define ISF_QUERYAUTHSUPPORT 0x10")
218 typedef struct INETSERVER
220 CHAR szAccount[CCHMAX_ACCOUNT_NAME];
221 CHAR szUserName[CCHMAX_USERNAME];
222 CHAR szPassword[CCHMAX_PASSWORD];
223 CHAR szServerName[CCHMAX_SERVER_NAME];
224 CHAR szConnectoid[CCHMAX_CONNECTOID];
225 RASCONNTYPE rasconntype;
231 } INETSERVER, *LPINETSERVER;
233 typedef enum tagIXPTYPE
243 typedef enum tagIXPSTATUS
257 const DWORD DEPTH_INFINITY = 0xFFFFFFFE;
259 typedef DWORD MEMBERINFOFLAGS;
261 const MEMBERINFOFLAGS HTTP_MEMBERINFO_COMMONPROPS = 0x0;
262 const MEMBERINFOFLAGS HTTP_MEMBERINFO_FOLDERPROPS = 0x1;
263 const MEMBERINFOFLAGS HTTP_MEMBERINFO_MESSAGEPROPS = 0x2;
264 const MEMBERINFOFLAGS HTTP_MEMBERINFO_ALLPROPS = HTTP_MEMBERINFO_FOLDERPROPS | HTTP_MEMBERINFO_MESSAGEPROPS;
266 typedef DWORD IMAP_MSGFLAGS;
268 const IMAP_MSGFLAGS IMAP_MSG_NOFLAGS = 0x00;
269 const IMAP_MSGFLAGS IMAP_MSG_ANSWERED = 0x01;
270 const IMAP_MSGFLAGS IMAP_MSG_FLAGGED = 0x02;
271 const IMAP_MSGFLAGS IMAP_MSG_DELETED = 0x04;
272 const IMAP_MSGFLAGS IMAP_MSG_SEEN = 0x08;
273 const IMAP_MSGFLAGS IMAP_MSG_DRAFT = 0x10;
274 const IMAP_MSGFLAGS IMAP_MSG_ALLFLAGS = 0x1f;
278 uuid(CA30F3FF-C9AC-11D1-9A3A-00C04FA309D4),
281 interface ITransportCallbackService : IUnknown
283 HRESULT GetParentWindow(
284 [in] DWORD dwReserved,
285 [out] HWND *phwndParent);
288 [out] LPDWORD pdwServerType,
289 [out] IImnAccount **ppAccount);
294 uuid(0DF2C7E1-3435-11D0-81D0-00C04FD85AB4),
297 interface ITransportCallback : IUnknown
299 typedef struct tagIXPRESULT
304 HRESULT hrServerError;
307 } IXPRESULT, *LPIXPRESULT;
309 typedef enum tagCMDTYPE
316 [in,out] DWORD *pdwTimeout,
317 [in] IInternetTransport *pTransport);
319 HRESULT OnLogonPrompt(
320 [in,out] LPINETSERVER pInetServer,
321 [in] IInternetTransport *pTransport);
324 [in] HRESULT hrError,
326 [in] LPCSTR pszCaption,
328 [in] IInternetTransport *pTransport);
331 [in] IXPSTATUS ixpstatus,
332 [in] IInternetTransport *pTransport);
335 [in] IXPSTATUS ixpstatus,
336 [in] LPIXPRESULT pResult,
337 [in] IInternetTransport *pTransport);
340 [in] CMDTYPE cmdtype,
342 [in] HRESULT hrResponse,
343 [in] IInternetTransport *pTransport);
348 uuid(1F636C01-364E-11D0-81D3-00C04FD85AB4),
351 interface IInternetTransport : IUnknown
353 const boolean iitAUTHENTICATE = TRUE;
354 const boolean iitDONT_AUTHENTICATe = FALSE;
355 const boolean iitENABLE_ONCOMMAND = TRUE;
356 const boolean iitDISABLE_ONCOMMAND = FALSE;
358 typedef enum tagIXPISSTATE
366 HRESULT GetServerInfo(
367 [in,out] LPINETSERVER pInetServer);
369 IXPTYPE GetIXPType();
372 [in] IXPISSTATE isstate);
374 HRESULT InetServerFromAccount(
375 [in] IImnAccount *pAccount,
376 [in,out] LPINETSERVER pInetServer);
379 [in] LPINETSERVER pInetServer,
380 [in] boolean fAuthenticate,
381 [in] boolean fCommandLogging);
383 HRESULT HandsOffCallback();
385 HRESULT Disconnect();
387 HRESULT DropConnection();
390 [out] IXPSTATUS *pCurrentStatus);
395 uuid(1F636C02-364E-11D0-81D3-00C04FD85AB4),
398 interface ISMTPCallback : ITransportCallback
400 typedef enum tagSMTPCOMMAND
419 typedef struct tagSMTPSTREAM
424 } SMTPSTREAM, *LPSMTPSTREAM;
426 typedef struct tagSMTPRESPONSE
430 IXPRESULT rIxpResult;
431 ISMTPTransport *pTransport;
433 [switch_type(SMTPCOMMAND), switch_is(command)]
436 [case(SMTP_SEND_STREAM)] SMTPSTREAM rStreamInfo;
439 } SMTPRESPONSE, *LPSMTPRESPONSE;
442 [in] LPSMTPRESPONSE pResponse);
447 uuid(0DF2C7E2-3435-11D0-81D0-00C04FD85AB4),
450 interface ISMTPTransport : IInternetTransport
452 typedef struct tagSMTPMESSAGE
456 INETADDRLIST rAddressList;
457 } SMTPMESSAGE, *LPSMTPMESSAGE;
460 [in] LPSTR pszLogFilePath,
461 [in] ISMTPCallback *pCallback);
463 cpp_quote("#ifdef WINE_NO_UNICODE_MACROS")
464 cpp_quote("#undef SendMessage")
468 [in] LPSMTPMESSAGE pMessage);
471 [in] LPSTR pszEmailFrom);
474 [in] LPSTR pszEmailTo);
476 HRESULT CommandEHLO();
478 HRESULT CommandHELO();
481 [in] LPSTR pszAuthType);
483 HRESULT CommandQUIT();
485 HRESULT CommandRSET();
487 HRESULT CommandDATA();
489 HRESULT CommandDOT();
491 HRESULT SendDataStream(
492 [in] IStream *pStream,
498 uuid(0DF2C7EC-3435-11D0-81D0-00C04FD85AB4),
501 interface ISMTPTransport2 : ISMTPTransport
503 typedef struct tagSMTPMESSAGE2
510 } SMTPMESSAGE2, *LPSMTPMESSAGE2;
514 HRESULT ResetWindow();
516 HRESULT SendMessage2(
517 [in] LPSMTPMESSAGE2 pMessage);
519 HRESULT CommandRCPT2(
520 [in] LPSTR pszEmailTo,
521 [in] INETADDRTYPE atDSN);
524 /* FIXME: IDAVNamespaceArbiter, IPropPatchRequest, IPropFindRequest, IPropFindMultiResponse, IPropFindResponse, IHTTPMailCallback, IHTTPMailTransport */
528 uuid(0DF2C7E3-3435-11D0-81D0-00C04FD85AB4),
531 interface IPOP3Callback : ITransportCallback
533 typedef enum tagPOP3COMMAND
553 typedef struct tagPOP3RETR
561 } POP3RETR, *LPPOP3RETR;
563 typedef struct tagPOP3TOP
572 } POP3TOP, *LPPOP3TOP;
574 typedef struct tagPOP3LIST
578 } POP3LIST, *LPPOP3LIST;
580 typedef struct tagPOP3UIDL
584 } POP3UIDL, *LPPOP3UIDL;
586 typedef struct tagPOP3STAT
590 } POP3STAT, *LPPOP3STAT;
592 typedef struct tagPOP3RESPONSE
596 IXPRESULT rIxpResult;
597 IPOP3Transport *pTransport;
599 [switch_type(POP3COMMAND), switch_is(command)]
602 [case(POP3_UIDL)] POP3UIDL rUidlInfo;
603 [case(POP3_STAT)] POP3STAT rStatInfo;
604 [case(POP3_LIST)] POP3LIST rListInfo;
605 [case(POP3_DELE)] DWORD dwPopId;
606 [case(POP3_RETR)] POP3RETR rRetrInfo;
607 [case(POP3_TOP)] POP3TOP rTopInfo;
610 } POP3RESPONSE, *LPPOP3RESPONSE;
613 [in] LPPOP3RESPONSE pResponse);
618 uuid(0DF2C7E4-3435-11D0-81D0-00C04FD85AB4),
621 interface IPOP3Transport : IInternetTransport
623 typedef enum tagPOP3CMDTYPE
630 typedef enum tagPOP3MARKTYPE
632 POP3_MARK_FOR_TOP = 0x01,
633 POP3_MARK_FOR_RETR = 0x02,
634 POP3_MARK_FOR_DELE = 0x04,
635 POP3_MARK_FOR_UIDL = 0x08,
636 POP3_MARK_FOR_LIST = 0x10
640 [in] LPSTR pszLogFilePath,
641 [in] IPOP3Callback *pCallback);
644 [in] POP3MARKTYPE marktype,
646 [in] boolean fMarked);
649 [in] LPSTR pszAuthType);
652 [in] LPSTR pszUserName);
655 [in] LPSTR pszPassword);
658 [in] POP3CMDTYPE cmdtype,
662 [in] POP3CMDTYPE cmdtype,
664 [in] DWORD cPreviewLines);
666 HRESULT CommandQUIT();
668 HRESULT CommandSTAT();
670 HRESULT CommandNOOP();
672 HRESULT CommandRSET();
675 [in] POP3CMDTYPE cmdtype,
679 [in] POP3CMDTYPE cmdtype,
683 [in] POP3CMDTYPE cmdtype,
687 /* FIXME: INNTPCallback, INNTPTransport */
691 uuid(8C438160-4EF6-11d0-874F-00AA00530EE9),
694 interface IRangeList : IUnknown
696 const ULONG RL_RANGE_ERROR = ((ULONG)-1);
697 const ULONG RL_LAST_MESSAGE = ((ULONG)-1);
702 [in] const ULONG value);
705 [out] ULONG *pulMin);
708 [out] ULONG *pulMax);
711 [out] byte **ppbDestination,
712 [out] ULONG *pulSizeOfDestination);
715 [in, size_is(ulSizeOfSource)] byte *pbSource,
716 [in] const ULONG ulSizeOfSource);
719 [in] const ULONG low,
720 [in] const ULONG high);
722 HRESULT AddSingleValue(
723 [in] const ULONG value);
725 HRESULT AddRangeList(
726 [in] const IRangeList *prl);
729 [in] const ULONG low,
730 [in] const ULONG high);
732 HRESULT DeleteSingleValue(
733 [in] const ULONG value);
735 HRESULT DeleteRangeList(
736 [in] const IRangeList *prl);
739 [in] const ULONG value,
740 [out] ULONG *pulMinOfRange);
743 [in] const ULONG value,
744 [out] ULONG *pulMaxOfRange);
746 HRESULT RangeToIMAPString(
747 [out] LPSTR *ppszDestination,
748 [out] LPDWORD pdwLengthOfDestination);
751 [in] const ULONG current,
752 [out] ULONG *pulNext);
755 [in] const ULONG current,
756 [out] ULONG *pulPrev);
759 [out] ULONG *pulCardinality);
761 HRESULT CardinalityFrom(
762 [in] const ULONG ulStartPoint,
763 [out] ULONG *pulCardinalityFrom);
768 uuid(E9E9D8A3-4EDD-11d0-874F-00AA00530EE9),
771 interface IIMAPCallback : ITransportCallback
773 typedef DWORD IMAP_MBOXFLAGS;
774 const IMAP_MBOXFLAGS IMAP_MBOX_NOFLAGS = 0x0;
775 const IMAP_MBOXFLAGS IMAP_MBOX_MARKED = 0x1;
776 const IMAP_MBOXFLAGS IMAP_MBOX_NOINFERIORS = 0x2;
777 const IMAP_MBOXFLAGS IMAP_MBOX_NOSELECT = 0x4;
778 const IMAP_MBOXFLAGS IMAP_MBOX_UNMARKED = 0x8;
779 const IMAP_MBOXFLAGS IMAP_MBOX_ALLFLAGS = 0xf;
781 typedef enum tagIMAP_RESPONSE_TYPE
783 irtERROR_NOTIFICATION,
784 irtCOMMAND_COMPLETION,
801 } IMAP_RESPONSE_TYPE;
803 typedef struct tagFETCH_BODY_PART
812 LPARAM lpFetchCookie1;
813 LPARAM lpFetchCookie2;
816 typedef struct tagFETCH_CMD_RESULTS
820 IMAP_MSGFLAGS mfMsgFlags;
826 FILETIME ftInternalDate;
827 LPARAM lpFetchCookie1;
828 LPARAM lpFetchCookie2;
831 typedef struct tagIMAPADDR
837 struct tagIMAPADDR *pNext;
840 typedef struct tagFETCH_CMD_RESULTS_EX
844 IMAP_MSGFLAGS mfMsgFlags;
850 FILETIME ftInternalDate;
851 LPARAM lpFetchCookie1;
852 LPARAM lpFetchCookie2;
856 IMAPADDR *piaENVFrom;
857 IMAPADDR *piaENVSender;
858 IMAPADDR *piaENVReplyTo;
862 LPSTR pszENVInReplyTo;
863 LPSTR pszENVMessageID;
867 } FETCH_CMD_RESULTS_EX;
869 typedef struct tagMBOX_MSGCOUNT
871 BOOL bGotExistsResponse;
873 BOOL bGotRecentResponse;
875 BOOL bGotUnseenResponse;
879 typedef struct tagIMAP_LISTLSUB_RESPONSE
881 LPSTR pszMailboxName;
882 IMAP_MBOXFLAGS imfMboxFlags;
884 } IMAP_LISTLSUB_RESPONSE;
886 typedef struct tagIMAP_STATUS_RESPONSE
888 LPSTR pszMailboxName;
899 } IMAP_STATUS_RESPONSE;
901 typedef struct tagAPPEND_PROGRESS
907 typedef [switch_type(IMAP_RESPONSE_TYPE)] union tagIMAP_RESPONSE_DATA
909 [case (irtMAILBOX_UPDATE)] MBOX_MSGCOUNT *pmcMsgCount;
910 [case (irtDELETED_MSG)] DWORD dwDeletedMsgSeqNum;
911 [case (irtFETCH_BODY)] FETCH_BODY_PART *pFetchBodyPart;
912 [case (irtUPDATE_MSG)] FETCH_CMD_RESULTS *pFetchResults;
913 [case (irtAPPLICABLE_FLAGS, irtPERMANENT_FLAGS)] IMAP_MSGFLAGS imfImapMessageFlags;
914 [case (irtUIDVALIDITY)] DWORD dwUIDValidity;
915 [case (irtREADWRITE_STATUS)] BOOL bReadWrite;
916 [case (irtSEARCH)] IRangeList *prlSearchResults;
917 [case (irtMAILBOX_LISTING)] IMAP_LISTLSUB_RESPONSE illrdMailboxListing;
918 [case (irtMAILBOX_STATUS)] IMAP_STATUS_RESPONSE *pisrStatusResponse;
919 [case (irtAPPEND_PROGRESS)] APPEND_PROGRESS *papAppendProgress;
920 [case (irtUPDATE_MSG_EX)] FETCH_CMD_RESULTS_EX *pFetchResultsEx;
921 } IMAP_RESPONSE_DATA;
923 typedef struct tagIMAP_RESPONSE
928 LPSTR lpszResponseText;
929 IMAP_RESPONSE_TYPE irtResponseType;
930 [switch_is(irtResponseType)] IMAP_RESPONSE_DATA irdResponseData;
933 HRESULT OnResponse([in] const IMAP_RESPONSE *pirIMAPResponse);
938 uuid(E9E9D8A8-4EDD-11d0-874F-00AA00530EE9),
941 interface IIMAPTransport : IInternetTransport
943 const DWORD IMAP_CAPABILITY_IMAP4 = 0x1;
944 const DWORD IMAP_CAPABILITY_IMAP4rev1 = 0x2;
945 const DWORD IMAP_CAPABILITY_IDLE = 0x4;
946 const DWORD IMAP_CAPABILITY_ALLFLAGS = 0x7;
949 [in] LPSTR pszLogFilePath,
950 [in] IIMAPCallback *pCBHandler);
952 HRESULT NewIRangeList(
953 [out] IRangeList **pprlNewRangeList);
956 [out] DWORD *pdwCapabilityFlags);
961 [in] IIMAPCallback *pCBHandler,
962 [in] LPSTR lpszMailboxName);
967 [in] IIMAPCallback *pCBHandler,
968 [in] LPSTR lpszMailboxName);
973 [in] IIMAPCallback *pCBHandler,
974 [in] LPSTR lpszMailboxName);
979 [in] IIMAPCallback *pCBHandler,
980 [in] LPSTR lpszMailboxName);
985 [in] IIMAPCallback *pCBHandler,
986 [in] LPSTR lpszMailboxName,
987 [in] LPSTR lpszNewMailboxName);
992 [in] IIMAPCallback *pCBHandler,
993 [in] LPSTR lpszMailboxName);
998 [in] IIMAPCallback *pCBHandler,
999 [in] LPSTR lpszMailboxName);
1004 [in] IIMAPCallback *pCBHandler,
1005 [in] LPSTR lpszMailboxNameReference,
1006 [in] LPSTR lpszMailboxNamePattern);
1011 [in] IIMAPCallback *pCBHandler,
1012 [in] LPSTR lpszMailboxNameReference,
1013 [in] LPSTR lpszMailboxNamePattern);
1018 [in] IIMAPCallback *pCBHandler,
1019 [in] LPSTR lpszMailboxName,
1020 [in] LPSTR lpszMessageFlags,
1021 [in] FILETIME ftMessageDateTime,
1022 [in] LPSTREAM lpstmMessageToSave);
1027 [in] IIMAPCallback *pCBHandler);
1032 [in] IIMAPCallback *pCBHandler);
1037 [in] IIMAPCallback *pCBHandler,
1038 [in] LPSTR lpszSearchCriteria,
1039 [in] boolean bReturnUIDs,
1040 [in] IRangeList *pMsgRange,
1041 [in] boolean bUIDRangeList);
1046 [in] IIMAPCallback *pCBHandler,
1047 [in] IRangeList *pMsgRange,
1048 [in] boolean bUIDMsgRange,
1049 [in] LPSTR lpszFetchArgs);
1054 [in] IIMAPCallback *pCBHandler,
1055 [in] IRangeList *pMsgRange,
1056 [in] boolean bUIDRangeList,
1057 [in] LPSTR lpszStoreArgs);
1062 [in] IIMAPCallback *pCBHandler,
1063 [in] IRangeList *pMsgRange,
1064 [in] boolean bUIDRangeList,
1065 [in] LPSTR lpszMailboxName);
1070 [in] IIMAPCallback *pCBHandler);
1072 HRESULT ResizeMsgSeqNumTable(
1073 [in] DWORD dwSizeOfMbox);
1075 HRESULT UpdateSeqNumToUID(
1076 [in] DWORD dwMsgSeqNum,
1079 HRESULT RemoveSequenceNum(
1080 [in] DWORD dwDeletedMsgSeqNum);
1082 HRESULT MsgSeqNumToUID(
1083 [in] DWORD dwMsgSeqNum,
1084 [out] DWORD *pdwUID);
1086 HRESULT GetMsgSeqNumToUIDArray(
1087 [out] DWORD **ppdwMsgSeqNumToUIDArray,
1088 [out] DWORD *pdwNumberOfElements);
1090 HRESULT GetHighestMsgSeqNum(
1091 [out] DWORD *pdwHighestMSN);
1093 HRESULT ResetMsgSeqNumToUID();
1095 HRESULT SetDefaultCBHandler(
1096 [in] IIMAPCallback *pCBHandler);
1101 [in] IIMAPCallback *pCBHandler,
1102 [in] LPSTR pszMailboxName,
1103 [in] LPSTR pszStatusCmdArgs);
1107 cpp_quote("HRESULT WINAPI CreateRASTransport(IRASTransport **ppTransport);")
1108 cpp_quote("HRESULT WINAPI CreateNNTPTransport(INNTPTransport **ppTransport);")
1109 cpp_quote("HRESULT WINAPI CreateIMAPTransport2(IIMAPTransport2 **ppTransport);")
1111 cpp_quote("HRESULT WINAPI CreateRangeList(IRangeList **ppRangeList);")
1112 cpp_quote("HRESULT WINAPI CreateSMTPTransport(ISMTPTransport **ppTransport);")
1113 cpp_quote("HRESULT WINAPI CreatePOP3Transport(IPOP3Transport **ppTransport);")
1114 cpp_quote("HRESULT WINAPI CreateIMAPTransport(IIMAPTransport **ppTransport);")