ECArchiveAwareMsgStore.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 ECARCHIVEAWAREMSGSTORE_H
  18. #define ECARCHIVEAWAREMSGSTORE_H
  19. #include <kopano/zcdefs.h>
  20. #include <kopano/memory.hpp>
  21. #include "ECMsgStore.h"
  22. #include <kopano/ECGuid.h>
  23. #include <kopano/Util.h>
  24. #include <list>
  25. #include <vector>
  26. #include <map>
  27. class ECMessage;
  28. class _kc_export_dycast ECArchiveAwareMsgStore _kc_final : public ECMsgStore {
  29. public:
  30. _kc_hidden ECArchiveAwareMsgStore(char *profname, LPMAPISUP, WSTransport *, BOOL modify, ULONG profflags, BOOL is_spooler, BOOL is_dfl_store, BOOL offline_store);
  31. _kc_hidden static HRESULT Create(char *profname, LPMAPISUP, WSTransport *, BOOL modify, ULONG profflags, BOOL is_spooler, BOOL is_dfl_store, BOOL offline_store, ECMsgStore **ret);
  32. _kc_hidden virtual HRESULT OpenEntry(ULONG eid_size, LPENTRYID eid, LPCIID, ULONG flags, ULONG *obj_type, LPUNKNOWN *ret);
  33. _kc_hidden virtual HRESULT OpenItemFromArchive(LPSPropValue propstore_eids, LPSPropValue propitem_eids, ECMessage **ret);
  34. private:
  35. typedef std::list<SBinary *> BinaryList;
  36. typedef BinaryList::iterator BinaryListIterator;
  37. typedef KCHL::object_ptr<ECMsgStore, IID_ECMsgStore> ECMsgStorePtr;
  38. typedef std::vector<BYTE> EntryID;
  39. typedef std::map<EntryID, ECMsgStorePtr> MsgStoreMap;
  40. _kc_hidden HRESULT CreateCacheBasedReorderedList(SBinaryArray b_store_eids, SBinaryArray b_item_eids, BinaryList *store_eids, BinaryList *item_eids);
  41. _kc_hidden HRESULT GetArchiveStore(LPSBinary store_eid, ECMsgStore **ret);
  42. MsgStoreMap m_mapStores;
  43. ALLOC_WRAP_FRIEND;
  44. };
  45. #endif // ndef ECARCHIVEAWAREMSGSTORE_H