ArchiveManage.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright 2005 - 2016 Zarafa and its licensors
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Affero General Public License, version 3,
  6. * as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU Affero General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Affero General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. *
  16. */
  17. /* ArchiveManage.h
  18. * Declaration of class ArchiveManage
  19. */
  20. #ifndef ARCHIVEMANAGE_H_INCLUDED
  21. #define ARCHIVEMANAGE_H_INCLUDED
  22. #include <kopano/zcdefs.h>
  23. #include <kopano/platform.h>
  24. #include <list>
  25. #include <memory>
  26. #include <mapix.h>
  27. #include <kopano/ArchiveControl.h>
  28. namespace KC {
  29. class ECLogger;
  30. struct ArchiveEntry {
  31. std::string StoreName;
  32. std::string FolderName;
  33. std::string StoreOwner;
  34. unsigned Rights;
  35. std::string StoreGuid;
  36. };
  37. typedef std::list<ArchiveEntry> ArchiveList;
  38. struct UserEntry {
  39. std::string UserName;
  40. };
  41. typedef std::list<UserEntry> UserList;
  42. class ArchiveManage {
  43. public:
  44. enum {
  45. UseIpmSubtree = 1,
  46. Writable = 2,
  47. ReadOnly = 4
  48. };
  49. typedef std::unique_ptr<ArchiveManage> auto_ptr_type;
  50. virtual ~ArchiveManage(void) _kc_impdtor;
  51. _kc_export static HRESULT Create(LPMAPISESSION, ECLogger *, const TCHAR *user, auto_ptr_type *manage);
  52. virtual eResult AttachTo(const char *lpszArchiveServer, const TCHAR *lpszArchive, const TCHAR *lpszFolder, unsigned int ulFlags) = 0;
  53. virtual eResult DetachFrom(const char *lpszArchiveServer, const TCHAR *lpszArchive, const TCHAR *lpszFolder) = 0;
  54. virtual eResult DetachFrom(unsigned int ulArchive) = 0;
  55. virtual eResult ListArchives(std::ostream &ostr) = 0;
  56. virtual eResult ListArchives(ArchiveList *lplstArchives, const char *lpszIpmSubtreeSubstitude = NULL) = 0;
  57. virtual eResult ListAttachedUsers(std::ostream &ostr) = 0;
  58. virtual eResult ListAttachedUsers(UserList *lplstUsers) = 0;
  59. virtual eResult AutoAttach(unsigned int ulFlags) = 0;
  60. protected:
  61. ArchiveManage(void) = default;
  62. };
  63. typedef ArchiveManage::auto_ptr_type ArchiveManagePtr;
  64. } /* namespace */
  65. #endif // !defined ARCHIVEMANAGE_H_INCLUDED