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
*LPMAPISESSION
;
45 typedef unsigned long FLAGS
;
47 /* Flags for MAPILogon and MAPILogonEx */
48 #define MAPI_LOGON_UI 0x000001
49 #define MAPI_NEW_SESSION 0x000002
50 #define MAPI_EXTENDED 0x000020
51 #define MAPI_FORCE_DOWNLOAD 0x001000
52 #define MAPI_PASSWORD_UI 0x020000
53 #define MAPI_ALLOW_OTHERS 0x000008
54 #define MAPI_EXPLICIT_PROFILE 0x000010
55 #define MAPI_SERVICE_UI_ALWAYS 0x002000
56 #define MAPI_NO_MAIL 0x008000
57 #define MAPI_NT_SERVICE 0x010000
58 #define MAPI_TIMEOUT_SHORT 0x100000
60 #define MAPI_SIMPLE_DEFAULT (MAPI_LOGON_UI|MAPI_ALLOW_OTHERS|MAPI_FORCE_DOWNLOAD)
61 #define MAPI_SIMPLE_EXPLICIT (MAPI_NEW_SESSION|MAPI_EXPLICIT_PROFILE|MAPI_FORCE_DOWNLOAD)
63 typedef struct tagMAPIINIT_0
67 } MAPIINIT_0
, *LPMAPIINIT_0
;
69 typedef MAPIINIT_0 MAPIINIT
, *LPMAPIINIT
;
71 #define MAPI_INIT_VERSION 0U
73 typedef HRESULT (WINAPI MAPIINITIALIZE
)(void*);
74 typedef MAPIINITIALIZE
*LPMAPIINITIALIZE
;
75 MAPIINITIALIZE MAPIInitialize
;
77 typedef void (WINAPI MAPIUNINITIALIZE
)(void);
78 typedef MAPIUNINITIALIZE
*LPMAPIUNINITIALIZE
;
79 MAPIUNINITIALIZE MAPIUninitialize
;
81 #if defined (UNICODE) || defined (__WINESRC__)
82 typedef HRESULT (STDMETHODCALLTYPE MAPILOGONEX
)(ULONG_PTR
,LPWSTR
,LPWSTR
,ULONG
,LPMAPISESSION
*);
84 typedef HRESULT (STDMETHODCALLTYPE MAPILOGONEX
)(ULONG_PTR
,LPSTR
,LPSTR
,ULONG
,LPMAPISESSION
*);
86 typedef MAPILOGONEX
*LPMAPILOGONEX
;
87 MAPILOGONEX MAPILogonEx
;
89 typedef SCODE (WINAPI MAPIALLOCATEBUFFER
)(ULONG
,LPVOID
*);
90 typedef MAPIALLOCATEBUFFER
*LPMAPIALLOCATEBUFFER
;
91 MAPIALLOCATEBUFFER MAPIAllocateBuffer
;
93 typedef SCODE (WINAPI MAPIALLOCATEMORE
)(ULONG
,LPVOID
,LPVOID
*);
94 typedef MAPIALLOCATEMORE
*LPMAPIALLOCATEMORE
;
95 MAPIALLOCATEMORE MAPIAllocateMore
;
97 typedef ULONG (WINAPI MAPIFREEBUFFER
)(LPVOID
);
98 typedef MAPIFREEBUFFER
*LPMAPIFREEBUFFER
;
99 MAPIFREEBUFFER MAPIFreeBuffer
;
101 /*****************************************************************************
102 * IMAPISession interface
104 #define INTERFACE IMAPISession
105 DECLARE_INTERFACE_(IMAPISession
,IUnknown
)
107 /*** IUnknown methods ***/
108 STDMETHOD_(HRESULT
,QueryInterface
)(THIS_ REFIID riid
, void** ppvObject
) PURE
;
109 STDMETHOD_(ULONG
,AddRef
)(THIS
) PURE
;
110 STDMETHOD_(ULONG
,Release
)(THIS
) PURE
;
111 /*** IMAPISession methods ***/
112 STDMETHOD(GetLastError
)(THIS_ HRESULT hResult
, ULONG ulFlags
, LPMAPIERROR
*lppMAPIError
) PURE
;
113 STDMETHOD(GetMsgStoresTable
)(THIS_ ULONG ulFlags
, LPMAPITABLE
*lppTable
) PURE
;
114 STDMETHOD(OpenMsgStore
)(THIS_ ULONG_PTR ulUIParam
, ULONG cbId
,
115 LPENTRYID lpId
, LPCIID lpIFace
, ULONG ulFlags
, LPMDB
*lppMDB
) PURE
;
116 STDMETHOD(OpenAddressBook
)(THIS_ ULONG_PTR ulUIParam
, LPCIID iid
, ULONG ulFlags
, LPADRBOOK
*lppAdrBook
) PURE
;
117 STDMETHOD(OpenProfileSection
)(THIS_ LPMAPIUID lpUID
, LPCIID iid
, ULONG ulFlags
, LPPROFSECT
*lppProf
) PURE
;
118 STDMETHOD(GetStatusTable
)(THIS_ ULONG ulFlags
, LPMAPITABLE
*lppTable
) PURE
;
119 STDMETHOD(OpenEntry
)(THIS_ ULONG cbId
, LPENTRYID lpId
, LPCIID iid
,
120 ULONG ulFlags
, ULONG
*lpType
, LPUNKNOWN
*lppUnk
) PURE
;
121 STDMETHOD(CompareEntryIDs
)(THIS_ ULONG cbLID
, LPENTRYID lpLID
, ULONG cbRID
,
122 LPENTRYID lpRID
, ULONG ulFlags
, ULONG
*lpRes
) PURE
;
123 STDMETHOD(Advise
)(THIS_ ULONG cbId
, LPENTRYID lpId
, ULONG ulMask
,
124 LPMAPIADVISESINK lpSink
, ULONG
*lpCxn
) PURE
;
125 STDMETHOD(Unadvise
)(THIS_ ULONG ulConnection
) PURE
;
126 STDMETHOD(MessageOptions
)(THIS_ ULONG_PTR ulUIParam
, ULONG ulFlags
, LPSTR lpszAddr
, LPMESSAGE lpMsg
) PURE
;
127 STDMETHOD(QueryDefaultMessageOpt
)(THIS_ LPSTR lpszAddr
, ULONG ulFlags
,
128 ULONG
*lpcVals
, LPSPropValue
*lppOpts
) PURE
;
129 STDMETHOD(EnumAdrTypes
)(THIS_ ULONG ulFlags
, ULONG
*lpcTypes
, LPSTR
**lpppszTypes
) PURE
;
130 STDMETHOD(QueryIdentity
)(THIS_ ULONG
*lpcbId
, LPENTRYID
*lppEntryID
) PURE
;
131 STDMETHOD(Logoff
)(THIS_ ULONG_PTR ulUIParam
, ULONG ulFlags
, ULONG ulReserved
) PURE
;
132 STDMETHOD(SetDefaultStore
)(THIS_ ULONG ulFlags
, ULONG cbId
, LPENTRYID lpId
) PURE
;
133 STDMETHOD(AdminServices
)(THIS_ ULONG ulFlags
, LPSERVICEADMIN
*lppAdmin
) PURE
;
134 STDMETHOD(ShowForm
)(THIS_ ULONG_PTR ulUIParam
, LPMDB lpStore
,
135 LPMAPIFOLDER lpParent
, LPCIID iid
, ULONG ulToken
,
136 LPMESSAGE lpSent
, ULONG ulFlags
, ULONG ulStatus
,
137 ULONG ulMsgFlags
, ULONG ulAccess
, LPSTR lpszClass
) PURE
;
138 STDMETHOD(PrepareForm
)(THIS_ LPCIID lpIFace
, LPMESSAGE lpMsg
, ULONG
*lpToken
) PURE
;
142 #if !defined(__cplusplus) || defined(CINTERFACE)
143 /*** IUnknown methods ***/
144 #define IMAPISession_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
145 #define IMAPISession_AddRef(p) (p)->lpVtbl->AddRef(p)
146 #define IMAPISession_Release(p) (p)->lpVtbl->Release(p)
147 /*** IMAPISession methods ***/
148 #define IMAPISession_GetLastError(p,a,b,c) (p)->lpVtbl->GetLastError(p,a,b,c)
149 #define IMAPISession_GetMsgStoresTable(p,a,b) (p)->lpVtbl->GetMsgStoresTable(p,a,b)
150 #define IMAPISession_OpenMsgStore(p,a,b,c,d,e,f) (p)->lpVtbl->OpenMsgStore(p,a,b,c,d,e,f)
151 #define IMAPISession_OpenAddressBook(p,a,b,c,d) (p)->lpVtbl->OpenAddressBook(p,a,b,c,d)
152 #define IMAPISession_OpenProfileSection(p,a,b,c,d) (p)->lpVtbl->OpenProfileSection(p,a,b,c,d)
153 #define IMAPISession_GetStatusTable(p,a,b) (p)->lpVtbl->GetStatusTable(p,a,b)
154 #define IMAPISession_OpenEntry(p,a,b,c,d,e,f) (p)->lpVtbl->OpenEntry(p,a,b,c,d,e,f)
155 #define IMAPISession_CompareEntryIDs(p,a,b,c,d,e,f) (p)->lpVtbl->CompareEntryIDs(p,a,b,c,d,e,f)
156 #define IMAPISession_Advise(p,a,b,c,d,e) (p)->lpVtbl->Advise(p,a,b,c,d,e)
157 #define IMAPISession_Unadvise(p,a) (p)->lpVtbl->Unadvise(p,a)
158 #define IMAPISession_MessageOptions(p,a,b,c,d) (p)->lpVtbl->MessageOptions)(p,a,b,c,d)
159 #define IMAPISession_QueryDefaultMessageOpt(p,a,b,c,d) \
160 (p)->lpVtbl->QueryDefaultMessageOpt(p,a,b,c,d)
161 #define IMAPISession_EnumAdrTypes(p,a,b,c) (p)->lpVtbl->EnumAdrTypes(p,a,b,c)
162 #define IMAPISession_QueryIdentity(p,a,b) (p)->lpVtbl->QueryIdentity(p,a,b)
163 #define IMAPISession_Logoff(p,a,b,c) (p)->lpVtbl->Logoff(p,a,b,c)
164 #define IMAPISession_SetDefaultStore(p,a,b,c) (p)->lpVtbl->SetDefaultStore(p,a,b,c)
165 #define IMAPISession_AdminServices(p,a,b) (p)->lpVtbl->AdminServices(p,a,b)
166 #define IMAPISession_ShowForm(p,a,b,c,d,e,f,g,h,i,j,k) \
167 (p)->lpVtbl->ShowForm(p,a,b,c,d,e,f,g,h,i,j,k)
168 #define IMAPISession_PrepareForm(p,a,b,c) (p)->lpVtbl->PrepareForm(p,a,b,c)