mapix.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /*
  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. #ifndef MAPIX_H
  19. #define MAPIX_H
  20. #ifndef MAPIDEFS_H
  21. #include <mapidefs.h>
  22. #endif
  23. #ifndef MAPICODE_H
  24. #include <mapicode.h>
  25. #endif
  26. #ifndef MAPIGUID_H
  27. #include <mapiguid.h>
  28. #endif
  29. #ifndef MAPITAGS_H
  30. #include <mapitags.h>
  31. #endif
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. typedef struct IProfAdmin IProfAdmin;
  36. typedef IProfAdmin *LPPROFADMIN;
  37. typedef struct IMsgServiceAdmin IMsgServiceAdmin;
  38. typedef IMsgServiceAdmin *LPSERVICEADMIN;
  39. typedef struct IMAPISession IMAPISession;
  40. typedef IMAPISession *LPMAPISESSION;
  41. typedef unsigned long FLAGS;
  42. /* Flags for MAPILogon and MAPILogonEx */
  43. #define MAPI_LOGON_UI 0x000001
  44. #define MAPI_NEW_SESSION 0x000002
  45. #define MAPI_EXTENDED 0x000020
  46. #define MAPI_FORCE_DOWNLOAD 0x001000
  47. #define MAPI_PASSWORD_UI 0x020000
  48. #define MAPI_ALLOW_OTHERS 0x000008
  49. #define MAPI_EXPLICIT_PROFILE 0x000010
  50. #define MAPI_SERVICE_UI_ALWAYS 0x002000
  51. #define MAPI_NO_MAIL 0x008000
  52. #define MAPI_NT_SERVICE 0x010000
  53. #define MAPI_TIMEOUT_SHORT 0x100000
  54. #define MAPI_SIMPLE_DEFAULT (MAPI_LOGON_UI|MAPI_ALLOW_OTHERS|MAPI_FORCE_DOWNLOAD)
  55. #define MAPI_SIMPLE_EXPLICIT (MAPI_NEW_SESSION|MAPI_EXPLICIT_PROFILE|MAPI_FORCE_DOWNLOAD)
  56. typedef struct tagMAPIINIT_0
  57. {
  58. ULONG ulVersion;
  59. ULONG ulFlags;
  60. } MAPIINIT_0, *LPMAPIINIT_0;
  61. typedef MAPIINIT_0 MAPIINIT, *LPMAPIINIT;
  62. #define MAPI_INIT_VERSION 0U
  63. typedef HRESULT (WINAPI MAPIINITIALIZE)(void*);
  64. typedef MAPIINITIALIZE *LPMAPIINITIALIZE;
  65. MAPIINITIALIZE MAPIInitialize;
  66. typedef void (WINAPI MAPIUNINITIALIZE)(void);
  67. typedef MAPIUNINITIALIZE *LPMAPIUNINITIALIZE;
  68. MAPIUNINITIALIZE MAPIUninitialize;
  69. #if defined (UNICODE) || defined (__WINESRC__)
  70. typedef HRESULT (STDMETHODCALLTYPE MAPILOGONEX)(ULONG_PTR,LPWSTR,LPWSTR,ULONG,LPMAPISESSION*);
  71. #else
  72. typedef HRESULT (STDMETHODCALLTYPE MAPILOGONEX)(ULONG_PTR,LPSTR,LPSTR,ULONG,LPMAPISESSION *);
  73. #endif
  74. typedef MAPILOGONEX *LPMAPILOGONEX;
  75. MAPILOGONEX MAPILogonEx;
  76. typedef SCODE (WINAPI MAPIALLOCATEBUFFER)(ULONG,LPVOID*);
  77. typedef MAPIALLOCATEBUFFER *LPMAPIALLOCATEBUFFER;
  78. MAPIALLOCATEBUFFER MAPIAllocateBuffer;
  79. typedef SCODE (WINAPI MAPIALLOCATEMORE)(ULONG,LPVOID,LPVOID*);
  80. typedef MAPIALLOCATEMORE *LPMAPIALLOCATEMORE;
  81. MAPIALLOCATEMORE MAPIAllocateMore;
  82. typedef ULONG (WINAPI MAPIFREEBUFFER)(LPVOID);
  83. typedef MAPIFREEBUFFER *LPMAPIFREEBUFFER;
  84. MAPIFREEBUFFER MAPIFreeBuffer;
  85. /*****************************************************************************
  86. * IMAPISession interface
  87. */
  88. #define INTERFACE IMAPISession
  89. DECLARE_INTERFACE_(IMAPISession,IUnknown)
  90. {
  91. /*** IUnknown methods ***/
  92. STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
  93. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  94. STDMETHOD_(ULONG,Release)(THIS) PURE;
  95. /*** IMAPISession methods ***/
  96. STDMETHOD(GetLastError)(THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR *lppMAPIError) PURE;
  97. STDMETHOD(GetMsgStoresTable)(THIS_ ULONG ulFlags, LPMAPITABLE *lppTable) PURE;
  98. STDMETHOD(OpenMsgStore)(THIS_ ULONG_PTR ulUIParam, ULONG cbId,
  99. LPENTRYID lpId, LPCIID lpIFace, ULONG ulFlags, LPMDB *lppMDB) PURE;
  100. STDMETHOD(OpenAddressBook)(THIS_ ULONG_PTR ulUIParam, LPCIID iid, ULONG ulFlags, LPADRBOOK *lppAdrBook) PURE;
  101. STDMETHOD(OpenProfileSection)(THIS_ LPMAPIUID lpUID, LPCIID iid, ULONG ulFlags, LPPROFSECT *lppProf) PURE;
  102. STDMETHOD(GetStatusTable)(THIS_ ULONG ulFlags, LPMAPITABLE *lppTable) PURE;
  103. STDMETHOD(OpenEntry)(THIS_ ULONG cbId, LPENTRYID lpId, LPCIID iid,
  104. ULONG ulFlags, ULONG *lpType, LPUNKNOWN *lppUnk) PURE;
  105. STDMETHOD(CompareEntryIDs)(THIS_ ULONG cbLID, LPENTRYID lpLID, ULONG cbRID,
  106. LPENTRYID lpRID, ULONG ulFlags, ULONG *lpRes) PURE;
  107. STDMETHOD(Advise)(THIS_ ULONG cbId, LPENTRYID lpId, ULONG ulMask,
  108. LPMAPIADVISESINK lpSink, ULONG *lpCxn) PURE;
  109. STDMETHOD(Unadvise)(THIS_ ULONG ulConnection) PURE;
  110. STDMETHOD(MessageOptions)(THIS_ ULONG_PTR ulUIParam, ULONG ulFlags, LPSTR lpszAddr, LPMESSAGE lpMsg) PURE;
  111. STDMETHOD(QueryDefaultMessageOpt)(THIS_ LPSTR lpszAddr, ULONG ulFlags,
  112. ULONG *lpcVals, LPSPropValue *lppOpts) PURE;
  113. STDMETHOD(EnumAdrTypes)(THIS_ ULONG ulFlags, ULONG *lpcTypes, LPSTR **lpppszTypes) PURE;
  114. STDMETHOD(QueryIdentity)(THIS_ ULONG *lpcbId, LPENTRYID *lppEntryID) PURE;
  115. STDMETHOD(Logoff)(THIS_ ULONG_PTR ulUIParam, ULONG ulFlags, ULONG ulReserved) PURE;
  116. STDMETHOD(SetDefaultStore)(THIS_ ULONG ulFlags, ULONG cbId, LPENTRYID lpId) PURE;
  117. STDMETHOD(AdminServices)(THIS_ ULONG ulFlags, LPSERVICEADMIN *lppAdmin) PURE;
  118. STDMETHOD(ShowForm)(THIS_ ULONG_PTR ulUIParam, LPMDB lpStore,
  119. LPMAPIFOLDER lpParent, LPCIID iid, ULONG ulToken,
  120. LPMESSAGE lpSent, ULONG ulFlags, ULONG ulStatus,
  121. ULONG ulMsgFlags, ULONG ulAccess, LPSTR lpszClass) PURE;
  122. STDMETHOD(PrepareForm)(THIS_ LPCIID lpIFace, LPMESSAGE lpMsg, ULONG *lpToken) PURE;
  123. };
  124. #undef INTERFACE
  125. #if !defined(__cplusplus) || defined(CINTERFACE)
  126. /*** IUnknown methods ***/
  127. #define IMAPISession_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  128. #define IMAPISession_AddRef(p) (p)->lpVtbl->AddRef(p)
  129. #define IMAPISession_Release(p) (p)->lpVtbl->Release(p)
  130. /*** IMAPISession methods ***/
  131. #define IMAPISession_GetLastError(p,a,b,c) (p)->lpVtbl->GetLastError(p,a,b,c)
  132. #define IMAPISession_GetMsgStoresTable(p,a,b) (p)->lpVtbl->GetMsgStoresTable(p,a,b)
  133. #define IMAPISession_OpenMsgStore(p,a,b,c,d,e,f) (p)->lpVtbl->OpenMsgStore(p,a,b,c,d,e,f)
  134. #define IMAPISession_OpenAddressBook(p,a,b,c,d) (p)->lpVtbl->OpenAddressBook(p,a,b,c,d)
  135. #define IMAPISession_OpenProfileSection(p,a,b,c,d) (p)->lpVtbl->OpenProfileSection(p,a,b,c,d)
  136. #define IMAPISession_GetStatusTable(p,a,b) (p)->lpVtbl->GetStatusTable(p,a,b)
  137. #define IMAPISession_OpenEntry(p,a,b,c,d,e,f) (p)->lpVtbl->OpenEntry(p,a,b,c,d,e,f)
  138. #define IMAPISession_CompareEntryIDs(p,a,b,c,d,e,f) (p)->lpVtbl->CompareEntryIDs(p,a,b,c,d,e,f)
  139. #define IMAPISession_Advise(p,a,b,c,d,e) (p)->lpVtbl->Advise(p,a,b,c,d,e)
  140. #define IMAPISession_Unadvise(p,a) (p)->lpVtbl->Unadvise(p,a)
  141. #define IMAPISession_MessageOptions(p,a,b,c,d) (p)->lpVtbl->MessageOptions)(p,a,b,c,d)
  142. #define IMAPISession_QueryDefaultMessageOpt(p,a,b,c,d) \
  143. (p)->lpVtbl->QueryDefaultMessageOpt(p,a,b,c,d)
  144. #define IMAPISession_EnumAdrTypes(p,a,b,c) (p)->lpVtbl->EnumAdrTypes(p,a,b,c)
  145. #define IMAPISession_QueryIdentity(p,a,b) (p)->lpVtbl->QueryIdentity(p,a,b)
  146. #define IMAPISession_Logoff(p,a,b,c) (p)->lpVtbl->Logoff(p,a,b,c)
  147. #define IMAPISession_SetDefaultStore(p,a,b,c) (p)->lpVtbl->SetDefaultStore(p,a,b,c)
  148. #define IMAPISession_AdminServices(p,a,b) (p)->lpVtbl->AdminServices(p,a,b)
  149. #define IMAPISession_ShowForm(p,a,b,c,d,e,f,g,h,i,j,k) \
  150. (p)->lpVtbl->ShowForm(p,a,b,c,d,e,f,g,h,i,j,k)
  151. #define IMAPISession_PrepareForm(p,a,b,c) (p)->lpVtbl->PrepareForm(p,a,b,c)
  152. #endif
  153. #ifdef __cplusplus
  154. }
  155. #endif
  156. #endif /* MAPIX_H */