icalrecurrence.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 __ICAL_RECURRENCE_H
  18. #define __ICAL_RECURRENCE_H
  19. #include <kopano/zcdefs.h>
  20. #include "recurrence.h"
  21. #include "vtimezone.h"
  22. #include "icalitem.h"
  23. #include <mapidefs.h>
  24. #include <libical/ical.h>
  25. namespace KC {
  26. /**
  27. * Conversion class for recurrence & exceptions (mapi <-> ical)
  28. */
  29. class ICalRecurrence _kc_final {
  30. public:
  31. /* ical -> mapi */
  32. HRESULT HrParseICalRecurrenceRule(TIMEZONE_STRUCT sTimeZone, icalcomponent *lpicRootEvent, icalcomponent *lpicEvent,
  33. bool bIsAllday, LPSPropTagArray lpNamedProps, icalitem *lpIcalItem);
  34. HRESULT HrMakeMAPIException(icalcomponent *lpEventRoot, icalcomponent *lpicEvent, icalitem *lpIcalItem, bool bIsAllday, LPSPropTagArray lpNamedProps, std::string& strCharset, icalitem::exception *lpEx);
  35. HRESULT HrMakeMAPIRecurrence(recurrence *lpRecurrence, LPSPropTagArray lpNamedProps, LPMESSAGE lpMessage);
  36. bool HrValidateOccurrence(icalitem *lpItem, icalitem::exception lpEx);
  37. /* mapi -> ical */
  38. HRESULT HrCreateICalRecurrence(TIMEZONE_STRUCT sTimeZone, bool bIsAllDay, recurrence *lpRecurrence, icalcomponent *lpicEvent);
  39. HRESULT HrMakeICalException(icalcomponent *lpicEvent, icalcomponent **lppicException);
  40. private:
  41. HRESULT HrCreateICalRecurrenceType(TIMEZONE_STRUCT sTimeZone, bool bIsAllday, recurrence *lpRecurrence, icalrecurrencetype *lpicRRule);
  42. HRESULT WeekDaysToICalArray(ULONG ulWeekDays, struct icalrecurrencetype *lpRec);
  43. };
  44. } /* namespace */
  45. #endif