ArchiveManageImpl.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #ifndef ARCHIVEMANAGEIMPL_H_INCLUDED
  18. #define ARCHIVEMANAGEIMPL_H_INCLUDED
  19. #include <kopano/zcdefs.h>
  20. #include "ArchiverSessionPtr.h" // For ArchiverSessionPtr
  21. #include "helpers/ArchiveHelper.h"
  22. #include "ECArchiverLogger.h"
  23. #include "Archiver.h"
  24. namespace KC {
  25. /**
  26. * The ArchiveManager is used to attach, detach and list archives for users.
  27. */
  28. class _kc_export_dycast ArchiveManageImpl _kc_final : public ArchiveManage {
  29. public:
  30. static HRESULT Create(ArchiverSessionPtr ptrSession, ECConfig *lpConfig, const TCHAR *lpszUser, ECLogger *lpLogger, ArchiveManagePtr *lpptrArchiveManage);
  31. _kc_hidden eResult AttachTo(const char *server, const TCHAR *archive, const TCHAR *folder, unsigned int flags) _kc_override;
  32. _kc_hidden eResult DetachFrom(const char *server, const TCHAR *archive, const TCHAR *folder) _kc_override;
  33. _kc_hidden eResult DetachFrom(unsigned int archive) _kc_override;
  34. _kc_hidden eResult ListArchives(std::ostream &) _kc_override;
  35. _kc_hidden eResult ListArchives(ArchiveList *, const char *ipm_subtree_subst) _kc_override;
  36. _kc_hidden eResult ListAttachedUsers(std::ostream &) _kc_override;
  37. _kc_hidden eResult ListAttachedUsers(UserList *) _kc_override;
  38. _kc_hidden eResult AutoAttach(unsigned int flags) _kc_override;
  39. _kc_hidden HRESULT AttachTo(const char *server, const TCHAR *archive, const TCHAR *folder, unsigned int flags, helpers::AttachType);
  40. _kc_hidden HRESULT AttachTo(LPMDB store, const tstring &folder, const char *server, const abentryid_t &user_eid, unsigned int flags, helpers::AttachType);
  41. _kc_hidden ~ArchiveManageImpl(void) _kc_override;
  42. private:
  43. _kc_hidden ArchiveManageImpl(ArchiverSessionPtr, ECConfig *, const tstring &user, ECLogger *);
  44. _kc_hidden HRESULT Init(void);
  45. _kc_hidden static UserEntry MakeUserEntry(const std::string &user);
  46. _kc_hidden HRESULT GetRights(LPMAPIFOLDER folder, unsigned int *right);
  47. ArchiverSessionPtr m_ptrSession;
  48. ECConfig *m_lpConfig;
  49. tstring m_strUser;
  50. ECArchiverLogger *m_lpLogger;
  51. MsgStorePtr m_ptrUserStore;
  52. };
  53. } /* namespace */
  54. #endif // !defined ARCHIVEMANAGEIMPL_H_INCLUDED