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 DECLARE_INTERFACE_(IMAPISession,IUnknown)
108 /*** IUnknown methods ***/
109 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
110 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
111 STDMETHOD_(ULONG,Release)(THIS) PURE;
112 /*** IMAPISession methods ***/
113 STDMETHOD(GetLastError)(THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR *lppMAPIError) PURE;
114 STDMETHOD(GetMsgStoresTable)(THIS_ ULONG ulFlags, LPMAPITABLE *lppTable) PURE;
115 STDMETHOD(OpenMsgStore)(THIS_ ULONG_PTR ulUIParam, ULONG cbId,
116 LPENTRYID lpId, LPCIID lpIFace, ULONG ulFlags, LPMDB *lppMDB) PURE;
117 STDMETHOD(OpenAddressBook)(THIS_ ULONG_PTR ulUIParam, LPCIID iid, ULONG ulFlags, LPADRBOOK *lppAdrBook) PURE;
118 STDMETHOD(OpenProfileSection)(THIS_ LPMAPIUID lpUID, LPCIID iid, ULONG ulFlags, LPPROFSECT *lppProf) PURE;
119 STDMETHOD(GetStatusTable)(THIS_ ULONG ulFlags, LPMAPITABLE *lppTable) PURE;
120 STDMETHOD(OpenEntry)(THIS_ ULONG cbId, LPENTRYID lpId, LPCIID iid,
121 ULONG ulFlags, ULONG *lpType, LPUNKNOWN *lppUnk) PURE;
122 STDMETHOD(CompareEntryIDs)(THIS_ ULONG cbLID, LPENTRYID lpLID, ULONG cbRID,
123 LPENTRYID lpRID, ULONG ulFlags, ULONG *lpRes) PURE;
124 STDMETHOD(Advise)(THIS_ ULONG cbId, LPENTRYID lpId, ULONG ulMask,
125 LPMAPIADVISESINK lpSink, ULONG *lpCxn) PURE;
126 STDMETHOD(Unadvise)(THIS_ ULONG ulConnection) PURE;
127 STDMETHOD(MessageOptions)(THIS_ ULONG_PTR ulUIParam, ULONG ulFlags, LPSTR lpszAddr, LPMESSAGE lpMsg) PURE;
128 STDMETHOD(QueryDefaultMessageOpt)(THIS_ LPSTR lpszAddr, ULONG ulFlags,
129 ULONG *lpcVals, LPSPropValue *lppOpts) PURE;
130 STDMETHOD(EnumAdrTypes)(THIS_ ULONG ulFlags, ULONG *lpcTypes, LPSTR **lpppszTypes) PURE;
131 STDMETHOD(QueryIdentity)(THIS_ ULONG *lpcbId, LPENTRYID *lppEntryID) PURE;
132 STDMETHOD(Logoff)(THIS_ ULONG_PTR ulUIParam, ULONG ulFlags, ULONG ulReserved) PURE;
133 STDMETHOD(SetDefaultStore)(THIS_ ULONG ulFlags, ULONG cbId, LPENTRYID lpId) PURE;
134 STDMETHOD(AdminServices)(THIS_ ULONG ulFlags, LPSERVICEADMIN *lppAdmin) PURE;
135 STDMETHOD(ShowForm)(THIS_ ULONG_PTR ulUIParam, LPMDB lpStore,
136 LPMAPIFOLDER lpParent, LPCIID iid, ULONG ulToken,
137 LPMESSAGE lpSent, ULONG ulFlags, ULONG ulStatus,
138 ULONG ulMsgFlags, ULONG ulAccess, LPSTR lpszClass) PURE;
139 STDMETHOD(PrepareForm)(THIS_ LPCIID lpIFace, LPMESSAGE lpMsg, ULONG *lpToken) PURE;
143 #if !defined(__cplusplus) || defined(CINTERFACE)
144 /*** IUnknown methods ***/
145 #define IMAPISession_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
146 #define IMAPISession_AddRef(p) (p)->lpVtbl->AddRef(p)
147 #define IMAPISession_Release(p) (p)->lpVtbl->Release(p)
148 /*** IMAPISession methods ***/
149 #define IMAPISession_GetLastError(p,a,b,c) (p)->lpVtbl->GetLastError(p,a,b,c)
150 #define IMAPISession_GetMsgStoresTable(p,a,b) (p)->lpVtbl->GetMsgStoresTable(p,a,b)
151 #define IMAPISession_OpenMsgStore(p,a,b,c,d,e,f) (p)->lpVtbl->OpenMsgStore(p,a,b,c,d,e,f)
152 #define IMAPISession_OpenAddressBook(p,a,b,c,d) (p)->lpVtbl->OpenAddressBook(p,a,b,c,d)
153 #define IMAPISession_OpenProfileSection(p,a,b,c,d) (p)->lpVtbl->OpenProfileSection(p,a,b,c,d)
154 #define IMAPISession_GetStatusTable(p,a,b) (p)->lpVtbl->GetStatusTable(p,a,b)
155 #define IMAPISession_OpenEntry(p,a,b,c,d,e,f) (p)->lpVtbl->OpenEntry(p,a,b,c,d,e,f)
156 #define IMAPISession_CompareEntryIDs(p,a,b,c,d,e,f) (p)->lpVtbl->CompareEntryIDs(p,a,b,c,d,e,f)
157 #define IMAPISession_Advise(p,a,b,c,d,e) (p)->lpVtbl->Advise(p,a,b,c,d,e)
158 #define IMAPISession_Unadvise(p,a) (p)->lpVtbl->Unadvise(p,a)
159 #define IMAPISession_MessageOptions(p,a,b,c,d) (p)->lpVtbl->MessageOptions)(p,a,b,c,d)
160 #define IMAPISession_QueryDefaultMessageOpt(p,a,b,c,d) \
161 (p)->lpVtbl->QueryDefaultMessageOpt(p,a,b,c,d)
162 #define IMAPISession_EnumAdrTypes(p,a,b,c) (p)->lpVtbl->EnumAdrTypes(p,a,b,c)
163 #define IMAPISession_QueryIdentity(p,a,b) (p)->lpVtbl->QueryIdentity(p,a,b)
164 #define IMAPISession_Logoff(p,a,b,c) (p)->lpVtbl->Logoff(p,a,b,c)
165 #define IMAPISession_SetDefaultStore(p,a,b,c) (p)->lpVtbl->SetDefaultStore(p,a,b,c)
166 #define IMAPISession_AdminServices(p,a,b) (p)->lpVtbl->AdminServices(p,a,b)
167 #define IMAPISession_ShowForm(p,a,b,c,d,e,f,g,h,i,j,k) \
168 (p)->lpVtbl->ShowForm(p,a,b,c,d,e,f,g,h,i,j,k)
169 #define IMAPISession_PrepareForm(p,a,b,c) (p)->lpVtbl->PrepareForm(p,a,b,c)