Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

345 lines
11 KiB

  1. #ifndef _INC_NEWIMP_H
  2. #define _INC_NEWIMP_H
  3. /////////////////////////////////////////////////////////////////////////
  4. /////////////////////////////////////////////////////////////////////////
  5. // WARNING: If you make changes to this header, you must also update //
  6. // inetcore\published\inc\newimp.h !!! //
  7. /////////////////////////////////////////////////////////////////////////
  8. /////////////////////////////////////////////////////////////////////////
  9. #ifndef NO_IMPORT_ERROR
  10. #define HR_IMP_E(n) MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, n)
  11. #define HR_IMP_S(n) MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, n)
  12. #define HR_IMP 0x3000
  13. #define hrFolderOpenFail HR_IMP_E(HR_IMP + 1)
  14. #define hrFolderReadFail HR_IMP_E(HR_IMP + 2)
  15. #define hrMapiInitFail HR_IMP_E(HR_IMP + 3)
  16. #define hrNoProfilesFound HR_IMP_E(HR_IMP + 4)
  17. #define hrDiskFull HR_IMP_E(HR_IMP + 5)
  18. #define hrUserCancel HR_IMP_E(HR_IMP + 6)
  19. #endif // NO_IMPORT_ERROR
  20. typedef enum tagIMPORTFOLDERTYPE
  21. {
  22. FOLDER_TYPE_NORMAL = 0,
  23. FOLDER_TYPE_INBOX,
  24. FOLDER_TYPE_OUTBOX,
  25. FOLDER_TYPE_SENT,
  26. FOLDER_TYPE_DELETED,
  27. FOLDER_TYPE_DRAFT,
  28. CFOLDERTYPE
  29. } IMPORTFOLDERTYPE;
  30. typedef struct IMSG IMSG;
  31. typedef enum
  32. {
  33. MSG_TYPE_MAIL = 0,
  34. MSG_TYPE_NEWS
  35. } MSGTYPE;
  36. #define MSG_STATE_UNREAD 0x0001
  37. #define MSG_STATE_UNSENT 0x0002
  38. #define MSG_STATE_SUBMITTED 0x0004
  39. #define MSG_PRI_LOW 0x0010
  40. #define MSG_PRI_NORMAL 0x0020
  41. #define MSG_PRI_HIGH 0x0040
  42. #define MSG_PRI_MASK 0x0070
  43. // {E4499DE7-9F57-11D0-8D5C-00C04FD6202B}
  44. DEFINE_GUID(IID_IFolderImport, 0xE4499DE7L, 0x9F57, 0x11D0, 0x8D, 0x5C, 0x00, 0xC0, 0x4F, 0xD6, 0x20, 0x2B);
  45. // provided by Athena or Outlook
  46. typedef interface IFolderImport IFolderImport;
  47. #if defined(__cplusplus) && !defined(CINTERFACE)
  48. interface IFolderImport : public IUnknown
  49. {
  50. public:
  51. virtual HRESULT STDMETHODCALLTYPE SetMessageCount(ULONG cMsg) = 0;
  52. virtual HRESULT STDMETHODCALLTYPE ImportMessage(MSGTYPE type, DWORD dwState, LPSTREAM pstm, const TCHAR **rgszAttach, DWORD cAttach) = 0;
  53. virtual HRESULT STDMETHODCALLTYPE ImportMessage(IMSG *pimsg) = 0;
  54. };
  55. #else /* C style interface */
  56. typedef struct IFolderImportVtbl
  57. {
  58. BEGIN_INTERFACE
  59. HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
  60. IFolderImport * This,
  61. /* [in] */ REFIID riid,
  62. /* [iid_is][out] */ void **ppvObject);
  63. ULONG ( STDMETHODCALLTYPE *AddRef )(
  64. IFolderImport * This);
  65. ULONG ( STDMETHODCALLTYPE *Release )(
  66. IFolderImport * This);
  67. HRESULT ( STDMETHODCALLTYPE *SetMessageCount )(
  68. IFolderImport * This,
  69. ULONG cMsg);
  70. HRESULT ( STDMETHODCALLTYPE *ImportMessageEx )(
  71. IFolderImport * This,
  72. MSGTYPE type,
  73. DWORD dwState,
  74. LPSTREAM pstm,
  75. const TCHAR **rgszAttach,
  76. DWORD cAttach);
  77. HRESULT ( STDMETHODCALLTYPE *ImportMessage )(
  78. IFolderImport * This,
  79. IMSG *pimsg);
  80. END_INTERFACE
  81. } IFolderImportVtbl;
  82. interface IFolderImport
  83. {
  84. CONST_VTBL struct IFolderImportVtbl *lpVtbl;
  85. };
  86. #ifdef COBJMACROS
  87. #define IFolderImport_QueryInterface(This,riid,ppvObject) \
  88. (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
  89. #define IFolderImport_AddRef(This) \
  90. (This)->lpVtbl -> AddRef(This)
  91. #define IFolderImport_Release(This) \
  92. (This)->lpVtbl -> Release(This)
  93. #define IFolderImport_SetMessageCount(This,cMsg) \
  94. (This)->lpVtbl -> SetMessageCount(This,cMsg)
  95. #define IFolderImport_ImportMessageEx(This,type,dwState,pstm,rgszAttach,cAttach) \
  96. (This)->lpVtbl -> ImportMessageEx(This,type,dwState,pstm,rgszAttach,cAttach)
  97. #define IFolderImport_ImportMessage(This,pimsg) \
  98. (This)->lpVtbl -> ImportMessage(This,pimsg)
  99. #endif /* COBJMACROS */
  100. #endif /* C style interface */
  101. // {E4499DE8-9F57-11D0-8D5C-00C04FD6202B}
  102. DEFINE_GUID(IID_IMailImporter, 0xE4499DE8L, 0x9F57, 0x11D0, 0x8D, 0x5C, 0x00, 0xC0, 0x4F, 0xD6, 0x20, 0x2B);
  103. // provided by Athena or Outlook
  104. typedef interface IMailImporter IMailImporter;
  105. #if defined(__cplusplus) && !defined(CINTERFACE)
  106. interface IMailImporter : public IUnknown
  107. {
  108. public:
  109. virtual HRESULT STDMETHODCALLTYPE OpenFolder(DWORD_PTR dwCookie, const TCHAR *szFolder, IMPORTFOLDERTYPE type, DWORD dwFlags, IFolderImport **ppFldrImp, DWORD_PTR *pdwCookie) = 0;
  110. };
  111. #else /* C style interface */
  112. typedef struct IMailImporterVtbl
  113. {
  114. BEGIN_INTERFACE
  115. HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
  116. IMailImporter * This,
  117. /* [in] */ REFIID riid,
  118. /* [iid_is][out] */ void **ppvObject);
  119. ULONG ( STDMETHODCALLTYPE *AddRef )(
  120. IMailImporter * This);
  121. ULONG ( STDMETHODCALLTYPE *Release )(
  122. IMailImporter * This);
  123. HRESULT ( STDMETHODCALLTYPE *OpenFolder )(
  124. IMailImporter * This,
  125. DWORD_PTR dwCookie,
  126. const TCHAR *szFolder,
  127. IMPORTFOLDERTYPE type,
  128. DWORD dwFlags,
  129. IFolderImport **ppFldrImp,
  130. DWORD_PTR *pdwCookie);
  131. END_INTERFACE
  132. } IMailImporterVtbl;
  133. interface IMailImporter
  134. {
  135. CONST_VTBL struct IMailImporterVtbl *lpVtbl;
  136. };
  137. #ifdef COBJMACROS
  138. #define IMailImporter_QueryInterface(This,riid,ppvObject) \
  139. (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
  140. #define IMailImporter_AddRef(This) \
  141. (This)->lpVtbl -> AddRef(This)
  142. #define IMailImporter_Release(This) \
  143. (This)->lpVtbl -> Release(This)
  144. #define IMailImporter_OpenFolder(This,dwCookie,szFolder,type,dwFlags,ppFldrImp,pdwCookie) \
  145. (This)->lpVtbl -> OpenFolder(This,dwCookie,szFolder,type,dwFlags,ppFldrImp,pdwCookie)
  146. #endif /* COBJMACROS */
  147. #endif /* C style interface */
  148. typedef struct tagIMPORTFOLDER
  149. {
  150. DWORD_PTR dwCookie;
  151. TCHAR szName[MAX_PATH];
  152. IMPORTFOLDERTYPE type;
  153. // DWORD cMsg;
  154. BOOL fSubFolders;
  155. DWORD dwReserved1;
  156. DWORD dwReserved2;
  157. } IMPORTFOLDER;
  158. // {E4499DE9-9F57-11D0-8D5C-00C04FD6202B}
  159. DEFINE_GUID(IID_IEnumFOLDERS, 0xE4499DE9L, 0x9F57, 0x11D0, 0x8D, 0x5C, 0x00, 0xC0, 0x4F, 0xD6, 0x20, 0x2B);
  160. typedef interface IEnumFOLDERS IEnumFOLDERS;
  161. #if defined(__cplusplus) && !defined(CINTERFACE)
  162. interface IEnumFOLDERS : public IUnknown
  163. {
  164. public:
  165. virtual HRESULT STDMETHODCALLTYPE Next(IMPORTFOLDER *pfldr) = 0;
  166. virtual HRESULT STDMETHODCALLTYPE Reset(void) = 0;
  167. };
  168. #else /* C style interface */
  169. typedef struct IEnumFOLDERSVtbl
  170. {
  171. BEGIN_INTERFACE
  172. HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
  173. IEnumFOLDERS * This,
  174. /* [in] */ REFIID riid,
  175. /* [iid_is][out] */ void **ppvObject);
  176. ULONG ( STDMETHODCALLTYPE *AddRef )(
  177. IEnumFOLDERS * This);
  178. ULONG ( STDMETHODCALLTYPE *Release )(
  179. IEnumFOLDERS * This);
  180. HRESULT ( STDMETHODCALLTYPE *Next )(
  181. IEnumFOLDERS * This,
  182. IMPORTFOLDER *pfldr);
  183. HRESULT ( STDMETHODCALLTYPE *Reset )(
  184. IEnumFOLDERS * This);
  185. END_INTERFACE
  186. } IEnumFOLDERSVtbl;
  187. interface IEnumFOLDERS
  188. {
  189. CONST_VTBL struct IEnumFOLDERSVtbl *lpVtbl;
  190. };
  191. #ifdef COBJMACROS
  192. #define IEnumFOLDERS_QueryInterface(This,riid,ppvObject) \
  193. (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
  194. #define IEnumFOLDERS_AddRef(This) \
  195. (This)->lpVtbl -> AddRef(This)
  196. #define IEnumFOLDERS_Release(This) \
  197. (This)->lpVtbl -> Release(This)
  198. #define IEnumFOLDERS_Next(This,pfldr) \
  199. (This)->lpVtbl -> Next(This,pfldr);
  200. #define IEnumFOLDERS_Reset(This) \
  201. (This)->lpVtbl -> Reset(This);
  202. #endif /* COBJMACROS */
  203. #endif /* C style interface */
  204. #define COOKIE_ROOT MAXULONG_PTR
  205. // {E4499DEA-9F57-11D0-8D5C-00C04FD6202B}
  206. DEFINE_GUID(IID_IMailImport, 0xE4499DEAL, 0x9F57, 0x11D0, 0x8D, 0x5C, 0x00, 0xC0, 0x4F, 0xD6, 0x20, 0x2B);
  207. typedef interface IMailImport IMailImport;
  208. #if defined(__cplusplus) && !defined(CINTERFACE)
  209. interface IMailImport : public IUnknown
  210. {
  211. public:
  212. virtual HRESULT STDMETHODCALLTYPE InitializeImport(HWND hwnd) = 0;
  213. virtual HRESULT STDMETHODCALLTYPE GetDirectory(char *szDir, UINT cch) = 0;
  214. virtual HRESULT STDMETHODCALLTYPE SetDirectory(char *szDir) = 0;
  215. virtual HRESULT STDMETHODCALLTYPE EnumerateFolders(DWORD_PTR dwCookie, IEnumFOLDERS **ppEnum) = 0;
  216. virtual HRESULT STDMETHODCALLTYPE ImportFolder(DWORD_PTR dwCookie, IFolderImport *pImport) = 0;
  217. };
  218. #else /* C style interface */
  219. typedef struct IMailImportVtbl
  220. {
  221. BEGIN_INTERFACE
  222. HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
  223. IMailImport * This,
  224. /* [in] */ REFIID riid,
  225. /* [iid_is][out] */ void **ppvObject);
  226. ULONG ( STDMETHODCALLTYPE *AddRef )(
  227. IMailImport * This);
  228. ULONG ( STDMETHODCALLTYPE *Release )(
  229. IMailImport * This);
  230. HRESULT ( STDMETHODCALLTYPE *InitializeImport )(
  231. IMailImport * This,
  232. HWND hwnd);
  233. HRESULT ( STDMETHODCALLTYPE *GetDirectory )(
  234. IMailImport * This,
  235. char *szDir,
  236. UINT cch);
  237. HRESULT ( STDMETHODCALLTYPE *SetDirectory )(
  238. IMailImport * This,
  239. char *szDir);
  240. HRESULT ( STDMETHODCALLTYPE *EnumerateFolders )(
  241. IMailImport * This,
  242. DWORD_PTR dwCookie,
  243. IEnumFOLDERS **ppEnum);
  244. HRESULT ( STDMETHODCALLTYPE *ImportFolder )(
  245. IMailImport * This,
  246. DWORD_PTR dwCookie,
  247. IFolderImport *pImport);
  248. END_INTERFACE
  249. } IMailImportVtbl;
  250. interface IMailImport
  251. {
  252. CONST_VTBL struct IMailImportVtbl *lpVtbl;
  253. };
  254. #ifdef COBJMACROS
  255. #define IMailImport_QueryInterface(This,riid,ppvObject) \
  256. (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
  257. #define IMailImport_AddRef(This) \
  258. (This)->lpVtbl -> AddRef(This)
  259. #define IMailImport_Release(This) \
  260. (This)->lpVtbl -> Release(This)
  261. #define IMailImport_InitializeImport(This,hwnd) \
  262. (This)->lpVtbl -> InitializeImport(This,hwnd)
  263. #define IMailImport_GetDirectory(This,szDir,cch) \
  264. (This)->lpVtbl -> GetDirectory(This,szDir,cch)
  265. #define IMailImport_SetDirectory(This,szDir) \
  266. (This)->lpVtbl -> SetDirectory(This,szDir)
  267. #define IMailImport_EnumerateFolders(This,dwCookie,ppEnum) \
  268. (This)->lpVtbl -> EnumerateFolders(This,dwCookie,ppEnum)
  269. #define IMailImport_ImportFolder(This,dwCookie,pImport) \
  270. (This)->lpVtbl -> ImportFolder(This,dwCookie,pImport)
  271. #endif /* COBJMACROS */
  272. #endif /* C style interface */
  273. #define achPerformImport "PerformImport"
  274. void PerformImport(HWND hwnd, IMailImporter *pMailImp, DWORD dwFlags);
  275. typedef void (*PFNPERFORMIMPORT)(HWND, IMailImporter *, DWORD);
  276. #define achPerformMigration "PerformMigration"
  277. HRESULT PerformMigration(HWND hwnd, IMailImporter *pMailImp, DWORD dwFlags);
  278. typedef HRESULT (*PFNPERFORMMIGRATION)(HWND, IMailImporter *, DWORD);
  279. #endif // _INC_NEWIMP_H