1 // CalendarObject.h - CalendarObject class header
3 // (c) 2016-2017 Xestia Software Development.
5 // This file is part of Xestia Calendar.
7 // Xestia Calendar is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Calendar is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
19 #ifndef __OBJECTS_CALENDAROBJECT_CALENDAROBJECT_H__
20 #define __OBJECTS_CALENDAROBJECT_CALENDAROBJECT_H__
30 #include "../../common/text.h"
31 #include "../../version.h"
35 enum CalendarObjectLoadResult {
36 CALENDAROBJECTLOAD_UNITTESTFAIL = -1,
37 CALENDAROBJECTLOAD_OK,
38 CALENDAROBJECTLOAD_MISSING,
39 CALENDAROBJECTLOAD_INVALIDFORMAT,
40 CALENDAROBJECTLOAD_CANNOTOPEN
43 enum CalendarObjectSaveResult {
44 CALENDAROBJECTSAVE_UNITTESTFAIL = -1,
45 CALENDAROBJECTSAVE_OK,
46 CALENDAROBJECTSAVE_CANNOTOPEN
49 enum CalendarObjectValidResult{
50 CALENDAROBJECTVALID_UNITTESTFAIL = -1,
51 CALENDAROBJECTVALID_OK,
52 CALENDAROBJECTVALID_INVALIDFORMAT
55 enum CalendarAlarmAction{
56 CALENDARALARM_UNSPECIFIED = -1,
58 CALENDARALARM_DISPLAY,
62 struct CalendarAlarmDataStruct{
64 CalendarAlarmAction alarmType = CALENDARALARM_UNSPECIFIED;
67 string alarmActionTokens;
71 string triggerRelated;
74 string descriptionData;
75 string descriptionAltRep;
76 string descriptionLanguage;
77 string descriptionTokens;
84 string summaryLanguage;
87 vector<string> attendeeList;
88 vector<string> attendeeListMember;
89 vector<string> attendeeListDelegatedFrom;
90 vector<string> attendeeListDelegatedTo;
91 vector<string> attendeeListRole;
92 vector<string> attendeeListRSVP;
93 vector<string> attendeeListDirectoryEntry;
94 vector<string> attendeeListSentBy;
95 vector<string> attendeeListCommonName;
96 vector<string> attendeeListCalendarUserType;
97 vector<string> attendeeListParticipationStatus;
98 vector<string> attendeeListLanguage;
99 vector<string> attendeeListTokens;
102 string durationTokens;
104 vector<string> attachList;
105 vector<string> attachListTokens;
106 vector<string> attachListEncoding;
107 vector<string> attachListFormatType;
108 vector<string> attachListValue;
110 vector<string> xTokensData;
111 vector<string> xTokensDataTokens;
115 class CalendarObject{
118 CalendarObjectLoadResult LoadFile(string loadFilename);
119 CalendarObjectLoadResult LoadString(string *loadStringData);
120 CalendarObjectSaveResult SaveFile(string saveFilename);
121 CalendarObjectSaveResult SaveString(string *saveStringData);
122 CalendarObjectValidResult ValidBaseObject();
123 void ProcessBaseData();
125 // Setup virtual subroutines for use by objects
126 // inheriting from CalendarObject later on.
128 virtual CalendarObjectValidResult ValidObject() { return CALENDAROBJECTVALID_OK; };
129 virtual void Clear() {};
130 virtual void SaveObjectData(string *saveData) {};
137 string calendarScaleData;
138 string calendarScaleTokens;
141 string uniqueIDTokens;
143 vector<string> attachList;
144 vector<string> attachListTokens;
145 vector<string> attachListEncoding;
146 vector<string> attachListFormatType;
147 vector<string> attachListValue;
149 vector<string> categoriesList;
150 vector<string> categoriesListLanguage;
151 vector<string> categoriesListTokens;
154 string classDataTokens;
156 string completedData;
157 string completedDataTokens;
159 vector<string> commentList;
160 vector<string> commentListAltRep;
161 vector<string> commentListLanguage;
162 vector<string> commentListTokens;
164 vector<string> descriptionList;
165 vector<string> descriptionListAltRep;
166 vector<string> descriptionListLanguage;
167 vector<string> descriptionListTokens;
169 string geographicData;
170 string geographicTokens;
173 string locationDataAltRep;
174 string locationDataLanguage;
175 string locationDataTokens;
177 string percentCompleteData;
178 string percentCompleteTokens;
180 int priorityData = -1;
181 string priorityTokens;
183 vector<string> resourcesData;
184 vector<string> resourcesDataAltRep;
185 vector<string> resourcesDataLanguage;
186 vector<string> resourcesDataTokens;
189 string statusLanguage;
193 string summaryDataAltRep;
194 string summaryDataLanguage;
195 string summaryDataTokens;
197 string dateTimeEndData;
198 string dateTimeEndDataValue;
199 string dateTimeEndDataTimeZoneID;
200 string dateTimeEndDataTokens;
204 string dueDataTimeZoneID;
205 string dueDataTokens;
207 string dateTimeStartData;
208 string dateTimeStartDataValue;
209 string dateTimeStartDataTimeZoneID;
210 string dateTimeStartDataTokens;
213 string durationDataTokens;
215 vector<string> freeBusyList;
216 vector<string> freeBusyListType;
217 vector<string> freeBusyListTokens;
219 string timeTransparencyData;
220 string timeTransparencyDataTokens;
223 string timeZoneDataTokens;
225 vector<string> timeZoneNameList;
226 vector<string> timeZoneNameListLanguage;
227 vector<string> timeZoneNameListTokens;
229 string timeZoneOffsetFromData;
230 string timeZoneOffsetFromDataTokens;
232 string timeZoneOffsetToData;
233 string timeZoneOffsetToDataTokens;
235 string timeZoneURLData;
236 string timeZoneURLTokens;
238 vector<string> attendeeList;
239 vector<string> attendeeListMember;
240 vector<string> attendeeListDelegatedFrom;
241 vector<string> attendeeListDelegatedTo;
242 vector<string> attendeeListRole;
243 vector<string> attendeeListRSVP;
244 vector<string> attendeeListDirectoryEntry;
245 vector<string> attendeeListSentBy;
246 vector<string> attendeeListCommonName;
247 vector<string> attendeeListCalendarUserType;
248 vector<string> attendeeListParticipationStatus;
249 vector<string> attendeeListLanguage;
250 vector<string> attendeeListTokens;
252 vector<string> contactList;
253 vector<string> contactListAltRep;
254 vector<string> contactListLanguage;
255 vector<string> contactListTokens;
257 string organiserData;
258 string organiserDataCommonName;
259 string organiserDataDirectoryEntry;
260 string organiserDataSentByParam;
261 string organiserDataLanguage;
262 string organiserDataTokens;
264 string recurranceIDData;
265 string recurranceIDDataTimeZoneParam;
266 string recurranceIDDataRangeParam;
267 string recurranceIDDataValue;
268 string recurranceIDDataTokens;
270 vector<string> relatedToData;
271 vector<string> relatedToDataRelationType;
272 vector<string> relatedToDataTokens;
275 string urlDataTokens;
277 vector<string> excludeDateData;
278 vector<string> excludeDateDataValue;
279 vector<string> excludeDateDataTimeZoneParam;
280 vector<string> excludeDateDataTokens;
282 vector<string> recurranceDateData;
283 vector<string> recurranceDateDataValue;
284 vector<string> recurranceDateDataTimeZoneParam;
285 vector<string> recurranceDateDataTokens;
287 string recurranceRuleData;
288 string recurranceRuleDataTokens;
290 string triggerDataList;
291 string triggerDataValue;
292 string triggerDataRelatedParam;
293 string triggerDataTokens;
295 string dateTimeCreatedData;
296 string dateTimeCreatedTokens;
298 string dateTimeStampData;
299 string dateTimeStampTokens;
301 string lastModifiedData;
302 string lastModifiedTokens;
304 int sequenceData = -1;
305 string sequenceTokens;
307 vector<string> xTokensData;
308 vector<string> xTokensDataTokens;
310 vector<string> requestStatusData;
311 vector<string> requestStatusLanguage;
312 vector<string> requestStatusTokens;
314 vector<CalendarAlarmDataStruct> calendarAlarmData;
317 // Initial Loading Data.
318 vector<string> objectName;
319 vector<string> objectData;
321 vector<vector<string>> eventAlarmName;
322 vector<vector<string>> eventAlarmData;
325 virtual void ProcessData() {};