blob: 4d086934084846105feee1f249623f0ba86f8d9a [file] [log] [blame]
Jon Griffiths11b26f02004-04-23 23:28:04 +00001/*
2 * Copyright 2004 Jon Griffiths
3 *
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.
8 *
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.
13 *
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
17 */
18
19#ifndef MAPIX_H
20#define MAPIX_H
21
22#ifndef MAPIDEFS_H
23#include <mapidefs.h>
24#endif
25#ifndef MAPICODE_H
26#include <mapicode.h>
27#endif
28#ifndef MAPIGUID_H
29#include <mapiguid.h>
30#endif
31#ifndef MAPITAGS_H
32#include <mapitags.h>
33#endif
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39typedef struct IProfAdmin IProfAdmin;
40typedef IProfAdmin *LPPROFADMIN;
41typedef struct IMsgServiceAdmin IMsgServiceAdmin;
42typedef IMsgServiceAdmin *LPSERVICEADMIN;
43typedef struct IMAPISession IMAPISession;
44typedef IMAPISession *LPMAPISESSION;
45
46typedef unsigned long FLAGS;
47
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
60
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)
63
64typedef struct tagMAPIINIT_0
65{
66 ULONG ulVersion;
67 ULONG ulFlags;
68} MAPIINIT_0, *LPMAPIINIT_0;
69
70typedef MAPIINIT_0 MAPIINIT, *LPMAPIINIT;
71
72#define MAPI_INIT_VERSION 0U
73
74typedef HRESULT (WINAPI MAPIINITIALIZE)(void*);
75typedef MAPIINITIALIZE *LPMAPIINITIALIZE;
76MAPIINITIALIZE MAPIInitialize;
77
78typedef void (WINAPI MAPIUNINITIALIZE)(void);
79typedef MAPIUNINITIALIZE *LPMAPIUNINITIALIZE;
80MAPIUNINITIALIZE MAPIUninitialize;
81
82#if defined (UNICODE) || defined (__WINESRC__)
83typedef HRESULT (STDMETHODCALLTYPE MAPILOGONEX)(ULONG_PTR,LPWSTR,LPWSTR,ULONG,LPMAPISESSION*);
84#else
85typedef HRESULT (STDMETHODCALLTYPE MAPILOGONEX)(ULONG_PTR,LPSTR,LPSTR,ULONG,LPMAPISESSION *);
86#endif
87typedef MAPILOGONEX *LPMAPILOGONEX;
88MAPILOGONEX MAPILogonEx;
89
90typedef SCODE (WINAPI MAPIALLOCATEBUFFER)(ULONG,LPVOID*);
91typedef MAPIALLOCATEBUFFER *LPMAPIALLOCATEBUFFER;
92MAPIALLOCATEBUFFER MAPIAllocateBuffer;
93
94typedef SCODE (WINAPI MAPIALLOCATEMORE)(ULONG,LPVOID,LPVOID*);
95typedef MAPIALLOCATEMORE *LPMAPIALLOCATEMORE;
96MAPIALLOCATEMORE MAPIAllocateMore;
97
98typedef ULONG (WINAPI MAPIFREEBUFFER)(LPVOID);
99typedef MAPIFREEBUFFER *LPMAPIFREEBUFFER;
100MAPIFREEBUFFER MAPIFreeBuffer;
101
102/*****************************************************************************
103 * IMAPISession interface
104 */
105#define INTERFACE IMAPISession
106#define IMAPISession_METHODS \
107 IUnknown_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;
135ICOM_DEFINE(IMAPISession,IUnknown)
136#undef INTERFACE
137
138#ifdef COBJMACROS
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)
165#endif
166
167#ifdef __cplusplus
168}
169#endif
170
171#endif /* MAPIX_H */