ECParentStorage.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 ECPARENTSTORAGE_H
  18. #define ECPARENTSTORAGE_H
  19. /* This PropStorate class writes the data to the parent object, so this is only used in attachments and msg-in-msg objects
  20. It reads from the saved data in the parent
  21. */
  22. #include <kopano/zcdefs.h>
  23. #include <kopano/ECUnknown.h>
  24. #include "IECPropStorage.h"
  25. #include "ECGenericProp.h"
  26. #include "WSMAPIPropStorage.h"
  27. #include <kopano/kcodes.h>
  28. #include "soapKCmdProxy.h"
  29. #include <mapi.h>
  30. #include <mapispi.h>
  31. class ECParentStorage _kc_final : public ECUnknown {
  32. /*
  33. lpParentObject: The property object of the parent (eg. ECMessage for ECAttach)
  34. ulUniqueId: A unique client-side to find the object in the children list on the parent (PR_ATTACH_NUM (attachments) or PR_ROWID (recipients))
  35. ulObjId: The hierarchy id on the server (0 for a new item)
  36. lpServerStorage: A WSMAPIPropStorage interface which has the communication line to the server
  37. */
  38. protected:
  39. ECParentStorage(ECGenericProp *lpParentObject, ULONG ulUniqueId, ULONG ulObjId, IECPropStorage *lpServerStorage);
  40. virtual ~ECParentStorage();
  41. public:
  42. static HRESULT Create(ECGenericProp *lpParentObject, ULONG ulUniqueId, ULONG ulObjId, IECPropStorage *lpServerStorage, ECParentStorage **lppParentStorage);
  43. virtual HRESULT QueryInterface(REFIID refiid, void **lppInterface) _kc_override;
  44. private:
  45. // Get a list of the properties
  46. virtual HRESULT HrReadProps(LPSPropTagArray *lppPropTags, ULONG *cValues, LPSPropValue *ppValues);
  47. // Get a single (large) property
  48. virtual HRESULT HrLoadProp(ULONG ulObjId, ULONG ulPropTag, LPSPropValue *lppsPropValue);
  49. // Not implemented
  50. virtual HRESULT HrWriteProps(ULONG cValues, LPSPropValue pValues, ULONG ulFlags = 0);
  51. // Not implemented
  52. virtual HRESULT HrDeleteProps(const SPropTagArray *lpsPropTagArray);
  53. // Save complete object, deletes/adds/modifies/creates
  54. virtual HRESULT HrSaveObject(ULONG ulFlags, MAPIOBJECT *lpsMapiObject);
  55. // Load complete object, deletes/adds/modifies/creates
  56. virtual HRESULT HrLoadObject(MAPIOBJECT **lppsMapiObject);
  57. // Returns the correct storage which can connect to the server
  58. virtual IECPropStorage* GetServerStorage();
  59. public:
  60. class xECPropStorage _kc_final : public IECPropStorage {
  61. #include <kopano/xclsfrag/IECUnknown.hpp>
  62. #include <kopano/xclsfrag/IECPropStorage.hpp>
  63. } m_xECPropStorage;
  64. private:
  65. ECGenericProp *m_lpParentObject;
  66. ULONG m_ulObjId;
  67. ULONG m_ulUniqueId;
  68. IECPropStorage *m_lpServerStorage;
  69. };
  70. #endif