ZCMAPIProp.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 ZCMAPIPROP_H
  18. #define ZCMAPIPROP_H
  19. #include <kopano/zcdefs.h>
  20. #include <kopano/ECUnknown.h>
  21. #include <mapidefs.h>
  22. #include <kopano/charset/convert.h>
  23. #include <map>
  24. class ZCMAPIProp _no_final : public ECUnknown {
  25. protected:
  26. ZCMAPIProp(ULONG ulObjType, const char *szClassName = NULL);
  27. virtual ~ZCMAPIProp();
  28. HRESULT ConvertMailUser(LPSPropTagArray lpNames, ULONG cValues, LPSPropValue lpProps, ULONG ulIndex);
  29. HRESULT ConvertDistList(LPSPropTagArray lpNames, ULONG cValues, LPSPropValue lpProps);
  30. HRESULT ConvertProps(IMAPIProp *lpContact, ULONG cbEntryID, LPENTRYID lpEntryID, ULONG ulIndex);
  31. /* getprops helper */
  32. HRESULT CopyOneProp(convert_context &converter, ULONG ulFlags, const std::map<short, SPropValue>::const_iterator &i, LPSPropValue lpProp, LPSPropValue lpBase);
  33. public:
  34. static HRESULT Create(IMAPIProp *lpContact, ULONG cbEntryID, LPENTRYID lpEntryID, ZCMAPIProp **lppZCMAPIProp);
  35. virtual HRESULT QueryInterface(REFIID refiid, void **lppInterface) _kc_override;
  36. // From IMAPIProp
  37. virtual HRESULT GetLastError(HRESULT hResult, ULONG ulFlags, LPMAPIERROR * lppMAPIError);
  38. virtual HRESULT SaveChanges(ULONG ulFlags);
  39. virtual HRESULT GetProps(const SPropTagArray *lpPropTagArray, ULONG ulFlags, ULONG *lpcValues, LPSPropValue *lppPropArray);
  40. virtual HRESULT GetPropList(ULONG ulFlags, LPSPropTagArray * lppPropTagArray);
  41. virtual HRESULT OpenProperty(ULONG ulPropTag, LPCIID lpiid, ULONG ulInterfaceOptions, ULONG ulFlags, LPUNKNOWN * lppUnk);
  42. virtual HRESULT SetProps(ULONG cValues, const SPropValue *lpPropArray, LPSPropProblemArray *lppProblems);
  43. virtual HRESULT DeleteProps(const SPropTagArray *lpPropTagArray, LPSPropProblemArray *lppProblems);
  44. virtual HRESULT CopyTo(ULONG ciidExclude, LPCIID rgiidExclude, const SPropTagArray *lpExcludeProps, ULONG ulUIParam, LPMAPIPROGRESS lpProgress, LPCIID lpInterface, LPVOID lpDestObj, ULONG ulFlags, LPSPropProblemArray *lppProblems);
  45. virtual HRESULT CopyProps(const SPropTagArray *lpIncludeProps, ULONG ulUIParam, LPMAPIPROGRESS lpProgress, LPCIID lpInterface, LPVOID lpDestObj, ULONG ulFlags, LPSPropProblemArray *lppProblems);
  46. virtual HRESULT GetNamesFromIDs(LPSPropTagArray * lppPropTags, LPGUID lpPropSetGuid, ULONG ulFlags, ULONG * lpcPropNames, LPMAPINAMEID ** lpppPropNames);
  47. virtual HRESULT GetIDsFromNames(ULONG cPropNames, LPMAPINAMEID * lppPropNames, ULONG ulFlags, LPSPropTagArray * lppPropTags);
  48. private:
  49. class xMAPIProp _kc_final : public IMAPIProp {
  50. #include <kopano/xclsfrag/IUnknown.hpp>
  51. #include <kopano/xclsfrag/IMAPIProp.hpp>
  52. } m_xMAPIProp;
  53. private:
  54. SPropValue *m_base = nullptr;
  55. WCHAR empty[1] = {0};
  56. std::map<short, SPropValue> m_mapProperties;
  57. ULONG m_ulObject;
  58. };
  59. #endif