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.

2455 lines
131 KiB

  1. //--------------------------------------------------------------------------
  2. // OEStore.idl
  3. //--------------------------------------------------------------------------
  4. import "ocidl.idl";
  5. import "objidl.idl";
  6. import "imnact.idl";
  7. import "mimeole.idl";
  8. import "imnxport.idl";
  9. import "directdb.idl";
  10. //--------------------------------------------------------------------------
  11. // Dependencies
  12. //--------------------------------------------------------------------------
  13. cpp_quote("#include <stddef.h> // for offsetof")
  14. //--------------------------------------------------------------------------
  15. // Interfaces
  16. //--------------------------------------------------------------------------
  17. interface IStoreCallback;
  18. interface IMessageStore;
  19. interface IMessageTable;
  20. interface IMessageTableNotify;
  21. interface IMessageFolder;
  22. interface IMessageServer;
  23. interface IEnumerateFolders;
  24. interface IImnAccount;
  25. interface IStoreNamespace;
  26. interface IStoreFolder;
  27. //--------------------------------------------------------------------------
  28. // Class Ids and Interface Ids
  29. //--------------------------------------------------------------------------
  30. cpp_quote("// {101A8FB9-F1B9-11d1-9A56-00C04FA309D4}")
  31. cpp_quote("DEFINE_GUID(CLSID_MessageStore, 0x101a8fb9, 0xf1b9, 0x11d1, 0x9a, 0x56, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  32. cpp_quote("")
  33. cpp_quote("// {522E4F81-2C98-11d2-AACA-006097D474C4}")
  34. cpp_quote("DEFINE_GUID(IID_INewsStore, 0x522e4f81, 0x2c98, 0x11d2, 0xaa, 0xca, 0x0, 0x60, 0x97, 0xd4, 0x74, 0xc4);")
  35. cpp_quote("")
  36. cpp_quote("// {06AE7A01-6C5B-11d2-AD88-0080C7B6E3C5}")
  37. cpp_quote("DEFINE_GUID(IID_IIMAPStore, 0x6ae7a01, 0x6c5b, 0x11d2, 0xad, 0x88, 0x0, 0x80, 0xc7, 0xb6, 0xe3, 0xc5);")
  38. cpp_quote("")
  39. cpp_quote("// {E883FC75-EC08-11d1-9A53-00C04FA309D4}")
  40. cpp_quote("DEFINE_GUID(IID_IMessageStore, 0xe883fc75, 0xec08, 0x11d1, 0x9a, 0x53, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  41. cpp_quote("")
  42. cpp_quote("// {E883FC76-EC08-11d1-9A53-00C04FA309D4}")
  43. cpp_quote("DEFINE_GUID(IID_IMessageFolder, 0xe883fc76, 0xec08, 0x11d1, 0x9a, 0x53, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  44. cpp_quote("")
  45. cpp_quote("// {E883FC77-EC08-11d1-9A53-00C04FA309D4}")
  46. cpp_quote("DEFINE_GUID(IID_IPop3UidlStore, 0xe883fc77, 0xec08, 0x11d1, 0x9a, 0x53, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  47. cpp_quote("")
  48. cpp_quote("// {816C1167-F649-11d1-9A57-00C04FA309D4}")
  49. cpp_quote("DEFINE_GUID(IID_IMessageTableNotify, 0x816c1167, 0xf649, 0x11d1, 0x9a, 0x57, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  50. cpp_quote("")
  51. cpp_quote("// {B4B796AA-EC1C-11d1-9A54-00C04FA309D4}")
  52. cpp_quote("DEFINE_GUID(IID_IMessageTable, 0xb4b796aa, 0xec1c, 0x11d1, 0x9a, 0x54, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  53. cpp_quote("")
  54. cpp_quote("// {CFAD2437-EC54-11d1-9A54-00C04FA309D4}")
  55. cpp_quote("DEFINE_GUID(IID_IStoreCallback, 0xcfad2437, 0xec54, 0x11d1, 0x9a, 0x54, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  56. cpp_quote("")
  57. cpp_quote("// {CFAD2438-EC54-11d1-9A54-00C04FA309D4}")
  58. cpp_quote("DEFINE_GUID(IID_IMessageServer, 0xcfad2438, 0xec54, 0x11d1, 0x9a, 0x54, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  59. cpp_quote("")
  60. cpp_quote("// {A6630A5E-046A-11d2-ACEF-00C04FA31009}")
  61. cpp_quote("DEFINE_GUID(SID_MessageServer, 0xa6630a5e, 0x46a, 0x11d2, 0xac, 0xef, 0x0, 0xc0, 0x4f, 0xa3, 0x10, 0x9);")
  62. cpp_quote("")
  63. cpp_quote("// {7C9FB7A1-2C9E-11d2-AACA-006097D474C4}")
  64. cpp_quote("DEFINE_GUID(SID_LocalMessageFolder, 0x7c9fb7a1, 0x2c9e, 0x11d2, 0xaa, 0xca, 0x0, 0x60, 0x97, 0xd4, 0x74, 0xc4);")
  65. cpp_quote("")
  66. cpp_quote("// {28B44B1D-07A9-11d2-9A63-00C04FA309D4}")
  67. cpp_quote("DEFINE_GUID(IID_ICallbackTimeout, 0x28b44b1d, 0x7a9, 0x11d2, 0x9a, 0x63, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  68. cpp_quote("")
  69. cpp_quote("// {8551C145-0C39-11d2-9A6A-00C04FA309D4}")
  70. cpp_quote("DEFINE_GUID(IID_IEnumerateFolders, 0x8551c145, 0xc39, 0x11d2, 0x9a, 0x6a, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  71. cpp_quote("")
  72. cpp_quote("// {E70C92A9-4BFD-11d1-8A95-00C04FB951F3}")
  73. cpp_quote("DEFINE_GUID(CLSID_StoreNamespace, 0xe70c92a9, 0x4bfd, 0x11d1, 0x8a, 0x95, 0x0, 0xc0, 0x4f, 0xb9, 0x51, 0xf3);")
  74. cpp_quote("")
  75. cpp_quote("// {E70C92AA-4BFD-11d1-8A95-00C04FB951F3}")
  76. cpp_quote("DEFINE_GUID(IID_IStoreNamespace, 0xe70c92aa, 0x4bfd, 0x11d1, 0x8a, 0x95, 0x0, 0xc0, 0x4f, 0xb9, 0x51, 0xf3);")
  77. cpp_quote("")
  78. cpp_quote("// {E70C92AC-4BFD-11d1-8A95-00C04FB951F3}")
  79. cpp_quote("DEFINE_GUID(IID_IStoreFolder, 0xe70c92ac, 0x4bfd, 0x11d1, 0x8a, 0x95, 0x0, 0xc0, 0x4f, 0xb9, 0x51, 0xf3);")
  80. cpp_quote("")
  81. cpp_quote("// {BE09F473-7FEB-11d2-9962-00C04FA309D4}")
  82. cpp_quote("DEFINE_GUID(CLSID_MigrateMessageStore, 0xbe09f473, 0x7feb, 0x11d2, 0x99, 0x62, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  83. //--------------------------------------------------------------------------
  84. // OEStore Database Extenstion CLSIDs
  85. //--------------------------------------------------------------------------
  86. cpp_quote("// {6F74FDC5-E366-11d1-9A4E-00C04FA309D4}")
  87. cpp_quote("DEFINE_GUID(CLSID_MessageDatabase, 0x6f74fdc5, 0xe366, 0x11d1, 0x9a, 0x4e, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  88. cpp_quote("")
  89. cpp_quote("// {6F74FDC6-E366-11d1-9A4E-00C04FA309D4}")
  90. cpp_quote("DEFINE_GUID(CLSID_FolderDatabase, 0x6f74fdc6, 0xe366, 0x11d1, 0x9a, 0x4e, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  91. cpp_quote("")
  92. cpp_quote("// {6F74FDC7-E366-11d1-9A4E-00C04FA309D4}")
  93. cpp_quote("DEFINE_GUID(CLSID_Pop3UidlDatabase, 0x6f74fdc7, 0xe366, 0x11d1, 0x9a, 0x4e, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  94. cpp_quote("")
  95. cpp_quote("// {5488C4BE-2247-11d2-9A7D-00C04FA309D4}")
  96. cpp_quote("DEFINE_GUID(CLSID_StreamDatabase, 0x5488c4be, 0x2247, 0x11d2, 0x9a, 0x7d, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  97. //--------------------------------------------------------------------------
  98. // HRESULT Macros
  99. //--------------------------------------------------------------------------
  100. cpp_quote("#ifndef FACILITY_INTERNET")
  101. cpp_quote("#define FACILITY_INTERNET 12")
  102. cpp_quote("#endif")
  103. cpp_quote("#ifndef HR_E")
  104. cpp_quote("#define HR_E(n) MAKE_SCODE(SEVERITY_ERROR, FACILITY_INTERNET, n)")
  105. cpp_quote("#endif")
  106. cpp_quote("#ifndef HR_S")
  107. cpp_quote("#define HR_S(n) MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_INTERNET, n)")
  108. cpp_quote("#endif")
  109. cpp_quote("#ifndef HR_CODE")
  110. cpp_quote("#define HR_CODE(hr) (INT)(hr & 0xffff)")
  111. cpp_quote("#endif")
  112. cpp_quote("")
  113. cpp_quote("// --------------------------------------------------------------------------------")
  114. cpp_quote("// Error Codes")
  115. cpp_quote("// --------------------------------------------------------------------------------")
  116. cpp_quote("#define STORE_E_BUSY HR_E(100)")
  117. cpp_quote("#define STORE_E_OFFLINE HR_E(101)")
  118. cpp_quote("#define STORE_E_BADFOLDERNAME HR_E(102)")
  119. cpp_quote("#define STORE_E_INVALIDPARENT HR_E(103)")
  120. cpp_quote("#define STORE_E_CANTDELETESPECIAL HR_E(104)")
  121. cpp_quote("#define STORE_E_CANTMOVESERVERS HR_E(105)")
  122. cpp_quote("#define STORE_E_CANTMOVESPECIAL HR_E(106)")
  123. cpp_quote("#define STORE_E_CANTRENAMESPECIAL HR_E(107)")
  124. cpp_quote("#define STORE_E_NOBODY HR_E(108)")
  125. cpp_quote("#define STORE_E_NOSERVERCOPY HR_E(109)") // CMessageClass should do std copy
  126. cpp_quote("#define STORE_E_NOTINITIALIZED HR_E(110)") // Must initialize object first
  127. cpp_quote("#define STORE_E_OPERATION_CANCELED HR_E(111)")
  128. cpp_quote("#define STORE_E_FILENOEXIST HR_E(112)")
  129. cpp_quote("#define STORE_E_EXPIRED HR_E(113)")
  130. cpp_quote("#define STORE_E_NOSERVERSUPPORT HR_E(114)") // Server cannot support requested operation
  131. cpp_quote("#define STORE_E_NOTRANSLATION HR_E(115)") // New fldr has non-USASCII, parent is FOLDER_NOTRANSLATEUTF7
  132. cpp_quote("#define STORE_E_NOREMOTESPECIALFLDR HR_E(116)") // User has disabled this special folder for this remote server
  133. cpp_quote("#define STORE_E_IMAP_HC_NOSLASH HR_E(117)") // No '/' characters permitted in folder name (hierarchy char)
  134. cpp_quote("#define STORE_E_IMAP_HC_NOBACKSLASH HR_E(118)") // No '\' characters permitted in folder name (hierarchy char)
  135. cpp_quote("#define STORE_E_IMAP_HC_NODOT HR_E(119)") // No '.' characters permitted in folder name (hierarchy char)
  136. cpp_quote("#define STORE_E_IMAP_HC_NOHC HR_E(120)") // Some other character is HC: not permitted in folder name
  137. // Not to exceed 300
  138. cpp_quote("// --------------------------------------------------------------------------------")
  139. cpp_quote("// Success Codes")
  140. cpp_quote("// --------------------------------------------------------------------------------")
  141. cpp_quote("#define STORE_S_NOTOPEN HR_S(500)")
  142. cpp_quote("#define STORE_S_ALREADYEXISTS HR_S(507)")
  143. cpp_quote("#define STORE_S_ALREADYPENDING HR_S(508)")
  144. cpp_quote("#define STORE_S_NOOP HR_S(509)") // OK, nothing to do
  145. cpp_quote("#define STORE_S_IN_USE HR_S(510)") // in use by another client
  146. // Not to exceed 800
  147. cpp_quote("// --------------------------------------------------------------------------------")
  148. cpp_quote("// String Definition Macros")
  149. cpp_quote("// --------------------------------------------------------------------------------")
  150. cpp_quote("#ifdef __cplusplus")
  151. cpp_quote("#define EXTERN_C extern \"C\"")
  152. cpp_quote("#else")
  153. cpp_quote("#define EXTERN_C extern")
  154. cpp_quote("#endif")
  155. cpp_quote("")
  156. cpp_quote("#ifndef STRCONSTA")
  157. cpp_quote("#ifdef DEFINE_STRCONST")
  158. cpp_quote("#define STRCONSTA(x,y) EXTERN_C const char x[] = y")
  159. cpp_quote("#define STRCONSTW(x,y) EXTERN_C const WCHAR x[] = L##y")
  160. cpp_quote("#else")
  161. cpp_quote("#define STRCONSTA(x,y) EXTERN_C const char x[]")
  162. cpp_quote("#define STRCONSTW(x,y) EXTERN_C const WCHAR x[]")
  163. cpp_quote("#endif")
  164. cpp_quote("#endif")
  165. cpp_quote("")
  166. cpp_quote("// --------------------------------------------------------------------------------")
  167. cpp_quote("// rfc822 Headers")
  168. cpp_quote("// --------------------------------------------------------------------------------")
  169. cpp_quote("STRCONSTA(STR_LOCALSTORE, \"LocalStore\");")
  170. //--------------------------------------------------------------------------
  171. // sizeofMember
  172. //--------------------------------------------------------------------------
  173. cpp_quote("#define sizeofMember(s,m) sizeof(((s *)0)->m)")
  174. //--------------------------------------------------------------------------
  175. // DECLARE_HANDLE Macro
  176. //--------------------------------------------------------------------------
  177. #ifndef DECLARE_HANDLE
  178. #define DECLARE_HANDLE(name) \
  179. struct name##__ { DWORD unused; }; \
  180. typedef struct name##__ _far* name
  181. #endif
  182. // OE team hasn't fixed their idl to avoid the Win64 midl warnings - turn it off
  183. midl_pragma warning(disable:2395)
  184. //--------------------------------------------------------------------------
  185. // OEStore Type Library
  186. //--------------------------------------------------------------------------
  187. [
  188. uuid(E462D143-5162-11d1-8A95-00C04FB951F3),
  189. helpstring("Microsoft Outlook Express Store Type Library 1.0"),
  190. version(1.0)
  191. ]
  192. library OESTORE
  193. {
  194. //----------------------------------------------------------------------
  195. // Standard Type Library Stuff
  196. //----------------------------------------------------------------------
  197. importlib("stdole2.tlb");
  198. //----------------------------------------------------------------------
  199. // Stream Store Version
  200. //----------------------------------------------------------------------
  201. const DWORD STREAM_STORE_VERSION = 5;
  202. //----------------------------------------------------------------------
  203. // STREAMUSERDATA
  204. //----------------------------------------------------------------------
  205. typedef struct tagSTREAMUSERDATA {
  206. BYTE rgbReserved[512];
  207. } STREAMUSERDATA, *LPSTREAMUSERDATA;
  208. //----------------------------------------------------------------------
  209. // STMCOLID
  210. //----------------------------------------------------------------------
  211. typedef enum tagSTMCOLID {
  212. STMCOL_ID=0,
  213. STMCOL_REFCOUNT,
  214. STMCOL_STREAM,
  215. STMCOL_OFFSETS,
  216. STMCOL_LAST
  217. } STMCOLID;
  218. //----------------------------------------------------------------------
  219. // STREAMINFO
  220. //----------------------------------------------------------------------
  221. typedef struct tagSTREAMINFO {
  222. BYTE *pAllocated;
  223. BYTE bVersion;
  224. DWORD idStream;
  225. FILEADDRESS faStream;
  226. DWORD cRefCount;
  227. BLOB Offsets;
  228. } STREAMINFO, *LPSTREAMINFO;
  229. //----------------------------------------------------------------------
  230. // Stream Property Store Binding Table
  231. //----------------------------------------------------------------------
  232. cpp_quote("BEGIN_COLUMN_ARRAY(g_rgStmTblColumns, STMCOL_LAST)")
  233. cpp_quote(" DEFINE_COLUMN(STMCOL_ID, CDT_UNIQUE, STREAMINFO, idStream)")
  234. cpp_quote(" DEFINE_COLUMN(STMCOL_REFCOUNT, CDT_DWORD, STREAMINFO, cRefCount)")
  235. cpp_quote(" DEFINE_COLUMN(STMCOL_STREAM, CDT_STREAM, STREAMINFO, faStream)")
  236. cpp_quote(" DEFINE_COLUMN(STMCOL_OFFSETS, CDT_VARBLOB, STREAMINFO, Offsets)")
  237. cpp_quote("END_COLUMN_ARRAY")
  238. //----------------------------------------------------------------------
  239. // Folder Table Primary Index Definition
  240. //----------------------------------------------------------------------
  241. cpp_quote("BEGIN_TABLE_INDEX(g_StmTblPrimaryIndex, 1)")
  242. cpp_quote(" DEFINE_KEY(STMCOL_ID, 0, 0)")
  243. cpp_quote("END_TABLE_INDEX")
  244. //----------------------------------------------------------------------
  245. // Folder Record Format
  246. //----------------------------------------------------------------------
  247. cpp_quote("BEGIN_TABLE_SCHEMA(g_StreamTableSchema, CLSID_StreamDatabase, STREAMINFO)")
  248. cpp_quote(" SCHEMA_PROPERTY(STREAM_STORE_VERSION)")
  249. cpp_quote(" SCHEMA_PROPERTY(TSF_RESETIFBADVERSION | TSF_HASSTREAMS)")
  250. cpp_quote(" SCHEMA_PROPERTY(sizeof(STREAMUSERDATA))")
  251. cpp_quote(" SCHEMA_PROPERTY(offsetof(STREAMINFO, idStream))")
  252. cpp_quote(" SCHEMA_PROPERTY(STMCOL_LAST)")
  253. cpp_quote(" SCHEMA_PROPERTY(g_rgStmTblColumns)")
  254. cpp_quote(" SCHEMA_PROPERTY(&g_StmTblPrimaryIndex)")
  255. cpp_quote(" SCHEMA_PROPERTY(NULL)")
  256. cpp_quote("END_TABLE_SCHEMA")
  257. //------------------------------------------------------------------
  258. // Extern'ed Record Formats
  259. //------------------------------------------------------------------
  260. cpp_quote("extern const TABLESCHEMA g_StreamTableSchema;")
  261. //----------------------------------------------------------------------
  262. // IMessageStore
  263. //----------------------------------------------------------------------
  264. cpp_quote("#ifndef __LPMESSAGESTORE_DEFINED")
  265. cpp_quote("#define __LPMESSAGESTORE_DEFINED")
  266. [
  267. object,
  268. uuid(E883FC75-EC08-11d1-9A53-00C04FA309D4),
  269. pointer_default(unique)
  270. ]
  271. interface IMessageStore : IDatabase
  272. {
  273. //------------------------------------------------------------------
  274. // Pointer to an interface of this type
  275. //------------------------------------------------------------------
  276. typedef IMessageStore *LPMESSAGESTORE;
  277. //------------------------------------------------------------------
  278. // Folder Database Version
  279. //------------------------------------------------------------------
  280. const DWORD FOLDER_DATABASE_VERSION = 5;
  281. //------------------------------------------------------------------
  282. // FOLDERID
  283. //------------------------------------------------------------------
  284. DECLARE_HANDLE(FOLDERID);
  285. typedef FOLDERID *LPFOLDERID;
  286. //------------------------------------------------------------------
  287. // FOLDERID Constants
  288. //------------------------------------------------------------------
  289. const FOLDERID FOLDERID_ROOT = (FOLDERID)0x00000000;
  290. const FOLDERID FOLDERID_LOCAL_STORE = (FOLDERID)0x00000001;
  291. const FOLDERID FOLDERID_INVALID = (FOLDERID)-1;
  292. //------------------------------------------------------------------
  293. // Constants
  294. //------------------------------------------------------------------
  295. const DWORD CCHMAX_FOLDER_NAME = 259;
  296. const DWORD CCHMAX_FOLDER_FILE = 260;
  297. //------------------------------------------------------------------
  298. // STOREUSERDATA
  299. //------------------------------------------------------------------
  300. typedef struct tagSTOREUSERDATA {
  301. FILETIME ftCreated;
  302. BYTE fConvertedToDBX;
  303. BYTE rgbReserved[255];
  304. } STOREUSERDATA, *LPSTOREUSERDATA;
  305. //------------------------------------------------------------------
  306. // FLDCOLID
  307. //------------------------------------------------------------------
  308. typedef enum tagFLDCOLID {
  309. FLDCOL_ID=0,
  310. FLDCOL_PARENT,
  311. FLDCOL_NAME,
  312. FLDCOL_FILE,
  313. FLDCOL_DESCRIPTION,
  314. FLDCOL_ACCOUNTID,
  315. FLDCOL_FLAGS,
  316. FLDCOL_MESSAGES,
  317. FLDCOL_UNREAD,
  318. FLDCOL_SPECIAL,
  319. FLDCOL_TYPE,
  320. FLDCOL_HIERARCHY,
  321. FLDCOL_LISTSTAMP,
  322. FLDCOL_SERVERHIGH,
  323. FLDCOL_SERVERLOW,
  324. FLDCOL_SERVERCOUNT,
  325. FLDCOL_CLIENTHIGH,
  326. FLDCOL_CLIENTLOW,
  327. FLDCOL_NOTDOWNLOADED,
  328. FLDCOL_REQUESTED,
  329. FLDCOL_URLCOMPONENT,
  330. FLDCOL_READ,
  331. FLDCOL_THREADUNREAD,
  332. FLDCOL_VIEWUNREAD,
  333. FLDCOL_STATUSMSGDELTA,
  334. FLDCOL_STATUSUNREADDELTA,
  335. FLDCOL_WATCHEDHIGH,
  336. FLDCOL_WATCHEDUNREAD,
  337. FLDCOL_WATCHED,
  338. FLDCOL_LAST
  339. } FLDCOLID;
  340. //------------------------------------------------------------------
  341. // Folder Flags - Reuse the commented out stuff
  342. //------------------------------------------------------------------
  343. typedef DWORD FLDRFLAGS;
  344. cpp_quote("#define FOLDER_SUBSCRIBED 0x00000001 // Indicates that a folder is subscribed")
  345. // cpp_quote("#define FOLDER_HASSUBCHILD 0x00000002 // Indicates that a folder has an eventual subscribed child")
  346. cpp_quote("#define FOLDER_CHILDRENKNOWN 0x00000004 // Indicates that LIST % already issued to get immediate children")
  347. cpp_quote("#define FOLDER_SERVER 0x00000008 // Folder is a server node")
  348. cpp_quote("#define FOLDER_HASCHILDREN 0x00000010 // The folder has children - doesn't specify subscribed state")
  349. cpp_quote("#define FOLDER_CANDELETE 0x00000020 // The folder can be deleted")
  350. cpp_quote("#define FOLDER_FINDRESULTS 0x00000040 // This is a search Folder)")
  351. //cpp_quote("#define FOLDER_LOCALSTORE 0x00000080 // This is a store and it is the local store")
  352. cpp_quote("#define FOLDER_HIDDEN 0x00000100 // The Folder Node should be hidden from the user")
  353. cpp_quote("#define FOLDER_DROPTARGET 0x00000200 // Can drop to")
  354. cpp_quote("#define FOLDER_HASNEWGROUPS 0x00000400 // Has new groups (news server only)")
  355. cpp_quote("#define FOLDER_DOWNLOADHEADERS 0x00000800 // Synchronize new headers")
  356. cpp_quote("#define FOLDER_DOWNLOADNEW 0x00001000 // Synchronize message bodies")
  357. cpp_quote("#define FOLDER_DOWNLOADALL 0x00002000 // Synchronize all")
  358. cpp_quote("#define FOLDER_MODERATED 0x00004000 // The folder is moderated (newsgroups)")
  359. cpp_quote("#define FOLDER_BLOCKED 0x00008000 // The folder is blocked (newsgroups)")
  360. cpp_quote("#define FOLDER_NOPOSTING 0x00010000 // The folder can not be posted to")
  361. //cpp_quote("#define FOLDER_DEFAULTNEWSSTORE 0x00020000 // The folder is a store and is the default news store")
  362. cpp_quote("#define FOLDER_CANRENAME 0x00040000 // Can Rename this folder")
  363. cpp_quote("#define FOLDER_NOCHILDCREATE 0x00080000 // Child folders can not be created")
  364. cpp_quote("#define FOLDER_CANHAVESPECIAL 0x00100000 // Only set with FOLDER_SERVER to note that the server can have special folders")
  365. cpp_quote("#define FOLDER_NEW 0x00200000 // The folder is new (newsgroups)")
  366. cpp_quote("#define FOLDER_SHOWALL 0x00400000 // Show all folders for this account (IMAP server)")
  367. cpp_quote("#define FOLDER_EXPANDTREE 0x00800000 // Expand state of folder list treeview")
  368. cpp_quote("#define FOLDER_NOSELECT 0x01000000 // Folder cannot be selected (IMAP)")
  369. cpp_quote("#define FOLDER_NONEXISTENT 0x02000000 // Folder does not exist (IMAP)")
  370. cpp_quote("#define FOLDER_NOTRANSLATEUTF7 0x04000000 // Folder name must NOT be converted to UTF7 (IMAP)")
  371. cpp_quote("#define FOLDER_CREATEONDEMAND 0x08000000 // Folder was created offline, needs to be created on server")
  372. cpp_quote("#define FOLDER_MSNSERVER 0x10000000 // Folder is a server associated with MSN.com")
  373. //----------------------------------------------------------------------
  374. // SPECIALFOLDER - How to identify a special folder
  375. //----------------------------------------------------------------------
  376. typedef BYTE SPECIALFOLDER;
  377. const SPECIALFOLDER FOLDER_NOTSPECIAL = 0;
  378. const SPECIALFOLDER FOLDER_INBOX = 1;
  379. const SPECIALFOLDER FOLDER_OUTBOX = 2;
  380. const SPECIALFOLDER FOLDER_SENT = 3;
  381. const SPECIALFOLDER FOLDER_DELETED = 4;
  382. const SPECIALFOLDER FOLDER_DRAFT = 5;
  383. const SPECIALFOLDER FOLDER_ERRORS = 6;
  384. const SPECIALFOLDER FOLDER_JUNK = 7;
  385. const SPECIALFOLDER FOLDER_MSNPROMO = 8;
  386. const SPECIALFOLDER FOLDER_BULKMAIL = 9;
  387. const SPECIALFOLDER FOLDER_MAX = 10;
  388. //------------------------------------------------------------------
  389. // FOLDERTYPE
  390. //------------------------------------------------------------------
  391. typedef BYTE FOLDERTYPE;
  392. const FOLDERTYPE FOLDER_ROOTNODE = 4;
  393. const FOLDERTYPE FOLDER_LOCAL = 3;
  394. const FOLDERTYPE FOLDER_HTTPMAIL = 2;
  395. const FOLDERTYPE FOLDER_IMAP = 1;
  396. const FOLDERTYPE FOLDER_NEWS = 0;
  397. const FOLDERTYPE FOLDER_TYPESMAX = 5;
  398. const FOLDERTYPE FOLDER_INVALID = 0xFF;
  399. //------------------------------------------------------------------
  400. // FOLDERINFO
  401. //------------------------------------------------------------------
  402. typedef struct tagFOLDERINFO {
  403. BYTE *pAllocated;
  404. BYTE bVersion;
  405. FOLDERID idFolder;
  406. FOLDERID idParent;
  407. LPSTR pszName;
  408. LPSTR pszFile;
  409. LPSTR pszDescription;
  410. LPSTR pszAccountId; // Server Nodes Only
  411. LPSTR pszUrlComponent;
  412. FLDRFLAGS dwFlags;
  413. DWORD cMessages;
  414. DWORD cUnread;
  415. DWORD cWatched;
  416. DWORD cThreadUnreadOld;
  417. DWORD cViewUnreadOld;
  418. DWORD cWatchedUnread;
  419. SPECIALFOLDER tySpecial;
  420. FOLDERTYPE tyFolder;
  421. BYTE bHierarchy;
  422. DWORD dwListStamp;
  423. DWORD dwServerHigh; // highest numbered article on server (news)
  424. DWORD dwServerLow; // lowest numbered article on server (news)
  425. DWORD dwServerCount; // count of articles on server (news)
  426. DWORD dwClientHigh; // highest numbered article known to client (news)
  427. DWORD dwClientLow; // lowest numbered article known to client (news)
  428. DWORD dwStatusMsgDelta; // total number of msgs added via STATUS resp. (IMAP)
  429. DWORD dwStatusUnreadDelta; // number of unread added via STATUS resp. (IMAP)
  430. DWORD dwNotDownloaded;
  431. BLOB Requested;
  432. BLOB Read;
  433. DWORD dwClientWatchedHigh; // Highest numbered article we've checked for watch info (news)
  434. } FOLDERINFO, *LPFOLDERINFO;
  435. //------------------------------------------------------------------
  436. // Folder Record Members
  437. //------------------------------------------------------------------
  438. cpp_quote("BEGIN_COLUMN_ARRAY(g_rgFldTblColumns, FLDCOL_LAST)")
  439. cpp_quote(" DEFINE_COLUMN(FLDCOL_ID, CDT_UNIQUE, FOLDERINFO, idFolder)")
  440. cpp_quote(" DEFINE_COLUMN(FLDCOL_PARENT, CDT_DWORD, FOLDERINFO, idParent)")
  441. cpp_quote(" DEFINE_COLUMN(FLDCOL_NAME, CDT_VARSTRA, FOLDERINFO, pszName)")
  442. cpp_quote(" DEFINE_COLUMN(FLDCOL_FILE, CDT_VARSTRA, FOLDERINFO, pszFile)")
  443. cpp_quote(" DEFINE_COLUMN(FLDCOL_DESCRIPTION, CDT_VARSTRA, FOLDERINFO, pszDescription)")
  444. cpp_quote(" DEFINE_COLUMN(FLDCOL_ACCOUNTID, CDT_VARSTRA, FOLDERINFO, pszAccountId)")
  445. cpp_quote(" DEFINE_COLUMN(FLDCOL_FLAGS, CDT_FLAGS, FOLDERINFO, dwFlags)")
  446. cpp_quote(" DEFINE_COLUMN(FLDCOL_MESSAGES, CDT_DWORD, FOLDERINFO, cMessages)")
  447. cpp_quote(" DEFINE_COLUMN(FLDCOL_UNREAD, CDT_DWORD, FOLDERINFO, cUnread)")
  448. cpp_quote(" DEFINE_COLUMN(FLDCOL_SPECIAL, CDT_BYTE, FOLDERINFO, tySpecial)")
  449. cpp_quote(" DEFINE_COLUMN(FLDCOL_TYPE, CDT_BYTE, FOLDERINFO, tyFolder)")
  450. cpp_quote(" DEFINE_COLUMN(FLDCOL_HIERARCHY, CDT_BYTE, FOLDERINFO, bHierarchy)")
  451. cpp_quote(" DEFINE_COLUMN(FLDCOL_LISTSTAMP, CDT_DWORD, FOLDERINFO, dwListStamp)")
  452. cpp_quote(" DEFINE_COLUMN(FLDCOL_SERVERHIGH, CDT_DWORD, FOLDERINFO, dwServerHigh)")
  453. cpp_quote(" DEFINE_COLUMN(FLDCOL_SERVERLOW, CDT_DWORD, FOLDERINFO, dwServerLow)")
  454. cpp_quote(" DEFINE_COLUMN(FLDCOL_SERVERCOUNT, CDT_DWORD, FOLDERINFO, dwServerCount)")
  455. cpp_quote(" DEFINE_COLUMN(FLDCOL_CLIENTHIGH, CDT_DWORD, FOLDERINFO, dwClientHigh)")
  456. cpp_quote(" DEFINE_COLUMN(FLDCOL_CLIENTLOW, CDT_DWORD, FOLDERINFO, dwClientLow)")
  457. cpp_quote(" DEFINE_COLUMN(FLDCOL_NOTDOWNLOADED, CDT_DWORD, FOLDERINFO, dwNotDownloaded)")
  458. cpp_quote(" DEFINE_COLUMN(FLDCOL_REQUESTED, CDT_VARBLOB, FOLDERINFO, Requested)")
  459. cpp_quote(" DEFINE_COLUMN(FLDCOL_URLCOMPONENT, CDT_VARSTRA, FOLDERINFO, pszUrlComponent)")
  460. cpp_quote(" DEFINE_COLUMN(FLDCOL_READ, CDT_VARBLOB, FOLDERINFO, Read)")
  461. cpp_quote(" DEFINE_COLUMN(FLDCOL_THREADUNREAD, CDT_DWORD, FOLDERINFO, cThreadUnreadOld)")
  462. cpp_quote(" DEFINE_COLUMN(FLDCOL_VIEWUNREAD, CDT_DWORD, FOLDERINFO, cViewUnreadOld)")
  463. cpp_quote(" DEFINE_COLUMN(FLDCOL_STATUSMSGDELTA, CDT_DWORD, FOLDERINFO, dwStatusMsgDelta)")
  464. cpp_quote(" DEFINE_COLUMN(FLDCOL_STATUSUNREADDELTA, CDT_DWORD, FOLDERINFO, dwStatusUnreadDelta)")
  465. cpp_quote(" DEFINE_COLUMN(FLDCOL_WATCHEDHIGH, CDT_DWORD, FOLDERINFO, dwClientWatchedHigh)")
  466. cpp_quote(" DEFINE_COLUMN(FLDCOL_WATCHEDUNREAD, CDT_DWORD, FOLDERINFO, cWatchedUnread)")
  467. cpp_quote(" DEFINE_COLUMN(FLDCOL_WATCHED, CDT_DWORD, FOLDERINFO, cWatched)")
  468. cpp_quote("END_COLUMN_ARRAY")
  469. //------------------------------------------------------------------
  470. // Folder Database Symbol Table for Regular Expression Support
  471. //------------------------------------------------------------------
  472. cpp_quote("BEGIN_SYMBOL_TABLE(g_FldSymbolTable, 2)")
  473. cpp_quote(" DEFINE_SYMBOL(SYMBOL_DWORD, \"FOLDER_SUBSCRIBED\", FOLDER_SUBSCRIBED)")
  474. cpp_quote(" DEFINE_SYMBOL(SYMBOL_COLUMN, \"FLDCOL_FLAGS\", FLDCOL_FLAGS)")
  475. cpp_quote("END_SYMBOL_TABLE")
  476. //------------------------------------------------------------------
  477. // Foldername - parent folderid index
  478. //------------------------------------------------------------------
  479. cpp_quote("#define IINDEX_ALL 1")
  480. cpp_quote("#define IINDEX_SUBSCRIBED 2")
  481. //------------------------------------------------------------------
  482. // Folder Table Primary Index Definition
  483. //------------------------------------------------------------------
  484. cpp_quote("BEGIN_TABLE_INDEX(g_FldTblPrimaryIndex, 1)")
  485. cpp_quote(" DEFINE_KEY(FLDCOL_ID, 0, 0)")
  486. cpp_quote("END_TABLE_INDEX")
  487. //------------------------------------------------------------------
  488. // ParentId/FolderName Index
  489. //------------------------------------------------------------------
  490. cpp_quote("BEGIN_TABLE_INDEX(g_FolderNameIndex, 2)")
  491. cpp_quote(" DEFINE_KEY(FLDCOL_PARENT, 0, 0)")
  492. cpp_quote(" DEFINE_KEY(FLDCOL_NAME, COMPARE_ASANSI | COMPARE_IGNORECASE, 0)")
  493. cpp_quote("END_TABLE_INDEX")
  494. //------------------------------------------------------------------
  495. // Folder Record Format
  496. //------------------------------------------------------------------
  497. cpp_quote("BEGIN_TABLE_SCHEMA(g_FolderTableSchema, CLSID_FolderDatabase, FOLDERINFO)")
  498. cpp_quote(" SCHEMA_PROPERTY(FOLDER_DATABASE_VERSION)")
  499. cpp_quote(" SCHEMA_PROPERTY(TSF_RESETIFBADVERSION | TSF_HASEXTENSION)")
  500. cpp_quote(" SCHEMA_PROPERTY(sizeof(STOREUSERDATA))")
  501. cpp_quote(" SCHEMA_PROPERTY(offsetof(FOLDERINFO, idFolder))")
  502. cpp_quote(" SCHEMA_PROPERTY(FLDCOL_LAST)")
  503. cpp_quote(" SCHEMA_PROPERTY(g_rgFldTblColumns)")
  504. cpp_quote(" SCHEMA_PROPERTY(&g_FldTblPrimaryIndex)")
  505. cpp_quote(" SCHEMA_PROPERTY(&g_FldSymbolTable)")
  506. cpp_quote("END_TABLE_SCHEMA")
  507. //------------------------------------------------------------------
  508. // Extern'ed Record Formats
  509. //------------------------------------------------------------------
  510. cpp_quote("extern const TABLESCHEMA g_FolderTableSchema;")
  511. cpp_quote("extern const TABLEINDEX g_FolderNameIndex;")
  512. //------------------------------------------------------------------
  513. // CONNECT_STATE
  514. //------------------------------------------------------------------
  515. typedef enum tagCONNECT_STATE {
  516. CONNECT_STATE_DISCONNECT = 0,
  517. CONNECT_STATE_CONNECT,
  518. CONNECT_STATE_LAST
  519. } CONNECT_STATE;
  520. //------------------------------------------------------------------
  521. // CREATEFOLDERFLAGS
  522. //------------------------------------------------------------------
  523. typedef DWORD CREATEFOLDERFLAGS;
  524. cpp_quote("#define CREATE_FOLDER_UNIQUIFYNAME 0x00000002")
  525. cpp_quote("#define CREATE_FOLDER_LOCALONLY 0x00000004")
  526. //------------------------------------------------------------------
  527. // STOREVALIDATEFLAGS
  528. //------------------------------------------------------------------
  529. typedef DWORD STOREVALIDATEFLAGS;
  530. cpp_quote("#define STORE_VALIDATE_DONTSYNCWITHACCOUNTS 0x00000001")
  531. //------------------------------------------------------------------
  532. // RENAMEFOLDERFLAGS
  533. //------------------------------------------------------------------
  534. typedef DWORD RENAMEFOLDERFLAGS;
  535. //------------------------------------------------------------------
  536. // MOVEFOLDERFLAGS
  537. //------------------------------------------------------------------
  538. typedef DWORD MOVEFOLDERFLAGS;
  539. //------------------------------------------------------------------
  540. // OPENFOLDERFLAGS
  541. //------------------------------------------------------------------
  542. typedef DWORD OPENFOLDERFLAGS;
  543. cpp_quote("#define OPEN_FOLDER_NOCREATE 0x00000001")
  544. //------------------------------------------------------------------
  545. // DELETEFOLDERFLAGS
  546. //------------------------------------------------------------------
  547. typedef DWORD DELETEFOLDERFLAGS;
  548. cpp_quote("#define DELETE_FOLDER_CHILDRENONLY 0x00000001")
  549. cpp_quote("#define DELETE_FOLDER_RECURSIVE 0x00000002")
  550. cpp_quote("#define DELETE_FOLDER_NOTRASHCAN 0x00000004")
  551. cpp_quote("#define DELETE_FOLDER_DELETESPECIAL 0x00000008")
  552. //------------------------------------------------------------------
  553. // SYNCSTOREFLAGS
  554. //------------------------------------------------------------------
  555. typedef DWORD SYNCSTOREFLAGS;
  556. cpp_quote("#define SYNC_STORE_REFRESH 0x00000001")
  557. cpp_quote("#define SYNC_STORE_GET_DESCRIPTIONS 0x00000002")
  558. //------------------------------------------------------------------
  559. // SETMESSAGEFLAGSFLAGS
  560. //------------------------------------------------------------------
  561. typedef DWORD SETMESSAGEFLAGSFLAGS;
  562. cpp_quote("#define SET_MESSAGE_FLAGS_FORCE 0x00000001")
  563. //------------------------------------------------------------------
  564. // Methods
  565. //------------------------------------------------------------------
  566. HRESULT Initialize(
  567. [in] LPCSTR pszDirectory);
  568. HRESULT Validate(
  569. [in] STOREVALIDATEFLAGS dwFlags);
  570. HRESULT GetDirectory(
  571. [in] LPSTR pszDirectory,
  572. [in] DWORD cchMaxDir);
  573. HRESULT Synchronize(
  574. [in] FOLDERID idFolder,
  575. [in] SYNCSTOREFLAGS dwFlags,
  576. [in] IStoreCallback *pCallback);
  577. HRESULT FindServerId(
  578. [in] LPCSTR pszAcctId,
  579. [out] LPFOLDERID pidServer);
  580. HRESULT CreateServer(
  581. [in] IImnAccount *pAccount,
  582. [in] FLDRFLAGS dwFlags,
  583. [out] LPFOLDERID pidFolder);
  584. HRESULT CreateFolder(
  585. [in] CREATEFOLDERFLAGS dwCreateFlags,
  586. [in,out] LPFOLDERINFO pInfo,
  587. [in] IStoreCallback *pCallback);
  588. HRESULT OpenSpecialFolder(
  589. [in] FOLDERID idStore,
  590. [in] IMessageServer *pServer,
  591. [in] SPECIALFOLDER tySpecial,
  592. [out] IMessageFolder **ppFolder);
  593. HRESULT OpenFolder(
  594. [in] FOLDERID idFolder,
  595. [in] IMessageServer *pServer,
  596. [in] OPENFOLDERFLAGS dwFlags,
  597. [out] IMessageFolder **ppFolder);
  598. HRESULT MoveFolder(
  599. [in] FOLDERID idFolder,
  600. [in] FOLDERID idParentNew,
  601. [in] MOVEFOLDERFLAGS dwFlags,
  602. [in] IStoreCallback *pCallback);
  603. HRESULT RenameFolder(
  604. [in] FOLDERID idFolder,
  605. [in] LPCSTR pszName,
  606. [in] RENAMEFOLDERFLAGS dwFlags,
  607. [in] IStoreCallback *pCallback);
  608. HRESULT DeleteFolder(
  609. [in] FOLDERID idFolder,
  610. [in] DELETEFOLDERFLAGS dwFlags,
  611. [in] IStoreCallback *pCallback);
  612. HRESULT GetFolderInfo(
  613. [in] FOLDERID idFolder,
  614. [in,out] LPFOLDERINFO pInfo); // Call IMessageStore::FreeRecord on success
  615. HRESULT GetSpecialFolderInfo(
  616. [in] FOLDERID idStore,
  617. [in] SPECIALFOLDER tySpecial,
  618. [in,out] LPFOLDERINFO pInfo); // Call IMessageStore::FreeRecord on success
  619. HRESULT SubscribeToFolder(
  620. [in] FOLDERID idFolder,
  621. [in] BOOL fSubscribe,
  622. [in] IStoreCallback *pCallback);
  623. HRESULT GetFolderCounts(
  624. [in] FOLDERID idFolder,
  625. [in] IStoreCallback *pCallback);
  626. HRESULT UpdateFolderCounts(
  627. [in] FOLDERID idFolder,
  628. [in] LONG lMsgs,
  629. [in] LONG lUnread,
  630. [in] LONG lWatchedUnread,
  631. [in] LONG lWatched);
  632. HRESULT EnumChildren(
  633. [in] FOLDERID idParent,
  634. [in] BOOL fSubscribed,
  635. [out] IEnumerateFolders **ppEnum);
  636. HRESULT GetNewGroups(
  637. [in] FOLDERID idFolder,
  638. [in] LPSYSTEMTIME pSysTime,
  639. [in] IStoreCallback *pCallback);
  640. }
  641. cpp_quote("#endif // __LPMESSAGESTORE_DEFINED")
  642. //----------------------------------------------------------------------
  643. // IEnumerateFolders
  644. //----------------------------------------------------------------------
  645. cpp_quote("#ifndef __LPENUMERATEFOLDERS_DEFINED")
  646. cpp_quote("#define __LPENUMERATEFOLDERS_DEFINED")
  647. [
  648. object,
  649. uuid(8551C145-0C39-11d2-9A6A-00C04FA309D4),
  650. pointer_default(unique)
  651. ]
  652. interface IEnumerateFolders : IUnknown
  653. {
  654. //------------------------------------------------------------------
  655. // Pointer to an interface of this type
  656. //------------------------------------------------------------------
  657. typedef IEnumerateFolders *LPENUMERATEFOLDERS;
  658. //------------------------------------------------------------------
  659. // Methods
  660. //------------------------------------------------------------------
  661. HRESULT Next(
  662. [in] ULONG cFetch,
  663. [in,out] LPFOLDERINFO prgInfo,
  664. [out] ULONG *pcFetched);
  665. HRESULT Skip(
  666. [in] ULONG cItems);
  667. HRESULT Reset(void);
  668. HRESULT Clone(
  669. [out] IEnumerateFolders **ppEnum);
  670. HRESULT Count(
  671. [out] ULONG *pcItems);
  672. }
  673. cpp_quote("#endif // __LPENUMERATEFOLDERS_DEFINED")
  674. //----------------------------------------------------------------------
  675. // IMessageFolder
  676. //----------------------------------------------------------------------
  677. cpp_quote("#ifndef __LPMESSAGEFOLDER_DEFINED")
  678. cpp_quote("#define __LPMESSAGEFOLDER_DEFINED")
  679. [
  680. object,
  681. uuid(E883FC76-EC08-11d1-9A53-00C04FA309D4),
  682. pointer_default(unique)
  683. ]
  684. interface IMessageFolder : IDatabase
  685. {
  686. //------------------------------------------------------------------
  687. // Pointer to an interface of this type
  688. //------------------------------------------------------------------
  689. typedef IMessageFolder *LPMESSAGEFOLDER;
  690. //------------------------------------------------------------------
  691. // Types
  692. //------------------------------------------------------------------
  693. DECLARE_HANDLE(MESSAGEID);
  694. typedef MESSAGEID *LPMESSAGEID;
  695. //------------------------------------------------------------------
  696. // MESSAGEID Constants
  697. //------------------------------------------------------------------
  698. const MESSAGEID MESSAGEID_INVALID = (MESSAGEID)-1;
  699. //------------------------------------------------------------------
  700. // Message Database Version
  701. //------------------------------------------------------------------
  702. const DWORD MESSAGE_DATABASE_VERSION = 5;
  703. const DWORD CB_COLUMNS = 256;
  704. //------------------------------------------------------------------
  705. // MSGTABLECOLID
  706. //------------------------------------------------------------------
  707. typedef enum tagMSGTABLECOLID {
  708. MSGCOL_ID=0,
  709. MSGCOL_FLAGS,
  710. MSGCOL_DATE,
  711. MSGCOL_LINECOUNT,
  712. MSGCOL_STREAM,
  713. MSGCOL_NORMALSUBJ,
  714. MSGCOL_DOWNLOADTIME,
  715. MSGCOL_MESSAGEID,
  716. MSGCOL_SUBJECT,
  717. MSGCOL_FROMHEADER,
  718. MSGCOL_REFERENCES,
  719. MSGCOL_XREF,
  720. MSGCOL_SERVER,
  721. MSGCOL_DISPLAYFROM,
  722. MSGCOL_EMAILFROM,
  723. MSGCOL_LANGUAGE,
  724. MSGCOL_PRIORITY,
  725. MSGCOL_SIZE,
  726. MSGCOL_RECEIVEDDATE,
  727. MSGCOL_DISPLAYTO,
  728. MSGCOL_EMAILTO,
  729. MSGCOL_PARTIALINFO,
  730. MSGCOL_POP3UIDL,
  731. MSGCOL_USERNAMEOLD,
  732. MSGCOL_PARTIALID,
  733. MSGCOL_FORWARDTO,
  734. MSGCOL_ACCOUNTNAME,
  735. MSGCOL_ACCOUNTID,
  736. MSGCOL_OFFSETTABLE,
  737. MSGCOL_HIGHLIGHT,
  738. MSGCOL_FOLDER,
  739. MSGCOL_FINDFOLDER,
  740. MSGCOL_FINDSOURCE,
  741. MSGCOL_PARENTOLD,
  742. MSGCOL_THREADIDOLD,
  743. MSGCOL_URLCOMPONENT,
  744. MSGCOL_STREAMIDOLD,
  745. MSGCOL_VERSION,
  746. MSGCOL_MSOESREC,
  747. MSGCOL_LASTID
  748. } MSGTABLECOLID;
  749. //----------------------------------------------------------------------
  750. // RULEID
  751. //----------------------------------------------------------------------
  752. DECLARE_HANDLE(RULEID);
  753. typedef RULEID *LPRULEID;
  754. const RULEID RULEID_INVALID = (RULEID) -1;
  755. //------------------------------------------------------------------
  756. // FOLDERUSERDATA - 1560 Bytes Long
  757. //------------------------------------------------------------------
  758. typedef struct tagFOLDERUSERDATA {
  759. DWORD fInitialized; // 4 Has this folder been initialized yet
  760. FOLDERTYPE tyFolder; // the folder type
  761. CHAR szAcctId[CCHMAX_ACCOUNT_NAME]; // 276 Account Id that folder belongs to
  762. CHAR szFolder[CCHMAX_FOLDER_NAME]; // 532 Folder Name
  763. SPECIALFOLDER tySpecial; // 536 Special Folder Type
  764. DWORD fSubscribed; // 540 Is the folder subscribed ?
  765. DWORD idSort; // 544 Current View Sort Order
  766. DWORD fAscending; // 548 Current view is ascending ?
  767. DWORD fThreaded; // 552 Current view is threaded
  768. RULEID ridFilter; // 556 Current Filter for this Folder
  769. DWORD dwFilterVersion; // 560 Version of the filter
  770. FOLDERID idFolder; // 564 Id of this folder
  771. DWORD fWelcomeAdded; // 568 I have already added a welcome message...
  772. DWORD dwUIDValidity; // 572 IMAP: Tells us if current acache is invalid
  773. DWORD idMsgSelected; // The last Selected row
  774. BYTE rgbColumns[CB_COLUMNS]; // Persisted Column Set
  775. DWORD dwReserved1; // Used for sorting children
  776. DWORD dwReserved2; // Reserved
  777. DWORD fExpandAll; // Expand All Threads?
  778. DWORD dwReserved3; // Do we have a dead filter?
  779. BYTE fViewCounts; // Converted to view counts
  780. BYTE fNewThreadModel; // Converted to shared stream table ?
  781. BYTE fWatchedCounts; // Converted to watched unread counts?
  782. BYTE fTotalWatched; // Total Watched has been migrated.
  783. BYTE fShowDeleted; // Current view shows deleted messages
  784. BYTE fShowReplies; // Current view shows message replies
  785. BYTE fNoIndexes; // No more indexes
  786. BYTE rgReserved[717]; // Reserved
  787. } FOLDERUSERDATA, *LPFOLDERUSERDATA;
  788. //------------------------------------------------------------------
  789. // ARF_ article flags - These are the MSGFLAGS
  790. //------------------------------------------------------------------
  791. typedef DWORD MESSAGEFLAGS;
  792. cpp_quote("#define ARF_HASBODY 0x00000001")
  793. cpp_quote("#define ARF_ARTICLE_EXPIRED 0x00000002")
  794. cpp_quote("#define ARF_KEEPBODY 0x00000004")
  795. cpp_quote("#define ARF_UNSENT 0x00000008")
  796. cpp_quote("#define ARF_MIGRATED 0x00000010")
  797. cpp_quote("#define ARF_FLAGGED 0x00000020")
  798. cpp_quote("#define ARF_ENDANGERED 0x00000040")
  799. cpp_quote("#define ARF_READ 0x00000080")
  800. cpp_quote("#define ARF_DOWNLOAD 0x00000100")
  801. //cpp_quote("#define ARF_VISIBLE 0x00000200")
  802. cpp_quote("#define ARF_NOSECUI 0x00000400")
  803. cpp_quote("#define ARF_NEWSMSG 0x00000800")
  804. cpp_quote("#define ARF_SIGNED 0x00001000")
  805. cpp_quote("#define ARF_ENCRYPTED 0x00002000")
  806. cpp_quote("#define ARF_HASATTACH 0x00004000")
  807. cpp_quote("#define ARF_VOICEMAIL 0x00008000")
  808. cpp_quote("#define ARF_SUBMITTED 0x00010000")
  809. cpp_quote("#define ARF_RECEIVED 0x00020000")
  810. cpp_quote("#define ARF_RCPTSENT 0x00040000")
  811. cpp_quote("#define ARF_REPLIED 0x00080000")
  812. cpp_quote("#define ARF_FORWARDED 0x00100000")
  813. //cpp_quote("#define ARF_EXPANDED 0x00200000")
  814. cpp_quote("#define ARF_WATCH 0x00400000")
  815. cpp_quote("#define ARF_IGNORE 0x00800000")
  816. //cpp_quote("#define ARF_HASCHILDREN 0x01000000")
  817. cpp_quote("#define ARF_RCPT_PROCESSED 0x01000000")
  818. cpp_quote("#define ARF_DELETED_OFFLINE 0x02000000")
  819. cpp_quote("#define ARF_PARTIAL_RECVTIME 0x04000000")
  820. cpp_quote("#define ARF_ALLFLAGS 0x0FFFFFFF")
  821. //------------------------------------------------------------------
  822. // MESSAGE_COMBINED
  823. //------------------------------------------------------------------
  824. const DWORD MESSAGE_COMBINED = -1;
  825. //------------------------------------------------------------------
  826. // MESSAGEINFO
  827. //------------------------------------------------------------------
  828. typedef struct tagMESSAGEINFO {
  829. BYTE *pAllocated;
  830. BYTE bVersion;
  831. DWORD_PTR dwReserved;
  832. MESSAGEID idMessage;
  833. MESSAGEFLAGS dwFlags;
  834. FILETIME ftSent;
  835. DWORD cLines;
  836. FILEADDRESS faStream;
  837. DWORD idStreamOld;
  838. LPSTR pszNormalSubj;
  839. FILETIME ftDownloaded;
  840. LPSTR pszMessageId;
  841. LPSTR pszSubject;
  842. LPSTR pszFromHeader;
  843. LPSTR pszReferences;
  844. LPSTR pszXref;
  845. LPSTR pszServer;
  846. LPSTR pszDisplayFrom;
  847. LPSTR pszEmailFrom;
  848. WORD wLanguage;
  849. WORD wPriority; // IMSGPRIORITY
  850. DWORD cbMessage;
  851. FILETIME ftReceived;
  852. LPSTR pszDisplayTo;
  853. LPSTR pszEmailTo;
  854. DWORD dwPartial; // Set to MESSAGE_COMBINED to indicate its a combined message
  855. LPSTR pszUidl;
  856. LPSTR pszUserNameOld;
  857. LPSTR pszPartialId;
  858. LPSTR pszForwardTo;
  859. LPSTR pszAcctName;
  860. LPSTR pszAcctId;
  861. LPSTR pszUrlComponent;
  862. BLOB Offsets;
  863. WORD wHighlight;
  864. LPSTR pszFolder; // Only used in a find folder
  865. DWORD iFindFolder; // Only used in a find folder
  866. MESSAGEID idFindSource; // Only used in a find folder
  867. MESSAGEID idParentOld; // Used for Message Threading
  868. BLOB ThreadIdOld; // Used for custom threaded view
  869. BYTE bUnused; // The major version of oe in which this was downloaded by
  870. LPSTR pszMSOESRec;
  871. } MESSAGEINFO, *LPMESSAGEINFO;
  872. //------------------------------------------------------------------
  873. // Message Record Members
  874. //------------------------------------------------------------------
  875. cpp_quote("BEGIN_COLUMN_ARRAY(g_rgMsgTblColumns, MSGCOL_LASTID)")
  876. cpp_quote(" DEFINE_COLUMN(MSGCOL_ID, CDT_UNIQUE, MESSAGEINFO, idMessage)")
  877. cpp_quote(" DEFINE_COLUMN(MSGCOL_FLAGS, CDT_FLAGS, MESSAGEINFO, dwFlags)")
  878. cpp_quote(" DEFINE_COLUMN(MSGCOL_DATE, CDT_FILETIME, MESSAGEINFO, ftSent)")
  879. cpp_quote(" DEFINE_COLUMN(MSGCOL_LINECOUNT, CDT_DWORD, MESSAGEINFO, cLines)")
  880. cpp_quote(" DEFINE_COLUMN(MSGCOL_STREAM, CDT_STREAM, MESSAGEINFO, faStream)")
  881. cpp_quote(" DEFINE_COLUMN(MSGCOL_NORMALSUBJ, CDT_VARSTRA, MESSAGEINFO, pszNormalSubj)")
  882. cpp_quote(" DEFINE_COLUMN(MSGCOL_DOWNLOADTIME, CDT_FILETIME, MESSAGEINFO, ftDownloaded)")
  883. cpp_quote(" DEFINE_COLUMN(MSGCOL_MESSAGEID, CDT_VARSTRA, MESSAGEINFO, pszMessageId)")
  884. cpp_quote(" DEFINE_COLUMN(MSGCOL_SUBJECT, CDT_VARSTRA, MESSAGEINFO, pszSubject)")
  885. cpp_quote(" DEFINE_COLUMN(MSGCOL_FROMHEADER, CDT_VARSTRA, MESSAGEINFO, pszFromHeader)")
  886. cpp_quote(" DEFINE_COLUMN(MSGCOL_REFERENCES, CDT_VARSTRA, MESSAGEINFO, pszReferences)")
  887. cpp_quote(" DEFINE_COLUMN(MSGCOL_XREF, CDT_VARSTRA, MESSAGEINFO, pszXref)")
  888. cpp_quote(" DEFINE_COLUMN(MSGCOL_SERVER, CDT_VARSTRA, MESSAGEINFO, pszServer)")
  889. cpp_quote(" DEFINE_COLUMN(MSGCOL_DISPLAYFROM, CDT_VARSTRA, MESSAGEINFO, pszDisplayFrom)")
  890. cpp_quote(" DEFINE_COLUMN(MSGCOL_EMAILFROM, CDT_VARSTRA, MESSAGEINFO, pszEmailFrom)")
  891. cpp_quote(" DEFINE_COLUMN(MSGCOL_LANGUAGE, CDT_WORD, MESSAGEINFO, wLanguage)")
  892. cpp_quote(" DEFINE_COLUMN(MSGCOL_PRIORITY, CDT_WORD, MESSAGEINFO, wPriority)")
  893. cpp_quote(" DEFINE_COLUMN(MSGCOL_SIZE, CDT_DWORD, MESSAGEINFO, cbMessage)")
  894. cpp_quote(" DEFINE_COLUMN(MSGCOL_RECEIVEDDATE, CDT_FILETIME, MESSAGEINFO, ftReceived)")
  895. cpp_quote(" DEFINE_COLUMN(MSGCOL_DISPLAYTO, CDT_VARSTRA, MESSAGEINFO, pszDisplayTo)")
  896. cpp_quote(" DEFINE_COLUMN(MSGCOL_EMAILTO, CDT_VARSTRA, MESSAGEINFO, pszEmailTo)")
  897. cpp_quote(" DEFINE_COLUMN(MSGCOL_PARTIALINFO, CDT_DWORD, MESSAGEINFO, dwPartial)")
  898. cpp_quote(" DEFINE_COLUMN(MSGCOL_POP3UIDL, CDT_VARSTRA, MESSAGEINFO, pszUidl)")
  899. cpp_quote(" DEFINE_COLUMN(MSGCOL_USERNAMEOLD, CDT_VARSTRA, MESSAGEINFO, pszUserNameOld)")
  900. cpp_quote(" DEFINE_COLUMN(MSGCOL_PARTIALID, CDT_VARSTRA, MESSAGEINFO, pszPartialId)")
  901. cpp_quote(" DEFINE_COLUMN(MSGCOL_FORWARDTO, CDT_VARSTRA, MESSAGEINFO, pszForwardTo)")
  902. cpp_quote(" DEFINE_COLUMN(MSGCOL_ACCOUNTNAME, CDT_VARSTRA, MESSAGEINFO, pszAcctName)")
  903. cpp_quote(" DEFINE_COLUMN(MSGCOL_ACCOUNTID, CDT_VARSTRA, MESSAGEINFO, pszAcctId)")
  904. cpp_quote(" DEFINE_COLUMN(MSGCOL_OFFSETTABLE, CDT_VARBLOB, MESSAGEINFO, Offsets)")
  905. cpp_quote(" DEFINE_COLUMN(MSGCOL_HIGHLIGHT, CDT_WORD, MESSAGEINFO, wHighlight)")
  906. cpp_quote(" DEFINE_COLUMN(MSGCOL_FOLDER, CDT_VARSTRA, MESSAGEINFO, pszFolder)")
  907. cpp_quote(" DEFINE_COLUMN(MSGCOL_FINDFOLDER, CDT_DWORD, MESSAGEINFO, iFindFolder)")
  908. cpp_quote(" DEFINE_COLUMN(MSGCOL_FINDSOURCE, CDT_DWORD, MESSAGEINFO, idFindSource)")
  909. cpp_quote(" DEFINE_COLUMN(MSGCOL_PARENTOLD, CDT_DWORD, MESSAGEINFO, idParentOld)")
  910. cpp_quote(" DEFINE_COLUMN(MSGCOL_THREADIDOLD, CDT_VARBLOB, MESSAGEINFO, ThreadIdOld)")
  911. cpp_quote(" DEFINE_COLUMN(MSGCOL_URLCOMPONENT, CDT_VARSTRA, MESSAGEINFO, pszUrlComponent)")
  912. cpp_quote(" DEFINE_COLUMN(MSGCOL_STREAMIDOLD, CDT_DWORD, MESSAGEINFO, idStreamOld)")
  913. cpp_quote(" DEFINE_COLUMN(MSGCOL_VERSION, CDT_BYTE, MESSAGEINFO, bUnused)")
  914. cpp_quote(" DEFINE_COLUMN(MSGCOL_MSOESREC, CDT_VARSTRA, MESSAGEINFO, pszMSOESRec)")
  915. cpp_quote("END_COLUMN_ARRAY")
  916. //------------------------------------------------------------------
  917. // Database MethodIds
  918. //------------------------------------------------------------------
  919. cpp_quote("#define METHODID_ISREPLYPOSTVISIBLE 100")
  920. cpp_quote("#define METHODID_MESSAGEAGEINDAYS 101")
  921. //------------------------------------------------------------------
  922. // Message Database Symbol Table for Regular Expression Support
  923. //------------------------------------------------------------------
  924. cpp_quote("BEGIN_SYMBOL_TABLE(g_MsgSymbolTable, 21)")
  925. cpp_quote(" DEFINE_SYMBOL(SYMBOL_DWORD, \"ARF_READ\", ARF_READ)")
  926. cpp_quote(" DEFINE_SYMBOL(SYMBOL_DWORD, \"ARF_HASBODY\", ARF_HASBODY)")
  927. cpp_quote(" DEFINE_SYMBOL(SYMBOL_DWORD, \"ARF_ENDANGERED\", ARF_ENDANGERED)")
  928. cpp_quote(" DEFINE_SYMBOL(SYMBOL_COLUMN, \"MSGCOL_FLAGS\", MSGCOL_FLAGS)")
  929. cpp_quote(" DEFINE_SYMBOL(SYMBOL_COLUMN, \"MSGCOL_EMAILFROM\", MSGCOL_EMAILFROM)")
  930. cpp_quote(" DEFINE_SYMBOL(SYMBOL_DWORD, \"ARF_WATCH\", ARF_WATCH)")
  931. cpp_quote(" DEFINE_SYMBOL(SYMBOL_DWORD, \"ARF_IGNORE\", ARF_IGNORE)")
  932. cpp_quote(" DEFINE_SYMBOL(SYMBOL_DWORD, \"ARF_HASATTACH\", ARF_HASATTACH)")
  933. cpp_quote(" DEFINE_SYMBOL(SYMBOL_DWORD, \"ARF_SIGNED\", ARF_SIGNED)")
  934. cpp_quote(" DEFINE_SYMBOL(SYMBOL_DWORD, \"ARF_ENCRYPTED\", ARF_ENCRYPTED)")
  935. cpp_quote(" DEFINE_SYMBOL(SYMBOL_COLUMN, \"MSGCOL_PRIORITY\", MSGCOL_PRIORITY)")
  936. cpp_quote(" DEFINE_SYMBOL(SYMBOL_COLUMN, \"MSGCOL_SUBJECT\", MSGCOL_SUBJECT)")
  937. cpp_quote(" DEFINE_SYMBOL(SYMBOL_COLUMN, \"MSGCOL_FROMHEADER\", MSGCOL_FROMHEADER)")
  938. cpp_quote(" DEFINE_SYMBOL(SYMBOL_COLUMN, \"MSGCOL_ACCOUNTID\", MSGCOL_ACCOUNTID)")
  939. cpp_quote(" DEFINE_SYMBOL(SYMBOL_COLUMN, \"MSGCOL_LINECOUNT\", MSGCOL_LINECOUNT)")
  940. cpp_quote(" DEFINE_SYMBOL(SYMBOL_DWORD, \"IMSG_PRI_HIGH\", IMSG_PRI_HIGH)")
  941. cpp_quote(" DEFINE_SYMBOL(SYMBOL_DWORD, \"IMSG_PRI_LOW\", IMSG_PRI_LOW)")
  942. cpp_quote(" DEFINE_SYMBOL(SYMBOL_COLUMN, \"MSGCOL_DISPLAYFROM\", MSGCOL_DISPLAYFROM)")
  943. cpp_quote(" DEFINE_SYMBOL(SYMBOL_DWORD, \"ARF_FLAGGED\", ARF_FLAGGED)")
  944. cpp_quote(" DEFINE_SYMBOL(SYMBOL_METHOD, \"MessageAgeInDays\", METHODID_MESSAGEAGEINDAYS)")
  945. cpp_quote(" DEFINE_SYMBOL(SYMBOL_DWORD, \"ARF_DELETED_OFFLINE\", ARF_DELETED_OFFLINE)")
  946. cpp_quote("END_SYMBOL_TABLE")
  947. //------------------------------------------------------------------
  948. // Index Constants
  949. //------------------------------------------------------------------
  950. const INDEXORDINAL IINDEX_HTTPURL = 3;
  951. const INDEXORDINAL IINDEX_FINDER = 2;
  952. const INDEXORDINAL IINDEX_WATCHIGNORE = 1;
  953. //------------------------------------------------------------------
  954. // g_MsgTblPrimaryIndex
  955. //------------------------------------------------------------------
  956. cpp_quote("BEGIN_TABLE_INDEX(g_MsgTblPrimaryIndex, 1)")
  957. cpp_quote(" DEFINE_KEY(MSGCOL_ID, 0, 0)")
  958. cpp_quote("END_TABLE_INDEX")
  959. //------------------------------------------------------------------
  960. // g_WatchIgnoreIndex
  961. //------------------------------------------------------------------
  962. cpp_quote("BEGIN_TABLE_INDEX(g_WatchIgnoreIndex, 2)")
  963. cpp_quote(" DEFINE_KEY(MSGCOL_MESSAGEID, 0, 0)")
  964. cpp_quote(" DEFINE_KEY(MSGCOL_ID, 0, 0)")
  965. cpp_quote("END_TABLE_INDEX")
  966. //------------------------------------------------------------------
  967. // g_HttpUrlIndex
  968. //------------------------------------------------------------------
  969. cpp_quote("BEGIN_TABLE_INDEX(g_HttpUrlIndex, 2)")
  970. cpp_quote(" DEFINE_KEY(MSGCOL_URLCOMPONENT, 0, 0)")
  971. cpp_quote(" DEFINE_KEY(MSGCOL_ID, 0, 0)")
  972. cpp_quote("END_TABLE_INDEX")
  973. //------------------------------------------------------------------
  974. // Message Record Format
  975. //------------------------------------------------------------------
  976. cpp_quote("BEGIN_TABLE_SCHEMA(g_MessageTableSchema, CLSID_MessageDatabase, MESSAGEINFO)")
  977. cpp_quote(" SCHEMA_PROPERTY(MESSAGE_DATABASE_VERSION)")
  978. cpp_quote(" SCHEMA_PROPERTY(TSF_HASSTREAMS | TSF_RESETIFBADVERSION | TSF_HASEXTENSION)")
  979. cpp_quote(" SCHEMA_PROPERTY(sizeof(FOLDERUSERDATA))")
  980. cpp_quote(" SCHEMA_PROPERTY(offsetof(MESSAGEINFO, idMessage))")
  981. cpp_quote(" SCHEMA_PROPERTY(MSGCOL_LASTID)")
  982. cpp_quote(" SCHEMA_PROPERTY(g_rgMsgTblColumns)")
  983. cpp_quote(" SCHEMA_PROPERTY(&g_MsgTblPrimaryIndex)")
  984. cpp_quote(" SCHEMA_PROPERTY(&g_MsgSymbolTable)")
  985. cpp_quote("END_TABLE_SCHEMA")
  986. //------------------------------------------------------------------
  987. // Extern'ed Record Formats
  988. //------------------------------------------------------------------
  989. cpp_quote("extern const TABLESCHEMA g_MessageTableSchema;")
  990. cpp_quote("extern const TABLEINDEX g_WatchIgnoreIndex;")
  991. cpp_quote("extern const TABLEINDEX g_HttpUrlIndex;")
  992. //----------------------------------------------------------------------
  993. // COLUMN_ID
  994. //----------------------------------------------------------------------
  995. typedef enum tagCOLUMN_ID {
  996. COLUMN_TO = 0,
  997. COLUMN_FROM,
  998. COLUMN_SUBJECT,
  999. COLUMN_RECEIVED,
  1000. COLUMN_SENT,
  1001. COLUMN_SIZE,
  1002. COLUMN_FOLDER,
  1003. COLUMN_TOTAL,
  1004. COLUMN_UNREAD,
  1005. COLUMN_NEW,
  1006. COLUMN_DESCRIPTION,
  1007. COLUMN_LAST_UPDATED,
  1008. COLUMN_WASTED_SPACE,
  1009. COLUMN_ACCOUNT,
  1010. COLUMN_LINES,
  1011. COLUMN_PRIORITY,
  1012. COLUMN_ATTACHMENT,
  1013. COLUMN_SHOW,
  1014. COLUMN_DOWNLOAD,
  1015. COLUMN_NEWSGROUP,
  1016. COLUMN_FLAG,
  1017. COLUMN_SUBSCRIBE,
  1018. COLUMN_DOWNLOADMSG,
  1019. COLUMN_THREADSTATE,
  1020. COLUMN_MSGID,
  1021. COLUMN_MAX
  1022. } COLUMN_ID;
  1023. //------------------------------------------------------------------
  1024. // RESULTINFO
  1025. //------------------------------------------------------------------
  1026. typedef struct tagRESULTINFO {
  1027. HRESULT hrResult; // Result of Operation (S_OK means it succeeded)
  1028. MESSAGEID idMessage; // MessageId Of Affected Message
  1029. MESSAGEFLAGS dwFlags; // Flags of the message
  1030. } RESULTINFO, *LPRESULTINFO;
  1031. //------------------------------------------------------------------
  1032. // RESULTLIST
  1033. //------------------------------------------------------------------
  1034. typedef struct tagRESULTLIST {
  1035. DWORD cAllocated;
  1036. DWORD cMsgs;
  1037. DWORD cValid;
  1038. LPRESULTINFO prgResult;
  1039. } RESULTLIST, *LPRESULTLIST;
  1040. //----------------------------------------------------------------------
  1041. // MESSAGEIDLIST - A list of message ids (DWORDs)
  1042. //----------------------------------------------------------------------
  1043. typedef struct tagMESSAGEIDLIST {
  1044. DWORD cAllocated;
  1045. DWORD cMsgs;
  1046. LPMESSAGEID prgidMsg;
  1047. } MESSAGEIDLIST, *LPMESSAGEIDLIST;
  1048. //------------------------------------------------------------------
  1049. // FOLDERSORTINFO
  1050. //------------------------------------------------------------------
  1051. typedef struct tagFOLDERSORTINFO {
  1052. COLUMN_ID idColumn;
  1053. BOOL fAscending;
  1054. BOOL fThreaded;
  1055. BOOL fExpandAll;
  1056. RULEID ridFilter;
  1057. BOOL fShowDeleted;
  1058. BOOL fShowReplies;
  1059. } FOLDERSORTINFO, *LPFOLDERSORTINFO;
  1060. //------------------------------------------------------------------
  1061. // ADJUSTFLAGS
  1062. //------------------------------------------------------------------
  1063. typedef struct tagADJUSTFLAGS {
  1064. MESSAGEFLAGS dwRemove;
  1065. MESSAGEFLAGS dwAdd;
  1066. } ADJUSTFLAGS, *LPADJUSTFLAGS;
  1067. //------------------------------------------------------------------
  1068. // OPENMESSAGEFLAGS
  1069. //------------------------------------------------------------------
  1070. typedef DWORD OPENMESSAGEFLAGS;
  1071. cpp_quote("#define OPEN_MESSAGE_SECURE 0x00000001")
  1072. cpp_quote("#define OPEN_MESSAGE_CACHEDONLY 0x00000002")
  1073. //------------------------------------------------------------------
  1074. // SAVEMESSAGEFLAGS
  1075. //------------------------------------------------------------------
  1076. typedef DWORD SAVEMESSAGEFLAGS;
  1077. cpp_quote("#define SAVE_MESSAGE_GENID 0x00000001")
  1078. //------------------------------------------------------------------
  1079. // COPYMESSAGEFLAGS
  1080. //------------------------------------------------------------------
  1081. typedef DWORD COPYMESSAGEFLAGS;
  1082. cpp_quote("#define COPY_MESSAGE_MOVE 0x00000001")
  1083. //------------------------------------------------------------------
  1084. // DELETEMESSAGEFLAGS
  1085. //------------------------------------------------------------------
  1086. typedef DWORD DELETEMESSAGEFLAGS;
  1087. cpp_quote("#define DELETE_MESSAGE_NOTRASHCAN 0x00000001")
  1088. cpp_quote("#define DELETE_MESSAGE_UNDELETE 0x00000002 // IMAP-only, unmarks msg for deletion")
  1089. cpp_quote("#define DELETE_MESSAGE_NOPROMPT 0x00000004")
  1090. cpp_quote("#define DELETE_MESSAGE_MAYIGNORENOTRASH 0x00000008 // For HTTPMail. HTTPServer doesn't support NOTRASH yet")
  1091. cpp_quote("#define DELETE_MESSAGE_NOUIDLUPDATE 0x00000010")
  1092. //------------------------------------------------------------------
  1093. // SYNCFOLDERFLAGS
  1094. //------------------------------------------------------------------
  1095. typedef DWORD SYNCFOLDERFLAGS;
  1096. cpp_quote("#define SYNC_FOLDER_DEFAULT 0x00000000")
  1097. cpp_quote("#define SYNC_FOLDER_XXX_HEADERS 0x00000001")
  1098. cpp_quote("#define SYNC_FOLDER_NEW_HEADERS 0x00000002")
  1099. cpp_quote("#define SYNC_FOLDER_CACHED_HEADERS 0x00000004")
  1100. cpp_quote("#define SYNC_FOLDER_PURGE_DELETED 0x00000008")
  1101. cpp_quote("#define SYNC_FOLDER_ALLFLAGS 0x0000000F")
  1102. //------------------------------------------------------------------
  1103. // Methods
  1104. //------------------------------------------------------------------
  1105. HRESULT Initialize(
  1106. [in] IMessageStore *pStore,
  1107. [in] IMessageServer *pServer,
  1108. [in] OPENFOLDERFLAGS dwFlags,
  1109. [in] FOLDERID idFolder);
  1110. HRESULT SetOwner(
  1111. [in] IStoreCallback *pDefaultCallback);
  1112. HRESULT Close();
  1113. HRESULT GetFolderId(
  1114. [out] LPFOLDERID pidFolder);
  1115. HRESULT GetMessageFolderId(
  1116. [in] MESSAGEID idMessage,
  1117. [out] LPFOLDERID pidFolder);
  1118. HRESULT Synchronize(
  1119. [in] SYNCFOLDERFLAGS dwFlags,
  1120. [in] DWORD cHeaders,
  1121. [in] IStoreCallback *pCallback);
  1122. HRESULT OpenMessage(
  1123. [in] MESSAGEID idMessage,
  1124. [in] OPENMESSAGEFLAGS dwFlags,
  1125. [out] IMimeMessage **ppMessage,
  1126. [in] IStoreCallback *pCallback);
  1127. HRESULT SaveMessage(
  1128. [in,out] LPMESSAGEID pidMessage,
  1129. [in] SAVEMESSAGEFLAGS dwOptions,
  1130. [in] MESSAGEFLAGS dwFlags,
  1131. [in] IStream *pStream, // Efficient if this is a Stream Opened from IDatabase::CreateStream
  1132. [in] IMimeMessage *pMessage,
  1133. [in] IStoreCallback *pCallback);
  1134. HRESULT SetMessageStream(
  1135. [in] MESSAGEID idMessage,
  1136. [in] IStream *pStream);
  1137. HRESULT SetMessageFlags(
  1138. [in] LPMESSAGEIDLIST pList,
  1139. [in] LPADJUSTFLAGS pFlags,
  1140. [in,out] LPRESULTLIST pResults,
  1141. [in] IStoreCallback *pCallback);
  1142. HRESULT CopyMessages(
  1143. [in] IMessageFolder *pDest,
  1144. [in] COPYMESSAGEFLAGS dwFlags,
  1145. [in] LPMESSAGEIDLIST pList,
  1146. [in] LPADJUSTFLAGS pFlags,
  1147. [in,out] LPRESULTLIST pResults,
  1148. [in] IStoreCallback *pCallback);
  1149. HRESULT DeleteMessages(
  1150. [in] DELETEMESSAGEFLAGS dwFlags,
  1151. [in] LPMESSAGEIDLIST pList,
  1152. [in,out] LPRESULTLIST pResults,
  1153. [in] IStoreCallback *pCallback);
  1154. HRESULT ResetFolderCounts(
  1155. [in] DWORD cMessages,
  1156. [in] DWORD cUnread,
  1157. [in] DWORD cWatchedUnread,
  1158. [in] DWORD cWatched);
  1159. HRESULT IsWatched(
  1160. [in] LPCSTR pszReferences,
  1161. [in] LPCSTR pszSubject);
  1162. HRESULT GetDatabase(
  1163. [out] IDatabase **ppDB);
  1164. HRESULT ConnectionAddRef(void);
  1165. HRESULT ConnectionRelease(void);
  1166. HRESULT GetAdBarUrl(
  1167. [in] IStoreCallback *pCallback);
  1168. }
  1169. cpp_quote("#endif // __LPMESSAGEFOLDER_DEFINED")
  1170. //----------------------------------------------------------------------
  1171. // ITimeoutCallback
  1172. //----------------------------------------------------------------------
  1173. cpp_quote("#ifndef __LPTIMEOUTCALLBACK_DEFINED")
  1174. cpp_quote("#define __LPTIMEOUTCALLBACK_DEFINED")
  1175. [
  1176. object,
  1177. uuid(28B44B1D-07A9-11d2-9A63-00C04FA309D4),
  1178. pointer_default(unique)
  1179. ]
  1180. interface ITimeoutCallback : IUnknown
  1181. {
  1182. //------------------------------------------------------------------
  1183. // Pointer to an interface of this type
  1184. //------------------------------------------------------------------
  1185. typedef ITimeoutCallback *LPTIMEOUTCALLBACK;
  1186. //------------------------------------------------------------------
  1187. // TIMEOUTRESPONSE
  1188. //------------------------------------------------------------------
  1189. typedef enum tagTIMEOUTRESPONSE {
  1190. TIMEOUT_RESPONSE_STOP,
  1191. TIMEOUT_RESPONSE_WAIT
  1192. } TIMEOUTRESPONSE;
  1193. //------------------------------------------------------------------
  1194. // Methods
  1195. //------------------------------------------------------------------
  1196. HRESULT OnTimeoutResponse(
  1197. [in] TIMEOUTRESPONSE eResponse);
  1198. };
  1199. cpp_quote("#endif // __LPTIMEOUTCALLBACK_DEFINED")
  1200. //----------------------------------------------------------------------
  1201. // IOperationCancel
  1202. //----------------------------------------------------------------------
  1203. cpp_quote("#ifndef __LPOPERATIONCANCEL_DEFINED")
  1204. cpp_quote("#define __LPOPERATIONCANCEL_DEFINED")
  1205. [
  1206. object,
  1207. uuid(F4DA2F80-07A0-11d2-AAB3-006097D474C4),
  1208. pointer_default(unique)
  1209. ]
  1210. interface IOperationCancel : IUnknown
  1211. {
  1212. typedef enum tagCANCELTYPE {
  1213. CT_INVALID,
  1214. CT_ABORT,
  1215. CT_CANCEL
  1216. } CANCELTYPE;
  1217. //------------------------------------------------------------------
  1218. // Methods
  1219. //------------------------------------------------------------------
  1220. HRESULT Cancel(
  1221. [in] CANCELTYPE tyCancel);
  1222. }
  1223. cpp_quote("#endif // __LPOPERATIONCANCEL_DEFINED")
  1224. //----------------------------------------------------------------------
  1225. // IStoreCallback
  1226. //----------------------------------------------------------------------
  1227. cpp_quote("#ifndef __LPSTORECALLBACK_DEFINED")
  1228. cpp_quote("#define __LPSTORECALLBACK_DEFINED")
  1229. [
  1230. object,
  1231. uuid(CFAD2437-EC54-11d1-9A54-00C04FA309D4),
  1232. pointer_default(unique)
  1233. ]
  1234. interface IStoreCallback : IUnknown
  1235. {
  1236. //------------------------------------------------------------------
  1237. // Pointer to an interface of this type
  1238. //------------------------------------------------------------------
  1239. typedef IStoreCallback *LPSTORECALLBACK;
  1240. //------------------------------------------------------------------
  1241. // STOREOPERATION
  1242. //------------------------------------------------------------------
  1243. typedef enum tagSTOREOPERATIONTYPE
  1244. {
  1245. SOT_INVALID,
  1246. SOT_CONNECTION_STATUS, // Connect and logon to server. pszStatus = Server Name, dwCurrent = IXPSTATUS
  1247. SOT_SYNC_FOLDER, // Synchronizing fldr (new hdr DL/cached hdr upld). pszStatus = Folder Name
  1248. SOT_GET_MESSAGE, // Downloading message body into folder. pszStatus = NULL
  1249. SOT_PUT_MESSAGE, // Uploading message body into folder. pszStatus = dest Folder Name
  1250. SOT_COPYMOVE_MESSAGE, // Copying/moving msg. pszStatus = dest Folder Name
  1251. SOT_SYNCING_STORE, // Synchronizing folder list. pszStatus = Account Name, OnProgress is STEPPED (dwCurrent = 1, dwMax = 0)
  1252. SOT_CREATE_FOLDER, // Creating folder. pszStatus = New Folder Name
  1253. SOT_SEARCHING, // Searching the Store: pszStatus equals current folder name
  1254. SOT_DELETING_MESSAGES, // Deleting messages. pszStatus = NULL
  1255. SOT_SET_MESSAGEFLAGS, // Setting message flags pszStatus = NULL
  1256. SOT_MOVE_FOLDER,
  1257. SOT_DELETE_FOLDER,
  1258. SOT_RENAME_FOLDER,
  1259. SOT_SUBSCRIBE_FOLDER,
  1260. SOT_UPDATE_FOLDER,
  1261. SOT_SYNCING_DESCRIPTIONS,
  1262. SOT_GET_NEW_GROUPS,
  1263. SOT_NEW_MAIL_NOTIFICATION, // Notification of new mail arrival (returned via OnProgress only) pszStatus = NULL
  1264. SOT_PURGING_MESSAGES, // Purging messages (IMAP only at this point). pszStatus = NULL
  1265. SOT_GET_WATCH_INFO, // Searching for messages in watched threads
  1266. SOT_SORTING, // Sorting the folder pszStatus=NULL.
  1267. SOT_GET_ADURL, // Get the Ad URL from Hotmail
  1268. SOT_GET_HTTP_MINPOLLINGINTERVAL // Get the maximum polling interval
  1269. } STOREOPERATIONTYPE;
  1270. //------------------------------------------------------------------
  1271. // STOREERROR
  1272. //------------------------------------------------------------------
  1273. typedef struct tagSTOREERROR
  1274. {
  1275. HRESULT hrResult; // Error code (same val as hrComplete in OnComplete)
  1276. UINT uiServerError; // Server generated error number
  1277. HRESULT hrServerError; // Associated HRESULT of server error
  1278. DWORD dwSocketError; // Socket error as defined in winsock.h
  1279. LPSTR pszProblem; // Description of the problem
  1280. LPSTR pszDetails; // Last server response/detailed problem info
  1281. LPSTR pszAccount; // Friendly name for this account
  1282. LPSTR pszServer; // Name of the server we tried to connect to
  1283. LPSTR pszFolder; // Name of the folder/group
  1284. LPSTR pszUserName; // Plaintext name user tried to log in with
  1285. LPSTR pszProtocol; // Protocol in use
  1286. LPSTR pszConnectoid; // RAS connection name
  1287. RASCONNTYPE rasconntype; // RAS connection type
  1288. IXPTYPE ixpType; // Protocol in use (machine-identifiable)
  1289. DWORD dwPort; // Port number we tried to connect with
  1290. BOOL fSSL; // Is this an SSL secure connection?
  1291. BOOL fTrySicily; // Try using sicily authentication
  1292. DWORD dwFlags; // Various additional information
  1293. } STOREERROR, *LPSTOREERROR;
  1294. //------------------------------------------------------------------
  1295. // Constants
  1296. //------------------------------------------------------------------
  1297. cpp_quote("#define NOSTORECALLBACK NULL")
  1298. const DWORD SE_FLAG_FLUSHALL = 0x00000001; // Flush all pending operations: IMessageServer has disconnected
  1299. const DWORD CC_FLAG_DONTPROMPT = 0x00000001; // Do not prompt user during call to CanConnect
  1300. //------------------------------------------------------------------
  1301. // STOREOPERATIONINFO
  1302. //------------------------------------------------------------------
  1303. typedef struct tagSTOREOPERATIONINFO
  1304. {
  1305. DWORD cbSize;
  1306. MESSAGEID idMessage;
  1307. LPSTR pszUrl;
  1308. DWORD dwMinPollingInterval;
  1309. } STOREOPERATIONINFO, *LPSTOREOPERATIONINFO;
  1310. //------------------------------------------------------------------
  1311. // Methods
  1312. //------------------------------------------------------------------
  1313. HRESULT OnBegin(
  1314. [in] STOREOPERATIONTYPE tyOperation,
  1315. [in] LPSTOREOPERATIONINFO pOpInfo,
  1316. [in] IOperationCancel *pCancel);
  1317. HRESULT OnProgress(
  1318. [in] STOREOPERATIONTYPE tyOperation,
  1319. [in] DWORD dwCurrent,
  1320. [in] DWORD dwMax,
  1321. [in] LPCSTR pszStatus);
  1322. HRESULT OnTimeout(
  1323. [in] LPINETSERVER pServer,
  1324. [in,out] LPDWORD pdwTimeout,
  1325. [in] IXPTYPE ixpServerType);
  1326. HRESULT CanConnect(
  1327. [in] LPCSTR pszAccountId,
  1328. [in] DWORD dwFlags);
  1329. HRESULT OnLogonPrompt(
  1330. [in,out] LPINETSERVER pServer,
  1331. [in] IXPTYPE ixpServerType);
  1332. HRESULT OnComplete(
  1333. [in] STOREOPERATIONTYPE tyOperation,
  1334. [in] HRESULT hrComplete,
  1335. [in] LPSTOREOPERATIONINFO pOpInfo,
  1336. [in] LPSTOREERROR pErrorInfo);
  1337. HRESULT OnPrompt(
  1338. [in] HRESULT hrError,
  1339. [in] LPCTSTR pszText,
  1340. [in] LPCTSTR pszCaption,
  1341. [in] UINT uType,
  1342. [out] INT *piUserResponse);
  1343. HRESULT GetParentWindow(
  1344. [in] DWORD dwReserved,
  1345. [out] HWND *phwndParent);
  1346. }
  1347. cpp_quote("#endif // __LPSTORECALLBACK_DEFINED")
  1348. //----------------------------------------------------------------------
  1349. // IMessageServer
  1350. //----------------------------------------------------------------------
  1351. cpp_quote("#ifndef __LPMESSAGESERVER_DEFINED")
  1352. cpp_quote("#define __LPMESSAGESERVER_DEFINED")
  1353. [
  1354. object,
  1355. uuid(86847A47-EDAF-11d1-9A54-00C04FA309D4),
  1356. pointer_default(unique)
  1357. ]
  1358. interface IMessageServer : IUnknown
  1359. {
  1360. //------------------------------------------------------------------
  1361. // Pointer to an interface of this type
  1362. //------------------------------------------------------------------
  1363. typedef IMessageServer *LPMESSAGESERVER;
  1364. //------------------------------------------------------------------
  1365. // CLOSEFLAGS
  1366. //------------------------------------------------------------------
  1367. cpp_quote("#define MSGSVRF_DROP_CONNECTION 0x00000001")
  1368. cpp_quote("#define MSGSVRF_HANDS_OFF_SERVER 0x00000002")
  1369. //------------------------------------------------------------------
  1370. // Methods
  1371. //------------------------------------------------------------------
  1372. HRESULT Initialize(
  1373. [in] IMessageStore *pStore,
  1374. [in] FOLDERID idStoreRoot,
  1375. [in] IMessageFolder *pFolder,
  1376. [in] FOLDERID idFolder);
  1377. HRESULT ResetFolder(
  1378. [in] IMessageFolder *pFolder,
  1379. [in] FOLDERID idFolder);
  1380. HRESULT Close(
  1381. [in] DWORD dwFlags);
  1382. HRESULT SetIdleCallback(
  1383. [in] IStoreCallback *pDefaultCallback);
  1384. HRESULT SynchronizeFolder(
  1385. [in] SYNCFOLDERFLAGS dwFlags,
  1386. [in] DWORD cHeaders,
  1387. [in] IStoreCallback *pCallback);
  1388. HRESULT GetMessage(
  1389. [in] MESSAGEID idMessage,
  1390. [in] IStoreCallback *pCallback);
  1391. HRESULT PutMessage(
  1392. [in] FOLDERID idFolder,
  1393. [in] MESSAGEFLAGS dwFlags,
  1394. [in] LPFILETIME pftReceived,
  1395. [in] IStream *pStream,
  1396. [in] IStoreCallback *pCallback);
  1397. HRESULT CopyMessages(
  1398. [in] IMessageFolder *pDest,
  1399. [in] COPYMESSAGEFLAGS dwOptions,
  1400. [in] LPMESSAGEIDLIST pList,
  1401. [in] LPADJUSTFLAGS pFlags,
  1402. [in] IStoreCallback *pCallback);
  1403. HRESULT DeleteMessages(
  1404. [in] DELETEMESSAGEFLAGS dwOptions,
  1405. [in] LPMESSAGEIDLIST pList,
  1406. [in] IStoreCallback *pCallback);
  1407. HRESULT SetMessageFlags(
  1408. [in] LPMESSAGEIDLIST pList,
  1409. [in] LPADJUSTFLAGS pFlags,
  1410. [in] SETMESSAGEFLAGSFLAGS dwFlags,
  1411. [in] IStoreCallback *pCallback);
  1412. HRESULT GetServerMessageFlags(
  1413. [in,out] MESSAGEFLAGS *pFlags);
  1414. HRESULT SynchronizeStore(
  1415. [in] FOLDERID idParent,
  1416. [in] SYNCSTOREFLAGS dwFlags,
  1417. [in] IStoreCallback *pCallback);
  1418. HRESULT CreateFolder(
  1419. [in] FOLDERID idParent,
  1420. [in] SPECIALFOLDER tySpecial,
  1421. [in] LPCSTR pszName,
  1422. [in] FLDRFLAGS dwFlags,
  1423. [in] IStoreCallback *pCallback);
  1424. HRESULT MoveFolder(
  1425. [in] FOLDERID idFolder,
  1426. [in] FOLDERID idParentNew,
  1427. [in] IStoreCallback *pCallback);
  1428. HRESULT RenameFolder(
  1429. [in] FOLDERID idFolder,
  1430. [in] LPCSTR pszName,
  1431. [in] IStoreCallback *pCallback);
  1432. HRESULT DeleteFolder(
  1433. [in] FOLDERID idFolder,
  1434. [in] DELETEFOLDERFLAGS dwFlags,
  1435. [in] IStoreCallback *pCallback);
  1436. HRESULT SubscribeToFolder(
  1437. [in] FOLDERID idFolder,
  1438. [in] BOOL fSubscribe,
  1439. [in] IStoreCallback *pCallback);
  1440. HRESULT GetFolderCounts(
  1441. [in] FOLDERID idFolder,
  1442. [in] IStoreCallback *pCallback);
  1443. HRESULT GetNewGroups(
  1444. [in] LPSYSTEMTIME pSysTime,
  1445. [in] IStoreCallback *pCallback);
  1446. HRESULT ConnectionAddRef();
  1447. HRESULT ConnectionRelease();
  1448. HRESULT GetWatchedInfo(
  1449. [in] FOLDERID idFolder,
  1450. [in] IStoreCallback *pCallback);
  1451. HRESULT GetAdBarUrl(
  1452. [in] IStoreCallback *pCallback);
  1453. HRESULT GetMinPollingInterval(
  1454. [in] IStoreCallback *pCallback);
  1455. }
  1456. cpp_quote("#endif // __LPMESSAGESERVER_DEFINED")
  1457. //----------------------------------------------------------------------
  1458. // IIMAPStore
  1459. //----------------------------------------------------------------------
  1460. cpp_quote("#ifndef __LPIMAPSTORE_DEFINED")
  1461. cpp_quote("#define __LPIMAPSTORE_DEFINED")
  1462. [
  1463. object,
  1464. uuid(06AE7A01-6C5B-11d2-AD88-0080C7B6E3C5),
  1465. pointer_default(unique)
  1466. ]
  1467. interface IIMAPStore : IUnknown
  1468. {
  1469. //------------------------------------------------------------------
  1470. // Methods
  1471. //------------------------------------------------------------------
  1472. HRESULT ExpungeOnExit(void);
  1473. }
  1474. cpp_quote("#endif // __LPIMAPSTORE_DEFINED")
  1475. //----------------------------------------------------------------------
  1476. // INewsStore
  1477. //----------------------------------------------------------------------
  1478. cpp_quote("#ifndef __LPNEWSSTORE_DEFINED")
  1479. cpp_quote("#define __LPNEWSSTORE_DEFINED")
  1480. [
  1481. object,
  1482. uuid(522E4F81-2C98-11d2-AACA-006097D474C4),
  1483. pointer_default(unique)
  1484. ]
  1485. interface INewsStore : IUnknown
  1486. {
  1487. //------------------------------------------------------------------
  1488. // Methods
  1489. //------------------------------------------------------------------
  1490. HRESULT MarkCrossposts(
  1491. [in] LPMESSAGEIDLIST pList,
  1492. [in] BOOL fRead);
  1493. }
  1494. cpp_quote("#endif // __LPNEWSSTORE_DEFINED")
  1495. //----------------------------------------------------------------------
  1496. // IPop3UidlStore
  1497. //----------------------------------------------------------------------
  1498. cpp_quote("#ifndef __LPPOP3UIDLStore_DEFINED")
  1499. cpp_quote("#define __LPMESSAGEFOLDER_DEFINED")
  1500. [
  1501. object,
  1502. uuid(E883FC77-EC08-11d1-9A53-00C04FA309D4),
  1503. pointer_default(unique)
  1504. ]
  1505. interface IPop3UidlStore : IUnknown
  1506. {
  1507. //------------------------------------------------------------------
  1508. // Pointer to an interface of this type
  1509. //------------------------------------------------------------------
  1510. typedef IPop3UidlStore *LPPOP3UIDLSTORE;
  1511. //------------------------------------------------------------------
  1512. // POP3UIDL Database Version
  1513. //------------------------------------------------------------------
  1514. const DWORD POP3UIDL_DATABASE_VERSION = 5;
  1515. //------------------------------------------------------------------
  1516. // UIDL Store Record Ordinals
  1517. //------------------------------------------------------------------
  1518. typedef enum tagUIDLCOLID {
  1519. UIDLCOL_DLTIME,
  1520. UIDLCOL_DELETED,
  1521. UIDLCOL_DOWNLOADED,
  1522. UIDLCOL_UIDL,
  1523. UIDLCOL_SERVER,
  1524. UIDLCOL_ACCOUNTID,
  1525. UIDLCOL_LAST
  1526. } UIDLCOLID;
  1527. //------------------------------------------------------------------
  1528. // UIDLRECORD
  1529. //------------------------------------------------------------------
  1530. typedef struct tagUIDLRECORD {
  1531. BYTE *pAllocated;
  1532. BYTE bVersion;
  1533. BYTE fDownloaded;
  1534. BYTE fDeleted;
  1535. FILETIME ftDownload;
  1536. LPSTR pszUidl;
  1537. LPSTR pszServer;
  1538. LPSTR pszAccountId;
  1539. } UIDLRECORD, *LPUIDLRECORD;
  1540. //------------------------------------------------------------------
  1541. // UIDL Record Members
  1542. //------------------------------------------------------------------
  1543. cpp_quote("BEGIN_COLUMN_ARRAY(g_rgUidlTblColumns, UIDLCOL_LAST)")
  1544. cpp_quote(" DEFINE_COLUMN(UIDLCOL_DLTIME, CDT_FILETIME, UIDLRECORD, ftDownload)")
  1545. cpp_quote(" DEFINE_COLUMN(UIDLCOL_DELETED, CDT_BYTE, UIDLRECORD, fDeleted)")
  1546. cpp_quote(" DEFINE_COLUMN(UIDLCOL_DOWNLOADED, CDT_BYTE, UIDLRECORD, fDownloaded)")
  1547. cpp_quote(" DEFINE_COLUMN(UIDLCOL_UIDL, CDT_VARSTRA, UIDLRECORD, pszUidl)")
  1548. cpp_quote(" DEFINE_COLUMN(UIDLCOL_SERVER, CDT_VARSTRA, UIDLRECORD, pszServer)")
  1549. cpp_quote(" DEFINE_COLUMN(UIDLCOL_ACCOUNTID, CDT_VARSTRA, UIDLRECORD, pszAccountId)")
  1550. cpp_quote("END_COLUMN_ARRAY")
  1551. //------------------------------------------------------------------
  1552. // UIDL Table Primary Index Definition
  1553. //------------------------------------------------------------------
  1554. cpp_quote("BEGIN_TABLE_INDEX(g_UidlTblPrimaryIndex, 3)")
  1555. cpp_quote(" DEFINE_KEY(UIDLCOL_UIDL, COMPARE_ASANSI, 0)")
  1556. cpp_quote(" DEFINE_KEY(UIDLCOL_SERVER, COMPARE_ASANSI | COMPARE_IGNORECASE, 0)")
  1557. cpp_quote(" DEFINE_KEY(UIDLCOL_ACCOUNTID,COMPARE_ASANSI | COMPARE_IGNORECASE, 0)")
  1558. cpp_quote("END_TABLE_INDEX")
  1559. //------------------------------------------------------------------
  1560. // UIDL Record Format
  1561. //------------------------------------------------------------------
  1562. cpp_quote("BEGIN_TABLE_SCHEMA(g_UidlTableSchema, CLSID_Pop3UidlDatabase, UIDLRECORD)")
  1563. cpp_quote(" SCHEMA_PROPERTY(POP3UIDL_DATABASE_VERSION)")
  1564. cpp_quote(" SCHEMA_PROPERTY(TSF_RESETIFBADVERSION)")
  1565. cpp_quote(" SCHEMA_PROPERTY(0)")
  1566. cpp_quote(" SCHEMA_PROPERTY(0xffffffff)")
  1567. cpp_quote(" SCHEMA_PROPERTY(UIDLCOL_LAST)")
  1568. cpp_quote(" SCHEMA_PROPERTY(g_rgUidlTblColumns)")
  1569. cpp_quote(" SCHEMA_PROPERTY(&g_UidlTblPrimaryIndex)")
  1570. cpp_quote(" SCHEMA_PROPERTY(NULL)")
  1571. cpp_quote("END_TABLE_SCHEMA")
  1572. //------------------------------------------------------------------
  1573. // Extern'ed Record Formats
  1574. //------------------------------------------------------------------
  1575. cpp_quote("extern const TABLESCHEMA g_UidlTableSchema;")
  1576. }
  1577. cpp_quote("#endif // __LPPOP3UIDLSTORE_DEFINED")
  1578. //----------------------------------------------------------------------
  1579. // IMessageTable
  1580. //----------------------------------------------------------------------
  1581. cpp_quote("#ifndef __LPMESSAGETABLE_DEFINED")
  1582. cpp_quote("#define __LPMESSAGETABLE_DEFINED")
  1583. [
  1584. object,
  1585. uuid(B4B796AA-EC1C-11d1-9A54-00C04FA309D4),
  1586. pointer_default(unique)
  1587. ]
  1588. interface IMessageTable : IUnknown
  1589. {
  1590. //------------------------------------------------------------------
  1591. // Pointer to an interface of this type
  1592. //------------------------------------------------------------------
  1593. typedef IMessageTable *LPMESSAGETABLE;
  1594. //----------------------------------------------------------------------
  1595. // Types
  1596. //----------------------------------------------------------------------
  1597. typedef DWORD ROWINDEX;
  1598. typedef DWORD *LPROWINDEX;
  1599. //----------------------------------------------------------------------
  1600. // GETCOUNTTYPE
  1601. //----------------------------------------------------------------------
  1602. typedef enum tagGETCOUNTTYPE {
  1603. MESSAGE_COUNT_VISIBLE,
  1604. MESSAGE_COUNT_ALL,
  1605. MESSAGE_COUNT_FILTERED,
  1606. MESSAGE_COUNT_UNREAD,
  1607. MESSAGE_COUNT_NOTDOWNLOADED
  1608. } GETCOUNTTYPE;
  1609. //----------------------------------------------------------------------
  1610. // RELATIVEROWTYPE
  1611. //----------------------------------------------------------------------
  1612. typedef enum tagRELATIVEROWTYPE {
  1613. RELATIVE_ROW_PARENT,
  1614. RELATIVE_ROW_CHILD,
  1615. RELATIVE_ROW_ROOT
  1616. } RELATIVEROWTYPE;
  1617. //----------------------------------------------------------------------
  1618. // GETNEXTTYPE
  1619. //----------------------------------------------------------------------
  1620. typedef enum tagGETNEXTTYPE {
  1621. GETNEXT_NEXT,
  1622. GETNEXT_PREVIOUS
  1623. } GETNEXTTYPE;
  1624. //----------------------------------------------------------------------
  1625. // ROWMESSAGETYPE
  1626. //----------------------------------------------------------------------
  1627. typedef enum tagROWMESSAGETYPE {
  1628. ROWMSG_ALL,
  1629. ROWMSG_NEWS,
  1630. ROWMSG_MAIL
  1631. } ROWMESSAGETYPE;
  1632. //------------------------------------------------------------------
  1633. // MARK_TYPE
  1634. //------------------------------------------------------------------
  1635. typedef enum tagMARK_TYPE {
  1636. MARK_MESSAGE_READ = 0,
  1637. MARK_MESSAGE_UNREAD,
  1638. MARK_MESSAGE_DELETED,
  1639. MARK_MESSAGE_UNDELETED,
  1640. MARK_MESSAGE_DOWNLOAD,
  1641. MARK_MESSAGE_UNDOWNLOAD,
  1642. MARK_MESSAGE_FLAGGED,
  1643. MARK_MESSAGE_UNFLAGGED,
  1644. MARK_MESSAGE_FORWARDED,
  1645. MARK_MESSAGE_UNFORWARDED,
  1646. MARK_MESSAGE_REPLIED,
  1647. MARK_MESSAGE_UNREPLIED,
  1648. MARK_MESSAGE_SECUI,
  1649. MARK_MESSAGE_NOSECUI,
  1650. MARK_MESSAGE_WATCH,
  1651. MARK_MESSAGE_IGNORE,
  1652. MARK_MESSAGE_NORMALTHREAD,
  1653. MARK_MESSAGE_RCPT_PROCESSED,
  1654. MARK_MAX
  1655. } MARK_TYPE;
  1656. //----------------------------------------------------------------------
  1657. // APPLYCHILDRENTYPE
  1658. //----------------------------------------------------------------------
  1659. typedef enum tagAPPLYCHILDRENTYPE {
  1660. APPLY_SPECIFIED, // apply only to the set of row index specified (won't recurse into children)
  1661. APPLY_CHILDREN, // apply to all specified rows and all the children of the specified rows
  1662. APPLY_COLLAPSED // apply to all specified rows and the children of any collapsed threads
  1663. } APPLYCHILDRENTYPE;
  1664. //----------------------------------------------------------------------
  1665. // GETNEXTFLAGS
  1666. //----------------------------------------------------------------------
  1667. typedef DWORD GETNEXTFLAGS;
  1668. cpp_quote("#define GETNEXT_UNREAD 0x00000001")
  1669. cpp_quote("#define GETNEXT_THREAD 0x00000002")
  1670. //----------------------------------------------------------------------
  1671. // ROWSTATE
  1672. //----------------------------------------------------------------------
  1673. typedef DWORD ROWSTATE;
  1674. cpp_quote("#define ROW_STATE_READ 0x00000001")
  1675. cpp_quote("#define ROW_STATE_DELETED 0x00000002")
  1676. cpp_quote("#define ROW_STATE_HAS_CHILDREN 0x00000004")
  1677. cpp_quote("#define ROW_STATE_EXPANDED 0x00000008")
  1678. cpp_quote("#define ROW_STATE_HAS_BODY 0x00000010")
  1679. cpp_quote("#define ROW_STATE_MARKED_DOWNLOAD 0x00000020")
  1680. cpp_quote("#define ROW_STATE_FLAGGED 0x00000040")
  1681. cpp_quote("#define ROW_STATE_WATCHED 0x00000080")
  1682. cpp_quote("#define ROW_STATE_IGNORED 0x00000100")
  1683. cpp_quote("#define ROW_STATE_VALID 0x00000200")
  1684. //----------------------------------------------------------------------
  1685. // SELECTIONSTATE
  1686. //----------------------------------------------------------------------
  1687. typedef DWORD SELECTIONSTATE;
  1688. cpp_quote("#define SELECTION_STATE_DELETABLE 0x00000200")
  1689. //----------------------------------------------------------------------
  1690. // FINDINFO Masks
  1691. //----------------------------------------------------------------------
  1692. cpp_quote("#define FIM_FROM 0x00000001")
  1693. cpp_quote("#define FIM_SUBJECT 0x00000002")
  1694. cpp_quote("#define FIM_TO 0x00000004")
  1695. cpp_quote("#define FIM_DATEFROM 0x00000008")
  1696. cpp_quote("#define FIM_DATETO 0x00000010")
  1697. cpp_quote("#define FIM_BODYTEXT 0x00000020")
  1698. cpp_quote("#define FIM_ATTACHMENT 0x00000040")
  1699. cpp_quote("#define FIM_FLAGGED 0x00000080")
  1700. cpp_quote("#define FIM_FORWARDED 0x00000100")
  1701. cpp_quote("#define FIM_REPLIED 0x00000200")
  1702. //----------------------------------------------------------------------
  1703. // FINDINFO
  1704. //----------------------------------------------------------------------
  1705. typedef struct tagFINDINFO {
  1706. DWORD cbSize;
  1707. ULONG mask;
  1708. LPSTR pszFrom;
  1709. LPSTR pszTo;
  1710. LPSTR pszSubject;
  1711. LPSTR pszBody;
  1712. FILETIME ftDateFrom;
  1713. FILETIME ftDateTo;
  1714. BOOL fSubFolders;
  1715. } FINDINFO, *LPFINDINFO;
  1716. //----------------------------------------------------------------------
  1717. // FINDNEXTFLAGS
  1718. //----------------------------------------------------------------------
  1719. typedef enum tagFINDNEXTFLAGS {
  1720. FINDNEXT_TYPEAHEAD = 0,
  1721. FINDNEXT_ALLCOLUMNS,
  1722. FINDNEXT_MAX
  1723. } FINDNEXTFLAGS;
  1724. //----------------------------------------------------------------------
  1725. // IMessageTable Methods
  1726. //----------------------------------------------------------------------
  1727. HRESULT Initialize(
  1728. [in] FOLDERID idFolder,
  1729. [in] IMessageServer *pServer,
  1730. [in] BOOL fFind,
  1731. [in] IStoreCallback *pCallback);
  1732. HRESULT StartFind(
  1733. [in] LPFINDINFO pCriteria,
  1734. [in] IStoreCallback *pCallback);
  1735. HRESULT SetOwner(
  1736. [in] IStoreCallback *pDefaultCallback);
  1737. HRESULT Close();
  1738. HRESULT Synchronize(
  1739. [in] SYNCFOLDERFLAGS dwFlags,
  1740. [in] DWORD cHeaders,
  1741. [in] IStoreCallback *pCallback);
  1742. HRESULT GetCount(
  1743. [in] GETCOUNTTYPE tyCount,
  1744. [out] DWORD *pdwCount);
  1745. HRESULT GetRow(
  1746. [in] ROWINDEX iRow,
  1747. [out] LPMESSAGEINFO *ppInfo);
  1748. HRESULT ReleaseRow(
  1749. [in,out] LPMESSAGEINFO pInfo);
  1750. HRESULT GetIndentLevel(
  1751. [in] ROWINDEX iRow,
  1752. [out] LPDWORD pcIndent);
  1753. HRESULT Mark(
  1754. [in] LPROWINDEX rgiRow,
  1755. [in] DWORD cRows,
  1756. [in] APPLYCHILDRENTYPE tyApply,
  1757. [in] MARK_TYPE mark,
  1758. [in] IStoreCallback *pCallback);
  1759. HRESULT GetSortInfo(
  1760. [out] LPFOLDERSORTINFO pSortInfo);
  1761. HRESULT OnSynchronizeComplete(void);
  1762. HRESULT SetSortInfo(
  1763. [in] LPFOLDERSORTINFO pSortInfo,
  1764. [in] IStoreCallback *pCallback);
  1765. HRESULT GetLanguage(
  1766. [in] ROWINDEX iRow,
  1767. [out] LPDWORD pdwCodePage);
  1768. HRESULT SetLanguage(
  1769. [in] DWORD cRows,
  1770. [in] LPROWINDEX prgiRow,
  1771. [in] DWORD dwCodePage);
  1772. HRESULT GetNextRow(
  1773. [in] ROWINDEX iCurrentRow,
  1774. [in] GETNEXTTYPE tyDirection,
  1775. [in] ROWMESSAGETYPE tyMessage,
  1776. [in] GETNEXTFLAGS dwFlags,
  1777. [out] LPROWINDEX piNewRow);
  1778. HRESULT GetRelativeRow(
  1779. [in] ROWINDEX iRow,
  1780. [in] RELATIVEROWTYPE tyRelative,
  1781. [out] LPROWINDEX piRelative);
  1782. HRESULT GetRowState(
  1783. [in] ROWINDEX iRow,
  1784. [in] ROWSTATE dwStateMask,
  1785. [out] ROWSTATE *pdwState);
  1786. HRESULT GetSelectionState(
  1787. [in] DWORD cRows,
  1788. [in] LPROWINDEX prgiRow,
  1789. [in] SELECTIONSTATE dwMask,
  1790. [in] BOOL fIncludeChildren,
  1791. [out] SELECTIONSTATE *pdwState);
  1792. HRESULT Expand(
  1793. [in] ROWINDEX iRow);
  1794. HRESULT Collapse(
  1795. [in] ROWINDEX iRow);
  1796. HRESULT OpenMessage(
  1797. [in] ROWINDEX iRow,
  1798. [in] OPENMESSAGEFLAGS dwFlags,
  1799. [in] IMimeMessage **ppMessage,
  1800. [in] IStoreCallback *pCallback);
  1801. HRESULT GetRowMessageId(
  1802. [in] ROWINDEX iRow,
  1803. [out] LPMESSAGEID pidMessage);
  1804. HRESULT GetRowIndex(
  1805. [in] MESSAGEID idMessage,
  1806. [out] LPROWINDEX piRow);
  1807. HRESULT DeleteRows(
  1808. [in] DELETEMESSAGEFLAGS dwFlags,
  1809. [in] DWORD cRows,
  1810. [in] LPROWINDEX prgiRow,
  1811. [in] BOOL fIncludeChildren,
  1812. [in] IStoreCallback *pCallback);
  1813. HRESULT CopyRows(
  1814. [in] FOLDERID idFolder,
  1815. [in] COPYMESSAGEFLAGS dwOptions,
  1816. [in] DWORD cRows,
  1817. [in] LPROWINDEX prgiRow,
  1818. [in] LPADJUSTFLAGS pFlags,
  1819. [in] IStoreCallback *pCallback);
  1820. HRESULT RegisterNotify(
  1821. [in] REGISTERNOTIFYFLAGS dwFlags,
  1822. [in] IMessageTableNotify *pNotify);
  1823. HRESULT UnregisterNotify(
  1824. [in] IMessageTableNotify *pNotify);
  1825. HRESULT FindNextRow(
  1826. [in] ROWINDEX iStartRow,
  1827. [in] LPCTSTR pszFindString,
  1828. [in] FINDNEXTFLAGS dwFlags,
  1829. [in] BOOL fIncludeBody,
  1830. [out] ROWINDEX *piNextRow,
  1831. [out] BOOL *pfWrapped);
  1832. HRESULT GetRowFolderId(
  1833. [in] ROWINDEX iRow,
  1834. [out] LPFOLDERID pidFolder);
  1835. HRESULT GetMessageIdList(
  1836. [in] BOOL fRootsOnly,
  1837. [in] DWORD cRows,
  1838. [in] LPROWINDEX prgiRow,
  1839. [out] LPMESSAGEIDLIST pIdList);
  1840. HRESULT ConnectionAddRef(void);
  1841. HRESULT ConnectionRelease(void);
  1842. HRESULT IsChild(
  1843. [in] ROWINDEX iRowParent,
  1844. [in] ROWINDEX iRowChild);
  1845. HRESULT GetAdBarUrl(IStoreCallback *pCallback);
  1846. };
  1847. cpp_quote("#endif // __LPMESSAGETABLE_DEFINED")
  1848. //----------------------------------------------------------------------
  1849. // IMessageTableNotify
  1850. //----------------------------------------------------------------------
  1851. cpp_quote("#ifndef __LPMESSAGETABLENOTIFY_DEFINED")
  1852. cpp_quote("#define __LPMESSAGETABLENOTIFY_DEFINED")
  1853. [
  1854. object,
  1855. uuid(816C1167-F649-11d1-9A57-00C04FA309D4),
  1856. pointer_default(unique)
  1857. ]
  1858. interface IMessageTableNotify : IUnknown
  1859. {
  1860. //------------------------------------------------------------------
  1861. // Pointer to an interface of this type
  1862. //------------------------------------------------------------------
  1863. typedef IMessageTableNotify *LPMESSAGETABLENOTIFY;
  1864. //------------------------------------------------------------------
  1865. // Methods
  1866. //------------------------------------------------------------------
  1867. HRESULT OnInsertRows(
  1868. [in] DWORD cRows,
  1869. [in] LPROWINDEX prgiRow,
  1870. [in] BOOL fExpanded);
  1871. HRESULT OnDeleteRows(
  1872. [in] DWORD cRows,
  1873. [in] LPROWINDEX prgiRow,
  1874. [in] BOOL fCollapsed);
  1875. HRESULT OnUpdateRows(
  1876. [in] ROWINDEX iRowMin,
  1877. [in] ROWINDEX iRowMax);
  1878. HRESULT OnRedrawState(
  1879. [in] BOOL fRedraw);
  1880. HRESULT OnResetView(void);
  1881. }
  1882. cpp_quote("#endif // __LPMESSAGETABLENOTIFY_DEFINED")
  1883. //----------------------------------------------------------------------
  1884. // IStoreNamespace - Used by Outlook 9 and MS-Phone
  1885. //----------------------------------------------------------------------
  1886. cpp_quote("#ifdef OE5_BETA2")
  1887. cpp_quote("#ifndef __LPSTORENAMESPACE_DEFINED")
  1888. cpp_quote("#define __LPSTORENAMESPACE_DEFINED")
  1889. [
  1890. object,
  1891. uuid(E70C92AA-4BFD-11d1-8A95-00C04FB951F3),
  1892. pointer_default(unique)
  1893. ]
  1894. interface IStoreNamespace : IUnknown
  1895. {
  1896. //----------------------------------------------------------------------
  1897. // Pointer to an Object of this type
  1898. //----------------------------------------------------------------------
  1899. typedef IStoreNamespace *LPSTORENAMESPACE;
  1900. //----------------------------------------------------------------------
  1901. // Some Special MESSAGEID values
  1902. //----------------------------------------------------------------------
  1903. const MESSAGEID MESSAGEID_FIRST = -1;
  1904. //----------------------------------------------------------------------
  1905. // HENUMSTORE
  1906. //--------------------------------------------------------------------------
  1907. DECLARE_HANDLE(HENUMSTORE);
  1908. typedef HENUMSTORE *LPHENUMSTORE;
  1909. //----------------------------------------------------------------------
  1910. // Notification Messages
  1911. //----------------------------------------------------------------------
  1912. cpp_quote("#define WM_FOLDERNOTIFY (WM_USER + 1600) // IStoreNamespace Notification - lparam=LPFOLDERNOTIFYEX, client must call CoTaskMemFree(lParam)")
  1913. cpp_quote("#define WM_NEWMSGS (WM_USER + 1650) // IStoreFolder Notification: wParam=MESSAGEID, lParam=Reserved (No need to free anything)")
  1914. cpp_quote("#define WM_DELETEMSGS (WM_USER + 1651) // IStoreFolder Notification: wParam=prgdwMsgId, lParam=cMsgs (You must CoTaskMemFree(prgdwMsgId)")
  1915. cpp_quote("#define WM_DELETEFOLDER (WM_USER + 1652) // IStoreFolder Notification: wParam=FOLDERID or HFOLDER (No need to free anything)")
  1916. // If wParam is equal to 0xffffffff then that means that all messages in the folder
  1917. // were either marked as read (WM_MARKEDASREAD) or unread (WM_MARKEDASUNREAD)
  1918. cpp_quote("#define WM_MARKEDASREAD (WM_USER + 1653) // IStoreFolder Notification: wParamprgdwMsgId, lParam=cMsgs (No need to free anything)")
  1919. cpp_quote("#define WM_MARKEDASUNREAD (WM_USER + 1654) // IStoreFolder Notification: wParamprgdwMsgId, lParam=cMsgs (No need to free anything)")
  1920. //----------------------------------------------------------------------
  1921. // FOLDERNOTIFYTYPE
  1922. //----------------------------------------------------------------------
  1923. typedef enum tagFOLDERNOTIFYTYPE {
  1924. NEW_FOLDER = 1,
  1925. DELETE_FOLDER,
  1926. RENAME_FOLDER,
  1927. MOVE_FOLDER,
  1928. UNREAD_CHANGE,
  1929. IMAPFLAG_CHANGE,
  1930. UPDATEFLAG_CHANGE,
  1931. FOLDER_PROPS_CHANGED
  1932. } FOLDERNOTIFYTYPE;
  1933. //----------------------------------------------------------------------
  1934. // FOLDERNOTIFYEX
  1935. //----------------------------------------------------------------------
  1936. typedef struct tagFOLDERNOTIFYEX {
  1937. FOLDERNOTIFYTYPE type;
  1938. FOLDERID idFolderOld; // not used for CREATEFOLDER and DELETEFOLDER
  1939. FOLDERID idFolderNew;
  1940. } FOLDERNOTIFYEX, *LPFOLDERNOTIFYEX;
  1941. //----------------------------------------------------------------------
  1942. // FOLDERPROPS - Properties of a folder
  1943. //----------------------------------------------------------------------
  1944. typedef struct tagFOLDERPROPS {
  1945. DWORD cbSize; // Size of this structure
  1946. FOLDERID dwFolderId; // Handle of this folder
  1947. INT cSubFolders; // Number of sub-folders
  1948. LONG sfType; // Special folder type
  1949. DWORD cUnread; // Number of un-read messages
  1950. DWORD cMessage; // Total # of messages
  1951. CHAR szName[256]; // The Folder Name
  1952. } FOLDERPROPS, *LPFOLDERPROPS;
  1953. //----------------------------------------------------------------------
  1954. // IMessageTable Methods
  1955. //----------------------------------------------------------------------
  1956. cpp_quote("#define NAMESPACE_INITIALIZE_CURRENTIDENTITY 0x00000001")
  1957. HRESULT Initialize( // Initialize the object
  1958. [in] HWND hwndOwner, // Window owner for things like compaction dialog
  1959. [in] DWORD dwFlags); // Reserved for future use
  1960. HRESULT GetDirectory( // Get the location of the store (filepath)
  1961. [in,out,size_is(cchMaxPath)] LPSTR pszPath, // Buffer to put path of store into
  1962. [in] DWORD cchMaxPath); // in: byte count size of pszPath, out: char count size of pszPath
  1963. HRESULT OpenSpecialFolder(
  1964. [in] LONG sfType, // Special folder type
  1965. [in] DWORD dwReserved, // Reserved for future use
  1966. [out] IStoreFolder **ppFolder); // Pointer to an IStoreFolder
  1967. HRESULT OpenFolder(
  1968. [in] FOLDERID dwFolderId, // Folder to open
  1969. [in] DWORD dwReserved, // Reserved for future use
  1970. [out] IStoreFolder **ppFolder); // Pointer to an IStoreFolder
  1971. HRESULT CreateFolder(
  1972. [in] FOLDERID dwParentId, // Parent of the new folder, can use FOLDERID_ROOT
  1973. [in] LPCSTR pszName, // Name of new folder, must be less than MAX_FOLDER_NAME
  1974. [in] DWORD dwReserved, // Reserved for future use
  1975. [out] LPFOLDERID pdwFolderId); // Handle to the new folder
  1976. HRESULT RenameFolder(
  1977. [in] FOLDERID dwFolderId, // Folder to rename
  1978. [in] DWORD dwReserved, // Reserved for future use
  1979. [in] LPCSTR pszNewName); // New folder name, must be less than MAX_FOLDER_NAME
  1980. HRESULT MoveFolder(
  1981. [in] FOLDERID dwFolderId, // Folder to move
  1982. [in] FOLDERID dwParentId, // FolderId of the new Parent
  1983. [in] DWORD dwReserved); // Reserved for future use
  1984. HRESULT DeleteFolder(
  1985. [in] FOLDERID dwFolderId, // Folder to delete
  1986. [in] DWORD dwReserved); // Reserved for future use
  1987. HRESULT GetFolderProps(
  1988. [in] FOLDERID dwFolderId, // FolderId to get info for
  1989. [in] DWORD dwReserved, // Reserved for future use
  1990. [in,out] LPFOLDERPROPS pProps); // in: set cbSize, out: Holds folder information
  1991. HRESULT CopyMoveMessages(
  1992. [in] IStoreFolder *pSource, // Source store folder
  1993. [in] IStoreFolder *pDest, // Destination Store Folder
  1994. [in] LPMESSAGEIDLIST pMsgIdList, // List of MESSAGEIDs to move/copy
  1995. [in] COPYMESSAGEFLAGS dwFlags, // CMF_xxx Flags
  1996. [in] DWORD dwFlagsRemove, // MSG_xxx Flags to remove from copied/moved messages
  1997. [in] IProgressNotify *pProgress); // Store progress callback (client implements)
  1998. HRESULT RegisterNotification(
  1999. [in] DWORD dwReserved, // Reserved for future use
  2000. [in] HWND hwnd); // Handle to window to send notifications
  2001. HRESULT UnregisterNotification(
  2002. [in] DWORD dwReserved, // Reserved for future use
  2003. [in] HWND hwnd); // Handle to window to un-register for notifications
  2004. HRESULT CompactAll( // Compacts all folders in the store
  2005. [in] DWORD dwReserved); // Reserved for future use
  2006. HRESULT GetFirstSubFolder( // Enumerate sub folders
  2007. [in] FOLDERID dwFolderId, // Pass FOLDERID_ROOT to enum root folders
  2008. [in,out] LPFOLDERPROPS pProps, // If function succeeds, contents are valid
  2009. [out] LPHENUMSTORE phEnum); // Use in call to GetNextSubFolder, and then GetSubFolderClose
  2010. HRESULT GetNextSubFolder( // Get the next subfolder, returns S_FALSE if no more folders
  2011. [in] HENUMSTORE hEnum, // Handle received from GetFirstSubFolder
  2012. [in,out] LPFOLDERPROPS pProps); // If function returns S_OK, contains folder properties
  2013. HRESULT GetSubFolderClose( // Closes the handle associated with a folder enumeration
  2014. [in] HENUMSTORE hEnum); // Handle received from GetFirstSubFolder
  2015. }
  2016. cpp_quote("#endif // __LPSTORENAMESPACE_DEFINED")
  2017. cpp_quote("#endif // OE5_BETA2")
  2018. //----------------------------------------------------------------------
  2019. // IStoreFolder - Used by Outlook 9 and MS-Phone
  2020. //----------------------------------------------------------------------
  2021. cpp_quote("#ifdef OE5_BETA2")
  2022. cpp_quote("#ifndef __LPSTOREFOLDER_DEFINED")
  2023. cpp_quote("#define __LPSTOREFOLDER_DEFINED")
  2024. [
  2025. object,
  2026. uuid(E70C92AC-4BFD-11d1-8A95-00C04FB951F3),
  2027. pointer_default(unique)
  2028. ]
  2029. interface IStoreFolder : IUnknown
  2030. {
  2031. //----------------------------------------------------------------------
  2032. // Pointer to an Object of this type
  2033. //----------------------------------------------------------------------
  2034. typedef IStoreFolder *LPSTOREFOLDER;
  2035. //----------------------------------------------------------------------
  2036. // Message State Flags used in MESSAGEINFO::dwState
  2037. //----------------------------------------------------------------------
  2038. cpp_quote("#define MSG_DELETED 0x0001 // The message has been deleted, compaction will remove it")
  2039. cpp_quote("#define MSG_UNREAD 0x0002 // The message is marked as un-read")
  2040. cpp_quote("#define MSG_SUBMITTED 0x0004 // For messages waiting to be sent: OUTBOX ONLY")
  2041. cpp_quote("#define MSG_UNSENT 0x0008 // For msgs-in-progress saved to a folder")
  2042. cpp_quote("#define MSG_RECEIVED 0x0010 // For messages that came from a server")
  2043. cpp_quote("#define MSG_NEWSMSG 0x0020 // For news messages")
  2044. cpp_quote("#define MSG_NOSECUI 0x0040 // For messages where the user wants to die")
  2045. cpp_quote("#define MSG_VOICEMAIL 0x0080 // The message has the X-Voicemail header set...")
  2046. cpp_quote("#define MSG_REPLIED 0x0100 // The message has been replied to")
  2047. cpp_quote("#define MSG_FORWARDED 0x0200 // The message has been forwarded to")
  2048. cpp_quote("#define MSG_RCPTSENT 0x0400 // S/MIME Receipt has been sent")
  2049. cpp_quote("#define MSG_FLAGGED 0x0800 // The message is currently flags")
  2050. cpp_quote("#define MSG_LAST 0x0200 // ** Keep this puppy updated!! **")
  2051. cpp_quote("#define MSG_EXTERNAL_FLAGS 0x00fe")
  2052. cpp_quote("#define MSG_FLAGS 0x000f")
  2053. //----------------------------------------------------------------------
  2054. // MESSAGEPROPS
  2055. //----------------------------------------------------------------------
  2056. typedef struct tagMESSAGEPROPS {
  2057. DWORD cbSize; // Size of this structure
  2058. DWORD_PTR dwReserved; // Reserved don't use
  2059. MESSAGEID dwMessageId; // Handle to this message
  2060. DWORD dwLanguage; // Codepage of this message
  2061. DWORD dwState; // MSG_xxx Flags
  2062. // Things you don't get when MSGPROPS_FAST
  2063. DWORD cbMessage; // Size of the message
  2064. IMSGPRIORITY priority; // Message Priority
  2065. FILETIME ftReceived; // When the message was received
  2066. FILETIME ftSent; // When the message was sent
  2067. LPSTR pszSubject; // The subject of the message
  2068. LPSTR pszDisplayTo; // The display to line of the message
  2069. LPSTR pszDisplayFrom; // The display from line of the message
  2070. LPSTR pszNormalSubject; // The normalized subject of the message
  2071. DWORD dwFlags; // IMF_xxx Flags defined in mimeole.idl
  2072. IStream *pStmOffsetTable; // Use with IMimeMessage::LoadOffsetTable
  2073. } MESSAGEPROPS, *LPMESSAGEPROPS;
  2074. //----------------------------------------------------------------------
  2075. // HBATCHLOCK
  2076. //----------------------------------------------------------------------
  2077. DECLARE_HANDLE(HBATCHLOCK);
  2078. typedef HBATCHLOCK *LPHBATCHLOCK;
  2079. //----------------------------------------------------------------------
  2080. // Method
  2081. //----------------------------------------------------------------------
  2082. HRESULT GetFolderProps( // Get folder info for this folder
  2083. [in] DWORD dwReserved, // Reserved for future use
  2084. [in,out] LPFOLDERPROPS pProps); // in: set cbSize, out: contains folder information
  2085. cpp_quote("#define MSGPROPS_FAST 0x00000001 // See MESSAGEPROPS structure, improved performance")
  2086. HRESULT GetMessageProps(
  2087. [in] MESSAGEID dwMessageId, // Message Identifier
  2088. [in] DWORD dwFlags, // GETMSGINFO_xxx Flags
  2089. [in,out] LPMESSAGEPROPS pProps); // Message Info - set cbSize before calling
  2090. HRESULT FreeMessageProps( // Handles the case where pMsgInfo->dwMask has MIP_BYREF
  2091. [in,out] LPMESSAGEPROPS pProps); // Pointer to MESSAGEINFO structure to free
  2092. HRESULT DeleteMessages(
  2093. [in] LPMESSAGEIDLIST pMsgIdList, // List of HMESSAGEs
  2094. [in] DWORD dwReserved, // Reserved for future use
  2095. [in] IProgressNotify *pProgress); // Progress information
  2096. HRESULT SetLanguage(
  2097. [in] DWORD dwLanguage, // MLANG Codepage ID of message
  2098. [in] DWORD dwReserved, // Reserved for future use
  2099. [in] LPMESSAGEIDLIST pMsgIdList); // List of HMESSAGEs to apply new language to
  2100. HRESULT MarkMessagesAsRead(
  2101. [in] BOOL fRead, // Mark as Read or Unread
  2102. [in] DWORD dwReserved, // Reserved for future use
  2103. [in] LPMESSAGEIDLIST pMsgIdList); // List of HMESSAGEs to mark as (un)read
  2104. HRESULT SetFlags( // Modify the flags of a message
  2105. [in] LPMESSAGEIDLIST pMsgIdList, // Array of messages to modify flags for
  2106. [in] DWORD dwState, // MSG_xxx Flags to set on pMsgIdList
  2107. [in] DWORD dwStatemask, // ?????
  2108. [out] LPDWORD prgdwNewFlags); // Array of new message state flags that match pMsgIdList array
  2109. HRESULT OpenMessage( // Open a message (get a stream or a message object)
  2110. [in] MESSAGEID dwMessageId, // Handle to the message to open
  2111. [in] REFIID riid, // IID_IStream or IID_IMimeMessage stream is readonly
  2112. [out,iid_is(riid)] LPVOID *ppvObject); // The object, you must ->Release it
  2113. HRESULT SaveMessage( // Add a new entry to a folder.
  2114. [in] REFIID riid, // IID_IStream or IID_IMimeMessage
  2115. [in,iid_is(riid)] LPVOID pvObject, // Pointer to a stream or mime message
  2116. [in] DWORD dwMsgFlags, // MSG_xxx Flags
  2117. [out] LPMESSAGEID pdwMessageId); // Handle to the new message
  2118. HRESULT BatchLock( // Lock to prepare for a batch operation
  2119. [in] DWORD dwReserved, // Reserved for future use
  2120. [out] LPHBATCHLOCK phBatchLock); // Handle to newly created lock
  2121. HRESULT BatchFlush( // Flush the current batch operation
  2122. [in] DWORD dwReserved, // Reserved for future use
  2123. [in] HBATCHLOCK hBatchLock); // Folder lock obtained from BatchLock
  2124. HRESULT BatchUnlock( // Unlocks a batched operation
  2125. [in] DWORD dwReserved, // Reserved for future use
  2126. [in] HBATCHLOCK hBatchLock); // Handle to lock obtained from BatchLock
  2127. HRESULT CreateStream( // Create a new stream in a folder
  2128. [in] HBATCHLOCK hBatchLock, // Handle to a folder lock, optional if doing a one-of
  2129. [in] DWORD dwReserved, // Reserved for future use
  2130. [out] IStream **ppStream, // Pointer to new stream can be used for read/write
  2131. [out] LPMESSAGEID pdwMessageId); // Handle to the new message
  2132. cpp_quote("#define COMMITSTREAM_REVERT 0x00000001 // Don't add this stream/message to the folder")
  2133. HRESULT CommitStream( // Commit/Revert a stream created with CreateStream
  2134. [in] HBATCHLOCK hBatchLock, // Folder lock obtained from BatchLock
  2135. [in] DWORD dwFlags, // COMMITSTREAM_xxx Flags
  2136. [in] DWORD dwMsgFlags, // MSG_xxx Flags
  2137. [in] IStream *pStream, // Stream obtained from CreateStream
  2138. [in] MESSAGEID dwMessageId, // dwMessageId obtained from CreateStream
  2139. [in] IMimeMessage *pMessage); // Message to commit, if not passed in, pStream will be pared.
  2140. HRESULT RegisterNotification(
  2141. [in] DWORD dwReserved, // Reserved for future use
  2142. [in] HWND hwnd); // Handle to window to send notifications
  2143. HRESULT UnregisterNotification(
  2144. [in] DWORD dwReserved, // Reserved for future use
  2145. [in] HWND hwnd); // Handle to window to un-register for notifications
  2146. HRESULT Compact( // Compacts this folder
  2147. [in] DWORD dwReserved); // Reserved for future use
  2148. HRESULT GetFirstMessage( // Get the first message in a folder
  2149. [in] DWORD dwFlags, // MSGPROPS_xxx Flags
  2150. [in] DWORD dwMsgFlags, // MSG_xxx Flags to enumerate on, pass 0 for none
  2151. [in] MESSAGEID dwMsgIdFirst, // MessageId to start enumerating at, Use MESSAGEID_FIRST
  2152. [in,out] LPMESSAGEPROPS pProps, // When function returns S_OK, contains message properties
  2153. [out] LPHENUMSTORE phEnum); // Upon successful return, contains handle to enumeration
  2154. HRESULT GetNextMessage( // Get the next message in the enumeration
  2155. [in] HENUMSTORE hEnum, // Handle to the enumeration received in GetFirstMessage
  2156. [in] DWORD dwFlags, // MSGPROPS_xxx Flags
  2157. [in,out] LPMESSAGEPROPS pProps); // When function returns S_OK, contains message properties
  2158. HRESULT GetMessageClose(
  2159. [in] HENUMSTORE hEnum); // Handle to the enumeration received in GetFirstMessage
  2160. }
  2161. cpp_quote("#endif // __LPSTOREFOLDER_DEFINED")
  2162. cpp_quote("#endif // OE5_BETA2")
  2163. } // OEStore Library Object Definition