ICalToMAPI.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 ICALTOMAPI_H
  18. #define ICALTOMAPI_H
  19. #include <kopano/zcdefs.h>
  20. #include <mapidefs.h>
  21. #include <string>
  22. #include <list>
  23. #include "icalitem.h"
  24. #define IC2M_NO_RECIPIENTS 0x0001
  25. #define IC2M_APPEND_ONLY 0x0002
  26. #define IC2M_NO_ORGANIZER 0x0004
  27. #define IC2M_NO_BODY 0x0008
  28. namespace KC {
  29. class ICalToMapi {
  30. public:
  31. /*
  32. - lpPropObj to lookup named properties
  33. - Addressbook (Global AddressBook for looking up users)
  34. */
  35. ICalToMapi(IMAPIProp *lpPropObj, LPADRBOOK lpAdrBook, bool bNoRecipients) : m_lpPropObj(lpPropObj), m_lpAdrBook(lpAdrBook), m_bNoRecipients(bNoRecipients) {};
  36. virtual ~ICalToMapi(void) _kc_impdtor;
  37. virtual HRESULT ParseICal(const std::string& strIcal, const std::string& strCharset, const std::string& strServerTZ, IMailUser *lpImailUser, ULONG ulFlags) = 0;
  38. virtual ULONG GetItemCount() = 0;
  39. virtual HRESULT GetItemInfo(ULONG ulPosition, eIcalType *lpType, time_t *lptLastModified, SBinary *lpUid) = 0;
  40. virtual HRESULT GetItem(ULONG ulPosition, ULONG ulFlags, LPMESSAGE lpMessage) = 0;
  41. virtual HRESULT GetFreeBusyInfo(time_t *lptstart, time_t *lptend, std::string *lpstrUID, std::list<std::string> **lplstUsers) = 0;
  42. protected:
  43. LPMAPIPROP m_lpPropObj;
  44. LPADRBOOK m_lpAdrBook;
  45. bool m_bNoRecipients;
  46. };
  47. extern _kc_export HRESULT CreateICalToMapi(IMAPIProp *propobj, LPADRBOOK, bool no_recipients, ICalToMapi **ret);
  48. } /* namespace */
  49. #endif