WSMAPIFolderOps.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 WSMAPIFOLDEROPS_H
  18. #define WSMAPIFOLDEROPS_H
  19. #include <kopano/ECUnknown.h>
  20. #include <kopano/zcdefs.h>
  21. #include <mutex>
  22. #include "kcore.hpp"
  23. #include <kopano/kcodes.h>
  24. #include "soapKCmdProxy.h"
  25. #include "ics_client.hpp"
  26. #include <vector>
  27. #include <mapi.h>
  28. #include <mapispi.h>
  29. namespace KC {
  30. class utf8string;
  31. }
  32. class WSTransport;
  33. class WSMAPIFolderOps _kc_final : public ECUnknown {
  34. protected:
  35. WSMAPIFolderOps(KCmd *, std::recursive_mutex &, ECSESSIONID, ULONG cbEntryId, LPENTRYID, WSTransport *);
  36. virtual ~WSMAPIFolderOps();
  37. public:
  38. static HRESULT Create(KCmd *, std::recursive_mutex &, ECSESSIONID, ULONG cbEntryId, LPENTRYID, WSTransport *, WSMAPIFolderOps **);
  39. virtual HRESULT QueryInterface(REFIID refiid, void **lppInterface) _kc_override;
  40. // Creates a folder object with only a PR_DISPLAY_NAME and type
  41. virtual HRESULT HrCreateFolder(ULONG fl_type, const utf8string &name, const utf8string &comment, BOOL fOpenIfExists, ULONG sync_id, const SBinary *srckey, ULONG neweid_size, ENTRYID *neweid, ULONG *eid_size, ENTRYID **eid);
  42. // Completely remove a folder, the messages in it, the folders in it or any combination
  43. virtual HRESULT HrDeleteFolder(ULONG cbEntryId, LPENTRYID lpEntryId, ULONG ulFlags, ULONG ulSyncId);
  44. // Empty folder (ie delete all folders and messages in folder)
  45. virtual HRESULT HrEmptyFolder(ULONG ulFlags, ULONG ulSyncId);
  46. // Set read/unread flags on messages
  47. virtual HRESULT HrSetReadFlags(ENTRYLIST *lpMsgList, ULONG ulFlags, ULONG ulSyncId);
  48. // Set / Get search criteria
  49. virtual HRESULT HrSetSearchCriteria(ENTRYLIST *lpMsgList, SRestriction *lpRestriction, ULONG ulFlags);
  50. virtual HRESULT HrGetSearchCriteria(ENTRYLIST **lppMsgList, LPSRestriction *lppRestriction, ULONG *lpulFlags);
  51. // Move or copy a folder
  52. virtual HRESULT HrCopyFolder(ULONG cbEntryFrom, LPENTRYID lpEntryFrom, ULONG cbEntryDest, LPENTRYID lpEntryDest, const utf8string &strNewFolderName, ULONG ulFlags, ULONG ulSyncId);
  53. // Move or copy a message
  54. virtual HRESULT HrCopyMessage(ENTRYLIST *lpMsgList, ULONG cbEntryDest, LPENTRYID lpEntryDest, ULONG ulFlags, ULONG ulSyncId);
  55. // Message status
  56. virtual HRESULT HrGetMessageStatus(ULONG cbEntryID, LPENTRYID lpEntryID, ULONG ulFlags, ULONG *lpulMessageStatus);
  57. virtual HRESULT HrSetMessageStatus(ULONG cbEntryID, LPENTRYID lpEntryID, ULONG ulNewStatus, ULONG ulNewStatusMask, ULONG ulSyncId, ULONG *lpulOldStatus);
  58. // Streaming Support
  59. virtual HRESULT HrGetChangeInfo(ULONG cbEntryID, LPENTRYID lpEntryID, LPSPropValue *lppPropPCL, LPSPropValue *lppPropCK);
  60. // Reload callback
  61. static HRESULT Reload(void *lpParam, ECSESSIONID sessionid);
  62. private:
  63. virtual HRESULT LockSoap();
  64. virtual HRESULT UnLockSoap();
  65. entryId m_sEntryId; // Entryid of the folder
  66. KCmd* lpCmd; // command object
  67. std::recursive_mutex &lpDataLock;
  68. ECSESSIONID ecSessionId; // Id of the session
  69. ULONG m_ulSessionReloadCallback;
  70. WSTransport * m_lpTransport;
  71. };
  72. #endif