WSABPropStorage.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 WSABPROPSTORAGE_H
  18. #define WSABPROPSTORAGE_H
  19. #include <kopano/zcdefs.h>
  20. #include <mutex>
  21. #include <kopano/ECUnknown.h>
  22. #include "IECPropStorage.h"
  23. #include <kopano/kcodes.h>
  24. #include "WSTransport.h"
  25. #include "soapKCmdProxy.h"
  26. #include <mapi.h>
  27. #include <mapispi.h>
  28. class WSABPropStorage _kc_final : public ECUnknown {
  29. protected:
  30. WSABPropStorage(ULONG cbEntryId, LPENTRYID, KCmd *, std::recursive_mutex &, ECSESSIONID, WSTransport *);
  31. virtual ~WSABPropStorage();
  32. public:
  33. static HRESULT Create(ULONG cbEntryId, LPENTRYID, KCmd *, std::recursive_mutex &, ECSESSIONID, WSTransport *, WSABPropStorage **);
  34. virtual HRESULT QueryInterface(REFIID refiid, void **lppInterface) _kc_override;
  35. static HRESULT Reload(void *lpParam, ECSESSIONID sessionId);
  36. private:
  37. // Get a list of the properties
  38. virtual HRESULT HrReadProps(LPSPropTagArray *lppPropTags,ULONG *cValues, LPSPropValue *ppValues);
  39. // Get a single (large) property
  40. virtual HRESULT HrLoadProp(ULONG ulObjId, ULONG ulPropTag, LPSPropValue *lppsPropValue);
  41. // Write all properties to disk (overwrites a property if it already exists)
  42. virtual HRESULT HrWriteProps(ULONG cValues, LPSPropValue pValues, ULONG ulFlags = 0);
  43. // Delete properties from file
  44. virtual HRESULT HrDeleteProps(const SPropTagArray *lpsPropTagArray);
  45. // Save complete object to disk
  46. virtual HRESULT HrSaveObject(ULONG ulFlags, MAPIOBJECT *lpsMapiObject);
  47. // Load complete object from disk
  48. virtual HRESULT HrLoadObject(MAPIOBJECT **lppsMapiObject);
  49. virtual IECPropStorage* GetServerStorage();
  50. virtual HRESULT LockSoap();
  51. virtual HRESULT UnLockSoap();
  52. public:
  53. class xECPropStorage _kc_final : public IECPropStorage {
  54. #include <kopano/xclsfrag/IECUnknown.hpp>
  55. #include <kopano/xclsfrag/IECPropStorage.hpp>
  56. } m_xECPropStorage;
  57. private:
  58. entryId m_sEntryId;
  59. KCmd* lpCmd;
  60. std::recursive_mutex &lpDataLock;
  61. ECSESSIONID ecSessionId;
  62. WSTransport* m_lpTransport;
  63. ULONG m_ulSessionReloadCallback;
  64. };
  65. #endif