Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
camelCase: Converted code in calendarobject directory
[xestiacalendar/.git] / source / objects / calendarobject / CalendarObject.h
1 // CalendarObject.h - CalendarObject class header
2 //
3 // (c) 2016-2017 Xestia Software Development.
4 //
5 // This file is part of Xestia Calendar.
6 //
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.
10 //
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.
15 //
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__
22 #include <string>
23 #include <iostream>
24 #include <fstream>
25 #include <sstream>
26 #include <vector>
27 #include <stdexcept>
28 #include <map>
30 #include "../../common/text.h"
31 #include "../../version.h"
33 using namespace std;
35 enum CalendarObjectLoadResult {
36         CALENDAROBJECTLOAD_UNITTESTFAIL = -1,
37         CALENDAROBJECTLOAD_OK,
38         CALENDAROBJECTLOAD_MISSING,
39         CALENDAROBJECTLOAD_INVALIDFORMAT,
40         CALENDAROBJECTLOAD_CANNOTOPEN
41 };
43 enum CalendarObjectSaveResult {
44         CALENDAROBJECTSAVE_UNITTESTFAIL = -1,
45         CALENDAROBJECTSAVE_OK,
46         CALENDAROBJECTSAVE_CANNOTOPEN
47 };
49 enum CalendarObjectValidResult{
50         CALENDAROBJECTVALID_UNITTESTFAIL = -1,
51         CALENDAROBJECTVALID_OK,
52         CALENDAROBJECTVALID_INVALIDFORMAT
53 };
55 enum CalendarAlarmAction{
56         CALENDARALARM_UNSPECIFIED = -1,
57         CALENDARALARM_AUDIO,
58         CALENDARALARM_DISPLAY,
59         CALENDARALARM_EMAIL
60 };
62 struct CalendarAlarmDataStruct{
63         
64         CalendarAlarmAction alarmType = CALENDARALARM_UNSPECIFIED;
65         
66         string alarmAction;
67         string alarmActionTokens;
68         
69         string triggerData;
70         string triggerValue;
71         string triggerRelated;
72         string triggerTokens;
73         
74         string descriptionData;
75         string descriptionAltRep;
76         string descriptionLanguage;
77         string descriptionTokens;
78         
79         string repeatData;
80         string repeatTokens;
81         
82         string summaryData;
83         string summaryAltRep;
84         string summaryLanguage;
85         string summaryTokens;
86         
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;
100         
101         string durationData;
102         string durationTokens;
103         
104         vector<string> attachList;
105         vector<string> attachListTokens;
106         vector<string> attachListEncoding;
107         vector<string> attachListFormatType;
108         vector<string> attachListValue;
109         
110         vector<string> xTokensData;
111         vector<string> xTokensDataTokens;
112         
113 };
115 class CalendarObject{
117         public:
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();
124         
125         // Setup virtual subroutines for use by objects
126         // inheriting from CalendarObject later on.
127         
128         virtual CalendarObjectValidResult ValidObject() { return CALENDAROBJECTVALID_OK; };
129         virtual void Clear() {};
130         virtual void SaveObjectData(string *saveData) {};
131         
132         // Object data.
133         
134         string methodData;
135         string methodTokens;
136         
137         string calendarScaleData;
138         string calendarScaleTokens;
139         
140         string uniqueID;
141         string uniqueIDTokens;
142         
143         vector<string> attachList;
144         vector<string> attachListTokens;
145         vector<string> attachListEncoding;
146         vector<string> attachListFormatType;
147         vector<string> attachListValue;
148         
149         vector<string> categoriesList;
150         vector<string> categoriesListLanguage;
151         vector<string> categoriesListTokens;
152         
153         string classData;
154         string classDataTokens;
155         
156         string completedData;
157         string completedDataTokens;
158         
159         vector<string> commentList;
160         vector<string> commentListAltRep;
161         vector<string> commentListLanguage;
162         vector<string> commentListTokens;
163         
164         vector<string> descriptionList;
165         vector<string> descriptionListAltRep;
166         vector<string> descriptionListLanguage;
167         vector<string> descriptionListTokens;
168         
169         string geographicData;
170         string geographicTokens;
171         
172         string locationData;
173         string locationDataAltRep;
174         string locationDataLanguage;
175         string locationDataTokens;
176         
177         string percentCompleteData;
178         string percentCompleteTokens;
179         
180         int priorityData = -1;
181         string priorityTokens;
182         
183         vector<string> resourcesData;
184         vector<string> resourcesDataAltRep;
185         vector<string> resourcesDataLanguage;
186         vector<string> resourcesDataTokens;
188         string statusData;
189         string statusLanguage;
190         string statusTokens;
191         
192         string summaryData;
193         string summaryDataAltRep;
194         string summaryDataLanguage;
195         string summaryDataTokens;
196         
197         string dateTimeEndData;
198         string dateTimeEndDataValue;
199         string dateTimeEndDataTimeZoneID;
200         string dateTimeEndDataTokens;
202         string dueData;
203         string dueDataValue;
204         string dueDataTimeZoneID;
205         string dueDataTokens;
207         string dateTimeStartData;
208         string dateTimeStartDataValue;
209         string dateTimeStartDataTimeZoneID;
210         string dateTimeStartDataTokens;
212         string durationData;
213         string durationDataTokens;
215         vector<string> freeBusyList;
216         vector<string> freeBusyListType;
217         vector<string> freeBusyListTokens;
219         string timeTransparencyData;
220         string timeTransparencyDataTokens;
221         
222         string timeZoneData;
223         string timeZoneDataTokens;
224         
225         vector<string> timeZoneNameList;
226         vector<string> timeZoneNameListLanguage;
227         vector<string> timeZoneNameListTokens;
228         
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;
256         
257         string organiserData;
258         string organiserDataCommonName;
259         string organiserDataDirectoryEntry;
260         string organiserDataSentByParam;
261         string organiserDataLanguage;
262         string organiserDataTokens;
263         
264         string recurranceIDData;
265         string recurranceIDDataTimeZoneParam;
266         string recurranceIDDataRangeParam;
267         string recurranceIDDataValue;
268         string recurranceIDDataTokens;
269         
270         vector<string> relatedToData;
271         vector<string> relatedToDataRelationType;
272         vector<string> relatedToDataTokens;
273         
274         string urlData;
275         string urlDataTokens;
277         vector<string> excludeDateData;
278         vector<string> excludeDateDataValue;
279         vector<string> excludeDateDataTimeZoneParam;
280         vector<string> excludeDateDataTokens;
281         
282         vector<string> recurranceDateData;
283         vector<string> recurranceDateDataValue;
284         vector<string> recurranceDateDataTimeZoneParam;
285         vector<string> recurranceDateDataTokens;
286         
287         string recurranceRuleData;
288         string recurranceRuleDataTokens;
289         
290         string triggerDataList;
291         string triggerDataValue;
292         string triggerDataRelatedParam;
293         string triggerDataTokens;
294         
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;
313         
314         vector<CalendarAlarmDataStruct> calendarAlarmData;
315         
316         protected:
317         // Initial Loading Data.
318         vector<string> objectName;
319         vector<string> objectData;
320         
321         vector<vector<string>> eventAlarmName;
322         vector<vector<string>> eventAlarmData;
323         
324         private:
325         virtual void ProcessData() {};
326   
327 };
329 #endif
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy