2 * Copyright 2004 Jon Griffiths
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
39 typedef struct IProfAdmin IProfAdmin
;
40 typedef IProfAdmin
*LPPROFADMIN
;
41 typedef struct IMsgServiceAdmin IMsgServiceAdmin
;
42 typedef IMsgServiceAdmin
*LPSERVICEADMIN
;
43 typedef struct IMAPISession IMAPISession
;
44 typedef IMAPISession
*LPMAPISESSION
;
46 typedef unsigned long FLAGS
;
48 /* Flags for MAPILogon and MAPILogonEx */
49 #define MAPI_LOGON_UI 0x000001
50 #define MAPI_NEW_SESSION 0x000002
51 #define MAPI_EXTENDED 0x000020
52 #define MAPI_FORCE_DOWNLOAD 0x001000
53 #define MAPI_PASSWORD_UI 0x020000
54 #define MAPI_ALLOW_OTHERS 0x000008
55 #define MAPI_EXPLICIT_PROFILE 0x000010
56 #define MAPI_SERVICE_UI_ALWAYS 0x002000
57 #define MAPI_NO_MAIL 0x008000
58 #define MAPI_NT_SERVICE 0x010000
59 #define MAPI_TIMEOUT_SHORT 0x100000
61 #define MAPI_SIMPLE_DEFAULT (MAPI_LOGON_UI|MAPI_ALLOW_OTHERS|MAPI_FORCE_DOWNLOAD)
62 #define MAPI_SIMPLE_EXPLICIT (MAPI_NEW_SESSION|MAPI_EXPLICIT_PROFILE|MAPI_FORCE_DOWNLOAD)
64 typedef struct tagMAPIINIT_0
68 } MAPIINIT_0
, *LPMAPIINIT_0
;
70 typedef MAPIINIT_0 MAPIINIT
, *LPMAPIINIT
;
72 #define MAPI_INIT_VERSION 0U
74 typedef HRESULT (WINAPI MAPIINITIALIZE
)(void*);
75 typedef MAPIINITIALIZE
*LPMAPIINITIALIZE
;
76 MAPIINITIALIZE MAPIInitialize
;
78 typedef void (WINAPI MAPIUNINITIALIZE
)(void);
79 typedef MAPIUNINITIALIZE
*LPMAPIUNINITIALIZE
;
80 MAPIUNINITIALIZE MAPIUninitialize
;
82 #if defined (UNICODE) || defined (__WINESRC__)
83 typedef HRESULT (STDMETHODCALLTYPE MAPILOGONEX
)(ULONG_PTR
,LPWSTR
,LPWSTR
,ULONG
,LPMAPISESSION
*);
85 typedef HRESULT (STDMETHODCALLTYPE MAPILOGONEX
)(ULONG_PTR
,LPSTR
,LPSTR
,ULONG
,LPMAPISESSION
*);
87 typedef MAPILOGONEX
*LPMAPILOGONEX
;
88 MAPILOGONEX MAPILogonEx
;
90 typedef SCODE (WINAPI MAPIALLOCATEBUFFER
)(ULONG
,LPVOID
*);
91 typedef MAPIALLOCATEBUFFER
*LPMAPIALLOCATEBUFFER
;
92 MAPIALLOCATEBUFFER MAPIAllocateBuffer
;
94 typedef SCODE (WINAPI MAPIALLOCATEMORE
)(ULONG
,LPVOID
,LPVOID
*);
95 typedef MAPIALLOCATEMORE
*LPMAPIALLOCATEMORE
;
96 MAPIALLOCATEMORE MAPIAllocateMore
;
98 typedef ULONG (WINAPI MAPIFREEBUFFER
)(LPVOID
);
99 typedef MAPIFREEBUFFER
*LPMAPIFREEBUFFER
;
100 MAPIFREEBUFFER MAPIFreeBuffer
;
102 /*****************************************************************************
103 * IMAPISession interface
105 #define INTERFACE IMAPISession
106 #define IMAPISession_METHODS \
108 STDMETHOD(GetLastError)(THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR *lppMAPIError) PURE; \
109 STDMETHOD(GetMsgStoresTable)(THIS_ ULONG ulFlags, LPMAPITABLE *lppTable) PURE; \
110 STDMETHOD(OpenMsgStore)(THIS_ ULONG_PTR ulUIParam, ULONG cbId, \
111 LPENTRYID lpId, LPCIID lpIFace, ULONG ulFlags, LPMDB *lppMDB) PURE; \
112 STDMETHOD(OpenAddressBook)(THIS_ ULONG_PTR ulUIParam, LPCIID iid, ULONG ulFlags, LPADRBOOK *lppAdrBook) PURE; \
113 STDMETHOD(OpenProfileSection)(THIS_ LPMAPIUID lpUID, LPCIID iid, ULONG ulFlags, LPPROFSECT *lppProf) PURE; \
114 STDMETHOD(GetStatusTable)(THIS_ ULONG ulFlags, LPMAPITABLE *lppTable) PURE; \
115 STDMETHOD(OpenEntry)(THIS_ ULONG cbId, LPENTRYID lpId, LPCIID iid, \
116 ULONG ulFlags, ULONG *lpType, LPUNKNOWN *lppUnk) PURE; \
117 STDMETHOD(CompareEntryIDs)(THIS_ ULONG cbLID, LPENTRYID lpLID, ULONG cbRID, \
118 LPENTRYID lpRID, ULONG ulFlags, ULONG *lpRes) PURE; \
119 STDMETHOD(Advise)(THIS_ ULONG cbId, LPENTRYID lpId, ULONG ulMask, \
120 LPMAPIADVISESINK lpSink, ULONG *lpCxn) PURE;\
121 STDMETHOD(Unadvise)(THIS_ ULONG ulConnection) PURE;\
122 STDMETHOD(MessageOptions)(THIS_ ULONG_PTR ulUIParam, ULONG ulFlags, LPSTR lpszAddr, LPMESSAGE lpMsg) PURE; \
123 STDMETHOD(QueryDefaultMessageOpt)(THIS_ LPSTR lpszAddr, ULONG ulFlags, \
124 ULONG *lpcVals, LPSPropValue *lppOpts) PURE; \
125 STDMETHOD(EnumAdrTypes)(THIS_ ULONG ulFlags, ULONG *lpcTypes, LPSTR **lpppszTypes) PURE; \
126 STDMETHOD(QueryIdentity)(THIS_ ULONG *lpcbId, LPENTRYID *lppEntryID) PURE; \
127 STDMETHOD(Logoff)(THIS_ ULONG_PTR ulUIParam, ULONG ulFlags, ULONG ulReserved) PURE; \
128 STDMETHOD(SetDefaultStore)(THIS_ ULONG ulFlags, ULONG cbId, LPENTRYID lpId) PURE; \
129 STDMETHOD(AdminServices)(THIS_ ULONG ulFlags, LPSERVICEADMIN *lppAdmin) PURE; \
130 STDMETHOD(ShowForm)(THIS_ ULONG_PTR ulUIParam, LPMDB lpStore, \
131 LPMAPIFOLDER lpParent, LPCIID iid, ULONG ulToken, \
132 LPMESSAGE lpSent, ULONG ulFlags, ULONG ulStatus, \
133 ULONG ulMsgFlags, ULONG ulAccess, LPSTR lpszClass) PURE; \
134 STDMETHOD(PrepareForm)(THIS_ LPCIID lpIFace, LPMESSAGE lpMsg, ULONG *lpToken) PURE;
135 ICOM_DEFINE(IMAPISession
,IUnknown
)
139 /*** IUnknown methods ***/
140 #define IMAPISession_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
141 #define IMAPISession_AddRef(p) (p)->lpVtbl->AddRef(p)
142 #define IMAPISession_Release(p) (p)->lpVtbl->Release(p)
143 /*** IMAPISession methods ***/
144 #define IMAPISession_GetLastError(p,a,b,c) (p)->lpVtbl->GetLastError(p,a,b,c)
145 #define IMAPISession_GetMsgStoresTable(p,a,b) (p)->lpVtbl->GetMsgStoresTable(p,a,b)
146 #define IMAPISession_OpenMsgStore(p,a,b,c,d,e,f) (p)->lpVtbl->OpenMsgStore(p,a,b,c,d,e,f)
147 #define IMAPISession_OpenAddressBook(p,a,b,c,d) (p)->lpVtbl->OpenAddressBook(p,a,b,c,d)
148 #define IMAPISession_OpenProfileSection(p,a,b,c,d) (p)->lpVtbl->OpenProfileSection(p,a,b,c,d)
149 #define IMAPISession_GetStatusTable(p,a,b) (p)->lpVtbl->GetStatusTable(p,a,b)
150 #define IMAPISession_OpenEntry(p,a,b,c,d,e,f) (p)->lpVtbl->OpenEntry(p,a,b,c,d,e,f)
151 #define IMAPISession_CompareEntryIDs(p,a,b,c,d,e,f) (p)->lpVtbl->CompareEntryIDs(p,a,b,c,d,e,f)
152 #define IMAPISession_Advise(p,a,b,c,d,e) (p)->lpVtbl->Advise(p,a,b,c,d,e)
153 #define IMAPISession_Unadvise(p,a) (p)->lpVtbl->Unadvise(p,a)
154 #define IMAPISession_MessageOptions(p,a,b,c,d) (p)->lpVtbl->MessageOptions)(p,a,b,c,d)
155 #define IMAPISession_QueryDefaultMessageOpt(p,a,b,c,d) \
156 (p)->lpVtbl->QueryDefaultMessageOpt(p,a,b,c,d)
157 #define IMAPISession_EnumAdrTypes(p,a,b,c) (p)->lpVtbl->EnumAdrTypes(p,a,b,c)
158 #define IMAPISession_QueryIdentity(p,a,b) (p)->lpVtbl->QueryIdentity(p,a,b)
159 #define IMAPISession_Logoff(p,a,b,c) (p)->lpVtbl->Logoff(p,a,b,c)
160 #define IMAPISession_SetDefaultStore(p,a,b,c) (p)->lpVtbl->SetDefaultStore(p,a,b,c)
161 #define IMAPISession_AdminServices(p,a,b) (p)->lpVtbl->AdminServices(p,a,b)
162 #define IMAPISession_ShowForm(p,a,b,c,d,e,f,g,h,i,j,k) \
163 (p)->lpVtbl->ShowForm(p,a,b,c,d,e,f,g,h,i,j,k)
164 #define IMAPISession_PrepareForm(p,a,b,c) (p)->lpVtbl->PrepareForm(p,a,b,c)