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.

122 lines
5.0 KiB

  1. //--------------------------------------------------------------------------
  2. // oe5imp.h
  3. //--------------------------------------------------------------------------
  4. #pragma once
  5. //--------------------------------------------------------------------------
  6. // Depends
  7. //--------------------------------------------------------------------------
  8. #include <newimp.h>
  9. #include <oestore.h>
  10. #include <shared.h>
  11. #include <database.h>
  12. //--------------------------------------------------------------------------
  13. // Forward Decls
  14. //--------------------------------------------------------------------------
  15. typedef struct tagIMPFOLDERNODE IMPFOLDERNODE;
  16. typedef struct tagFLDINFO *LPFLDINFO;
  17. //--------------------------------------------------------------------------
  18. // {A1006DE3-2173-11d2-9A7C-00C04FA309D4}
  19. //--------------------------------------------------------------------------
  20. DEFINE_GUID(CLSID_COE5Import, 0xa1006de3, 0x2173, 0x11d2, 0x9a, 0x7c, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);
  21. //--------------------------------------------------------------------------
  22. // IMPORTOPTIONS
  23. //--------------------------------------------------------------------------
  24. typedef struct tagIMPORTOPTIONS {
  25. CHAR szStoreRoot[MAX_PATH + MAX_PATH];
  26. BOOL fOE5Only;
  27. } IMPORTOPTIONS, *LPIMPORTOPTIONS;
  28. //--------------------------------------------------------------------------
  29. // COE5EnumFolders
  30. //--------------------------------------------------------------------------
  31. class COE5EnumFolders : public IEnumFOLDERS
  32. {
  33. public:
  34. //----------------------------------------------------------------------
  35. // Construction
  36. //----------------------------------------------------------------------
  37. COE5EnumFolders(IMPFOLDERNODE *plist);
  38. ~COE5EnumFolders(void);
  39. //----------------------------------------------------------------------
  40. // IUnknown Members
  41. //----------------------------------------------------------------------
  42. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  43. STDMETHODIMP_(ULONG) AddRef(void);
  44. STDMETHODIMP_(ULONG) Release(void);
  45. //----------------------------------------------------------------------
  46. // IEnumFOLDERS Members
  47. //----------------------------------------------------------------------
  48. STDMETHODIMP Next(IMPORTFOLDER *pfldr);
  49. STDMETHODIMP Reset(void);
  50. private:
  51. //----------------------------------------------------------------------
  52. // Private Data
  53. //----------------------------------------------------------------------
  54. LONG m_cRef;
  55. IMPFOLDERNODE *m_pList;
  56. IMPFOLDERNODE *m_pNext;
  57. };
  58. //--------------------------------------------------------------------------
  59. // COE5Import
  60. //--------------------------------------------------------------------------
  61. class COE5Import : public IMailImport
  62. {
  63. public:
  64. //----------------------------------------------------------------------
  65. // Construction
  66. //----------------------------------------------------------------------
  67. COE5Import(void);
  68. ~COE5Import(void);
  69. //----------------------------------------------------------------------
  70. // IUnknown Members
  71. //----------------------------------------------------------------------
  72. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  73. STDMETHODIMP_(ULONG) AddRef(void);
  74. STDMETHODIMP_(ULONG) Release(void);
  75. //----------------------------------------------------------------------
  76. // IMailImport Members
  77. //----------------------------------------------------------------------
  78. STDMETHODIMP InitializeImport(HWND hwnd);
  79. STDMETHODIMP GetDirectory(LPSTR pszDir, UINT cch);
  80. STDMETHODIMP SetDirectory(LPSTR pszDir);
  81. STDMETHODIMP EnumerateFolders(DWORD_PTR dwCookie, IEnumFOLDERS **ppEnum);
  82. STDMETHODIMP ImportFolder(DWORD_PTR dwCookie, IFolderImport *pImport);
  83. private:
  84. //----------------------------------------------------------------------
  85. // Private Methods
  86. //----------------------------------------------------------------------
  87. void _FreeFolderList(IMPFOLDERNODE *pNode);
  88. HRESULT _BuildFolderList(IDatabase *pDB);
  89. HRESULT _BuildFolderHierarchy(DWORD cDepth, FOLDERID idParent, IMPFOLDERNODE *pParent);
  90. private:
  91. //----------------------------------------------------------------------
  92. // Private Data
  93. //----------------------------------------------------------------------
  94. LONG m_cRef;
  95. CHAR m_szDirectory[MAX_PATH];
  96. DWORD m_cFolders;
  97. LPFOLDERINFO m_prgFolder;
  98. IMPFOLDERNODE *m_pList;
  99. BOOL m_fGotMeSomeFolders;
  100. IMPORTOPTIONS m_Options;
  101. IDatabase *m_pFolderDB;
  102. IDatabaseSession *m_pSession;
  103. HWND m_hwndParent;
  104. };
  105. //--------------------------------------------------------------------------
  106. // Prototypes
  107. //--------------------------------------------------------------------------
  108. COE5Import_CreateInstance(IUnknown *pUnkOuter, IUnknown **ppUnknown);