Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Win32: implement further UTF8 support
[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 #if defined(WIN32)
34 #include <Windows.h>
35 #endif
37 using namespace std;
39 enum CalendarObjectLoadResult {
40         CALENDAROBJECTLOAD_UNITTESTFAIL = -1,
41         CALENDAROBJECTLOAD_OK,
42         CALENDAROBJECTLOAD_MISSING,
43         CALENDAROBJECTLOAD_INVALIDFORMAT,
44         CALENDAROBJECTLOAD_CANNOTOPEN
45 };
47 enum CalendarObjectSaveResult {
48         CALENDAROBJECTSAVE_UNITTESTFAIL = -1,
49         CALENDAROBJECTSAVE_OK,
50         CALENDAROBJECTSAVE_CANNOTOPEN
51 };
53 enum CalendarObjectValidResult{
54         CALENDAROBJECTVALID_UNITTESTFAIL = -1,
55         CALENDAROBJECTVALID_OK,
56         CALENDAROBJECTVALID_INVALIDFORMAT
57 };
59 enum CalendarAlarmAction{
60         CALENDARALARM_UNSPECIFIED = -1,
61         CALENDARALARM_AUDIO,
62         CALENDARALARM_DISPLAY,
63         CALENDARALARM_EMAIL
64 };
66 struct CalendarAlarmDataStruct{
67         
68         CalendarAlarmAction alarmType = CALENDARALARM_UNSPECIFIED;
69         
70         string alarmAction;
71         string alarmActionTokens;
72         
73         string triggerData;
74         string triggerValue;
75         string triggerRelated;
76         string triggerTokens;
77         
78         string descriptionData;
79         string descriptionAltRep;
80         string descriptionLanguage;
81         string descriptionTokens;
82         
83         string repeatData;
84         string repeatTokens;
85         
86         string summaryData;
87         string summaryAltRep;
88         string summaryLanguage;
89         string summaryTokens;
90         
91         vector<string> attendeeList;
92         vector<string> attendeeListMember;
93         vector<string> attendeeListDelegatedFrom;
94         vector<string> attendeeListDelegatedTo;
95         vector<string> attendeeListRole;
96         vector<string> attendeeListRSVP;
97         vector<string> attendeeListDirectoryEntry;
98         vector<string> attendeeListSentBy;
99         vector<string> attendeeListCommonName;
100         vector<string> attendeeListCalendarUserType;
101         vector<string> attendeeListParticipationStatus;
102         vector<string> attendeeListLanguage;
103         vector<string> attendeeListTokens;
104         
105         string durationData;
106         string durationTokens;
107         
108         vector<string> attachList;
109         vector<string> attachListTokens;
110         vector<string> attachListEncoding;
111         vector<string> attachListFormatType;
112         vector<string> attachListValue;
113         
114         vector<string> xTokensData;
115         vector<string> xTokensDataTokens;
116         
117 };
119 class CalendarObject{
121         public:
122         CalendarObjectLoadResult LoadFile(string loadFilename);
123         CalendarObjectLoadResult LoadString(string *loadStringData);
124         CalendarObjectSaveResult SaveFile(string saveFilename);
125         CalendarObjectSaveResult SaveString(string *saveStringData);
126         CalendarObjectValidResult ValidBaseObject();
127         void ProcessBaseData();
128         
129         // Setup virtual subroutines for use by objects
130         // inheriting from CalendarObject later on.
131         
132         virtual CalendarObjectValidResult ValidObject() { return CALENDAROBJECTVALID_OK; };
133         virtual void Clear() {};
134         virtual void SaveObjectData(string *saveData) {};
135         
136         // Object data.
137         
138         string methodData;
139         string methodTokens;
140         
141         string calendarScaleData;
142         string calendarScaleTokens;
143         
144         string uniqueID;
145         string uniqueIDTokens;
146         
147         vector<string> attachList;
148         vector<string> attachListTokens;
149         vector<string> attachListEncoding;
150         vector<string> attachListFormatType;
151         vector<string> attachListValue;
152         
153         vector<string> categoriesList;
154         vector<string> categoriesListLanguage;
155         vector<string> categoriesListTokens;
156         
157         string classData;
158         string classDataTokens;
159         
160         string completedData;
161         string completedDataTokens;
162         
163         vector<string> commentList;
164         vector<string> commentListAltRep;
165         vector<string> commentListLanguage;
166         vector<string> commentListTokens;
167         
168         vector<string> descriptionList;
169         vector<string> descriptionListAltRep;
170         vector<string> descriptionListLanguage;
171         vector<string> descriptionListTokens;
172         
173         string geographicData;
174         string geographicTokens;
175         
176         string locationData;
177         string locationDataAltRep;
178         string locationDataLanguage;
179         string locationDataTokens;
180         
181         string percentCompleteData;
182         string percentCompleteTokens;
183         
184         int priorityData = -1;
185         string priorityTokens;
186         
187         vector<string> resourcesData;
188         vector<string> resourcesDataAltRep;
189         vector<string> resourcesDataLanguage;
190         vector<string> resourcesDataTokens;
192         string statusData;
193         string statusLanguage;
194         string statusTokens;
195         
196         string summaryData;
197         string summaryDataAltRep;
198         string summaryDataLanguage;
199         string summaryDataTokens;
200         
201         string dateTimeEndData;
202         string dateTimeEndDataValue;
203         string dateTimeEndDataTimeZoneID;
204         string dateTimeEndDataTokens;
206         string dueData;
207         string dueDataValue;
208         string dueDataTimeZoneID;
209         string dueDataTokens;
211         string dateTimeStartData;
212         string dateTimeStartDataValue;
213         string dateTimeStartDataTimeZoneID;
214         string dateTimeStartDataTokens;
216         string durationData;
217         string durationDataTokens;
219         vector<string> freeBusyList;
220         vector<string> freeBusyListType;
221         vector<string> freeBusyListTokens;
223         string timeTransparencyData;
224         string timeTransparencyDataTokens;
225         
226         string timeZoneData;
227         string timeZoneDataTokens;
228         
229         vector<string> timeZoneNameList;
230         vector<string> timeZoneNameListLanguage;
231         vector<string> timeZoneNameListTokens;
232         
233         string timeZoneOffsetFromData;
234         string timeZoneOffsetFromDataTokens;
236         string timeZoneOffsetToData;
237         string timeZoneOffsetToDataTokens;
239         string timeZoneURLData;
240         string timeZoneURLTokens;
242         vector<string> attendeeList;
243         vector<string> attendeeListMember;
244         vector<string> attendeeListDelegatedFrom;
245         vector<string> attendeeListDelegatedTo;
246         vector<string> attendeeListRole;
247         vector<string> attendeeListRSVP;
248         vector<string> attendeeListDirectoryEntry;
249         vector<string> attendeeListSentBy;
250         vector<string> attendeeListCommonName;
251         vector<string> attendeeListCalendarUserType;
252         vector<string> attendeeListParticipationStatus;
253         vector<string> attendeeListLanguage;
254         vector<string> attendeeListTokens;
256         vector<string> contactList;
257         vector<string> contactListAltRep;
258         vector<string> contactListLanguage;
259         vector<string> contactListTokens;
260         
261         string organiserData;
262         string organiserDataCommonName;
263         string organiserDataDirectoryEntry;
264         string organiserDataSentByParam;
265         string organiserDataLanguage;
266         string organiserDataTokens;
267         
268         string recurranceIDData;
269         string recurranceIDDataTimeZoneParam;
270         string recurranceIDDataRangeParam;
271         string recurranceIDDataValue;
272         string recurranceIDDataTokens;
273         
274         vector<string> relatedToData;
275         vector<string> relatedToDataRelationType;
276         vector<string> relatedToDataTokens;
277         
278         string urlData;
279         string urlDataTokens;
281         vector<string> excludeDateData;
282         vector<string> excludeDateDataValue;
283         vector<string> excludeDateDataTimeZoneParam;
284         vector<string> excludeDateDataTokens;
285         
286         vector<string> recurranceDateData;
287         vector<string> recurranceDateDataValue;
288         vector<string> recurranceDateDataTimeZoneParam;
289         vector<string> recurranceDateDataTokens;
290         
291         string recurranceRuleData;
292         string recurranceRuleDataTokens;
293         
294         string triggerDataList;
295         string triggerDataValue;
296         string triggerDataRelatedParam;
297         string triggerDataTokens;
298         
299         string dateTimeCreatedData;
300         string dateTimeCreatedTokens;
302         string dateTimeStampData;
303         string dateTimeStampTokens;
305         string lastModifiedData;
306         string lastModifiedTokens;
308         int sequenceData = -1;
309         string sequenceTokens;
311         vector<string> xTokensData;
312         vector<string> xTokensDataTokens;
314         vector<string> requestStatusData;
315         vector<string> requestStatusLanguage;
316         vector<string> requestStatusTokens;
317         
318         vector<CalendarAlarmDataStruct> calendarAlarmData;
319         
320         protected:
321         // Initial Loading Data.
322         vector<string> objectName;
323         vector<string> objectData;
324         
325         vector<vector<string>> eventAlarmName;
326         vector<vector<string>> eventAlarmData;
327         
328         private:
329         virtual void ProcessData() {};
330   
331 };
333 #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