RecurrenceState.swig.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. /* Copy of the full common/RecurrenceState.h file, but without the
  18. nested classes in the main class. Since swig can't handle those.
  19. */
  20. #include <vector>
  21. #include <string>
  22. #define RECURRENCE_STATE_CALENDAR 0x01
  23. #define RECURRENCE_STATE_TASKS 0x02
  24. #define ARO_SUBJECT 0x0001
  25. #define ARO_MEETINGTYPE 0x0002
  26. #define ARO_REMINDERDELTA 0x0004
  27. #define ARO_REMINDERSET 0x0008
  28. #define ARO_LOCATION 0x0010
  29. #define ARO_BUSYSTATUS 0x0020
  30. #define ARO_ATTACHMENT 0x0040
  31. #define ARO_SUBTYPE 0x0080
  32. #define ARO_APPTCOLOR 0x0100
  33. #define ARO_EXCEPTIONAL_BODY 0x0200
  34. // valid ulRecurFrequency values
  35. #define RF_DAILY 0x200A
  36. #define RF_WEEKLY 0x200B
  37. #define RF_MONTHLY 0x200C
  38. #define RF_YEARLY 0x200D
  39. // valid ulEndType values
  40. #define ET_DATE 0x2021
  41. #define ET_NUMBER 0x2022
  42. #define ET_NEVER 0x2023
  43. // valid ulFirstDOW values
  44. #define DOW_SUNDAY 0x00
  45. #define DOW_MONDAY 0x01
  46. #define DOW_TUESDAY 0x02
  47. #define DOW_WEDNESDAY 0x03
  48. #define DOW_THURSDAY 0x04
  49. #define DOW_FRIDAY 0x05
  50. #define DOW_SATURDAY 0x06
  51. // ulWeekDays bit mask
  52. #define WD_SUNDAY 0x01
  53. #define WD_MONDAY 0x02
  54. #define WD_TUESDAY 0x04
  55. #define WD_WEDNESDAY 0x08
  56. #define WD_THURSDAY 0x10
  57. #define WD_FRIDAY 0x20
  58. #define WD_SATURDAY 0x40
  59. #define WD_MASK 0x7F
  60. // ulPatternType values
  61. #define PT_DAY 0x0
  62. #define PT_WEEK 0x1
  63. #define PT_MONTH 0x2
  64. #define PT_MONTH_END 0x4
  65. #define PT_MONTH_NTH 0x3
  66. #define PT_HJ_MONTH 0xA
  67. #define PT_HJ_MONTH_NTH 0xB
  68. #define PT_HJ_MONTH_END 0xC
  69. namespace KC {
  70. /* do not inline for swig */
  71. class Exception {
  72. public:
  73. unsigned int ulStartDateTime;
  74. unsigned int ulEndDateTime;
  75. unsigned int ulOriginalStartDate;
  76. unsigned int ulOverrideFlags;
  77. std::string strSubject;
  78. unsigned int ulMeetingType;
  79. unsigned int ulReminderDelta;
  80. unsigned int ulReminderSet;
  81. std::string strLocation;
  82. unsigned int ulBusyStatus;
  83. unsigned int ulAttachment;
  84. unsigned int ulSubType;
  85. unsigned int ulAppointmentColor;
  86. };
  87. class ExtendedException {
  88. public:
  89. unsigned int ulChangeHighlightValue;
  90. std::string strReserved;
  91. std::string strReservedBlock1;
  92. unsigned int ulStartDateTime;
  93. unsigned int ulEndDateTime;
  94. unsigned int ulOriginalStartDate;
  95. std::wstring strWideCharSubject;
  96. std::wstring strWideCharLocation;
  97. std::string strReservedBlock2;
  98. };
  99. class RecurrenceState {
  100. public:
  101. HRESULT ParseBlob(const char *lpData, unsigned int ulLen, ULONG ulFlags);
  102. HRESULT GetBlob(char **lpData, unsigned int *lpulLen, void *base = NULL);
  103. /* not inlined for swig */
  104. unsigned int ulReaderVersion = 0x3004;
  105. unsigned int ulWriterVersion = 0x3004;
  106. unsigned int ulRecurFrequency = 0; /* "invalid" */
  107. unsigned int ulPatternType = PT_DAY;
  108. unsigned int ulCalendarType = 0;
  109. unsigned int ulFirstDateTime = 0;
  110. unsigned int ulPeriod = 0;
  111. unsigned int ulSlidingFlag = 0;
  112. // pattern type specific:
  113. unsigned int ulWeekDays = 0; // weekly, which day of week (see: WD_* bitmask)
  114. unsigned int ulDayOfMonth = 0; // monthly, day in month
  115. unsigned int ulWeekNumber = 0; // monthly, 1-4 or 5 for last
  116. unsigned int ulEndType = 0;
  117. unsigned int ulOccurrenceCount = 0;
  118. unsigned int ulFirstDOW = DOW_MONDAY; /* default Outlook */
  119. unsigned int ulDeletedInstanceCount = 0;
  120. std::vector<unsigned int> lstDeletedInstanceDates;
  121. unsigned int ulModifiedInstanceCount = 0;
  122. std::vector<unsigned int> lstModifiedInstanceDates;
  123. unsigned int ulStartDate = 0;
  124. unsigned int ulEndDate = 0;
  125. unsigned int ulReaderVersion2 = 0x3006;
  126. unsigned int ulWriterVersion2 = 0x3008; /* can also be 3009, but Outlook (2003) sets 3008 */
  127. unsigned int ulStartTimeOffset = 0; /* max 1440-1 */
  128. unsigned int ulEndTimeOffset = 0; /* max 1440-1 */
  129. unsigned int ulExceptionCount = 0;
  130. std::vector<Exception> lstExceptions;
  131. std::string strReservedBlock1;
  132. std::vector<ExtendedException> lstExtendedExceptions;
  133. std::string strReservedBlock2;
  134. };
  135. } /* namespace */