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.

111 lines
4.8 KiB

  1. //--------------------------------------------------------------------------
  2. // OE4Imp.h
  3. //--------------------------------------------------------------------------
  4. #pragma once
  5. //--------------------------------------------------------------------------
  6. // Depends
  7. //--------------------------------------------------------------------------
  8. #include <newimp.h>
  9. //--------------------------------------------------------------------------
  10. // Forward Decls
  11. //--------------------------------------------------------------------------
  12. typedef struct tagIMPFOLDERNODE IMPFOLDERNODE;
  13. typedef struct tagFLDINFO *LPFLDINFO;
  14. //--------------------------------------------------------------------------
  15. // {BCE9E2E7-1FDD-11d2-9A79-00C04FA309D4}
  16. //--------------------------------------------------------------------------
  17. DEFINE_GUID(CLSID_COE4Import, 0xbce9e2e7, 0x1fdd, 0x11d2, 0x9a, 0x79, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);
  18. //--------------------------------------------------------------------------
  19. // {B977CB11-1FF5-11d2-9A7A-00C04FA309D4}
  20. //--------------------------------------------------------------------------
  21. DEFINE_GUID(CLSID_CIMN1Import, 0xb977cb11, 0x1ff5, 0x11d2, 0x9a, 0x7a, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);
  22. //--------------------------------------------------------------------------
  23. // COE4EnumFolders
  24. //--------------------------------------------------------------------------
  25. class COE4EnumFolders : public IEnumFOLDERS
  26. {
  27. public:
  28. //----------------------------------------------------------------------
  29. // Construction
  30. //----------------------------------------------------------------------
  31. COE4EnumFolders(IMPFOLDERNODE *plist);
  32. ~COE4EnumFolders(void);
  33. //----------------------------------------------------------------------
  34. // IUnknown Members
  35. //----------------------------------------------------------------------
  36. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  37. STDMETHODIMP_(ULONG) AddRef(void);
  38. STDMETHODIMP_(ULONG) Release(void);
  39. //----------------------------------------------------------------------
  40. // IEnumFOLDERS Members
  41. //----------------------------------------------------------------------
  42. STDMETHODIMP Next(IMPORTFOLDER *pfldr);
  43. STDMETHODIMP Reset(void);
  44. private:
  45. //----------------------------------------------------------------------
  46. // Private Data
  47. //----------------------------------------------------------------------
  48. LONG m_cRef;
  49. IMPFOLDERNODE *m_pList;
  50. IMPFOLDERNODE *m_pNext;
  51. };
  52. //--------------------------------------------------------------------------
  53. // COE4Import
  54. //--------------------------------------------------------------------------
  55. class COE4Import : public IMailImport
  56. {
  57. public:
  58. //----------------------------------------------------------------------
  59. // Construction
  60. //----------------------------------------------------------------------
  61. COE4Import(void);
  62. ~COE4Import(void);
  63. //----------------------------------------------------------------------
  64. // IUnknown Members
  65. //----------------------------------------------------------------------
  66. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  67. STDMETHODIMP_(ULONG) AddRef(void);
  68. STDMETHODIMP_(ULONG) Release(void);
  69. //----------------------------------------------------------------------
  70. // IMailImport Members
  71. //----------------------------------------------------------------------
  72. STDMETHODIMP InitializeImport(HWND hwnd);
  73. STDMETHODIMP GetDirectory(LPSTR pszDir, UINT cch);
  74. STDMETHODIMP SetDirectory(LPSTR pszDir);
  75. STDMETHODIMP EnumerateFolders(DWORD_PTR dwCookie, IEnumFOLDERS **ppEnum);
  76. STDMETHODIMP ImportFolder(DWORD_PTR dwCookie, IFolderImport *pImport);
  77. private:
  78. //----------------------------------------------------------------------
  79. // Private Methods
  80. //----------------------------------------------------------------------
  81. HRESULT _BuildFolderHierarchy(DWORD cDepth, DWORD idParent, IMPFOLDERNODE *pParent, DWORD cFolders, LPFLDINFO prgFolder);
  82. HRESULT _EnumerateV1Folders(void);
  83. void _FreeFolderList(IMPFOLDERNODE *pNode);
  84. void _Cleanup(void);
  85. private:
  86. //----------------------------------------------------------------------
  87. // Private Data
  88. //----------------------------------------------------------------------
  89. LONG m_cRef;
  90. CHAR m_szDirectory[MAX_PATH];
  91. DWORD m_cFolders;
  92. LPFLDINFO m_prgFolder;
  93. IMPFOLDERNODE *m_pList;
  94. };
  95. //--------------------------------------------------------------------------
  96. // Prototypes
  97. //--------------------------------------------------------------------------
  98. COE4Import_CreateInstance(IUnknown *pUnkOuter, IUnknown **ppUnknown);