Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added code and unit tests to list calendars from the server.
[xestiacalendar/.git] / source / objects / calendarobject / CalendarObject.h
1 #ifndef __OBJECTS_CALENDAROBJECT_CALENDAROBJECT_H__
2 #define __OBJECTS_CALENDAROBJECT_CALENDAROBJECT_H__
4 #include <string>
5 #include <iostream>
6 #include <fstream>
7 #include <sstream>
8 #include <vector>
9 #include <stdexcept>
10 #include <map>
12 #include "../../common/text.h"
14 using namespace std;
16 enum CalendarObjectLoadResult {
17         CALENDAROBJECTLOAD_UNITTESTFAIL = -1,
18         CALENDAROBJECTLOAD_OK,
19         CALENDAROBJECTLOAD_MISSING,
20         CALENDAROBJECTLOAD_INVALIDFORMAT,
21         CALENDAROBJECTLOAD_CANNOTOPEN
22 };
24 enum CalendarObjectValidResult{
25         CALENDAROBJECTVALID_UNITTESTFAIL = -1,
26         CALENDAROBJECTVALID_OK,
27         CALENDAROBJECTVALID_INVALIDFORMAT
28 };
30 enum CalendarAlarmAction{
31         CALENDARALARM_UNSPECIFIED = -1,
32         CALENDARALARM_AUDIO,
33         CALENDARALARM_DISPLAY,
34         CALENDARALARM_EMAIL
35 };
37 struct CalendarAlarmDataStruct{
38         
39         CalendarAlarmAction AlarmType = CALENDARALARM_UNSPECIFIED;
40         
41         string AlarmAction;
42         string AlarmActionTokens;
43         
44         string TriggerData;
45         string TriggerValue;
46         string TriggerRelated;
47         string TriggerTokens;
48         
49         string DescriptionData;
50         string DescriptionAltRep;
51         string DescriptionLanguage;
52         string DescriptionTokens;
53         
54         string RepeatData;
55         string RepeatTokens;
56         
57         string SummaryData;
58         string SummaryAltRep;
59         string SummaryLanguage;
60         string SummaryTokens;
61         
62         vector<string> AttendeeList;
63         vector<string> AttendeeListMember;
64         vector<string> AttendeeListDelegatedFrom;
65         vector<string> AttendeeListDelegatedTo;
66         vector<string> AttendeeListRole;
67         vector<string> AttendeeListRSVP;
68         vector<string> AttendeeListDirectoryEntry;
69         vector<string> AttendeeListSentBy;
70         vector<string> AttendeeListCommonName;
71         vector<string> AttendeeListCalendarUserType;
72         vector<string> AttendeeListParticipationStatus;
73         vector<string> AttendeeListLanguage;
74         vector<string> AttendeeListTokens;
75         
76         string DurationData;
77         string DurationTokens;
78         
79         vector<string> AttachList;
80         vector<string> AttachListTokens;
81         vector<string> AttachListEncoding;
82         vector<string> AttachListFormatType;
83         vector<string> AttachListValue;
84         
85         vector<string> XTokensData;
86         vector<string> XTokensDataTokens;
87         
88 };
90 class CalendarObject{
92         public:
93         CalendarObjectLoadResult LoadFile(string LoadFilename);
94         CalendarObjectLoadResult LoadString(string *LoadStringData);
95         CalendarObjectValidResult ValidBaseObject();
96         void ProcessBaseData();
97         
98         // Setup virtual subroutines for use by objects
99         // inheriting from CalendarObject later on.
100         
101         virtual CalendarObjectValidResult ValidObject() { return CALENDAROBJECTVALID_OK; };
102         virtual void Clear() {};
103         
104         // Object data.
105         
106         string MethodData;
107         string MethodTokens;
108         
109         string CalendarScaleData;
110         string CalendarScaleTokens;
111         
112         string UniqueID;
113         string UniqueIDTokens;
114         
115         vector<string> AttachList;
116         vector<string> AttachListTokens;
117         vector<string> AttachListEncoding;
118         vector<string> AttachListFormatType;
119         vector<string> AttachListValue;
120         
121         vector<string> CategoriesList;
122         vector<string> CategoriesListLanguage;
123         vector<string> CategoriesListTokens;
124         
125         string ClassData;
126         string ClassDataTokens;
127         
128         string CompletedData;
129         string CompletedDataTokens;
130         
131         vector<string> CommentList;
132         vector<string> CommentListAltRep;
133         vector<string> CommentListLanguage;
134         vector<string> CommentListTokens;
135         
136         vector<string> DescriptionList;
137         vector<string> DescriptionListAltRep;
138         vector<string> DescriptionListLanguage;
139         vector<string> DescriptionListTokens;
140         
141         string GeographicData;
142         string GeographicTokens;
143         
144         string LocationData;
145         string LocationDataAltRep;
146         string LocationDataLanguage;
147         string LocationDataTokens;
148         
149         string PercentCompleteData;
150         string PercentCompleteTokens;
151         
152         int PriorityData = -1;
153         string PriorityTokens;
154         
155         vector<string> ResourcesData;
156         vector<string> ResourcesDataAltRep;
157         vector<string> ResourcesDataLanguage;
158         vector<string> ResourcesDataTokens;
160         string StatusData;
161         string StatusLanguage;
162         string StatusTokens;
163         
164         string SummaryData;
165         string SummaryDataAltRep;
166         string SummaryDataLanguage;
167         string SummaryDataTokens;
168         
169         string DateTimeEndData;
170         string DateTimeEndDataValue;
171         string DateTimeEndDataTimeZoneID;
172         string DateTimeEndDataTokens;
174         string DueData;
175         string DueDataValue;
176         string DueDataTimeZoneID;
177         string DueDataTokens;
179         string DateTimeStartData;
180         string DateTimeStartDataValue;
181         string DateTimeStartDataTimeZoneID;
182         string DateTimeStartDataTokens;
184         string DurationData;
185         string DurationDataTokens;
187         vector<string> FreeBusyList;
188         vector<string> FreeBusyListType;
189         vector<string> FreeBusyListTokens;
191         string TimeTransparencyData;
192         string TimeTransparencyDataTokens;
193         
194         string TimeZoneData;
195         string TimeZoneDataTokens;
196         
197         vector<string> TimeZoneNameList;
198         vector<string> TimeZoneNameListLanguage;
199         vector<string> TimeZoneNameListTokens;
200         
201         string TimeZoneOffsetFromData;
202         string TimeZoneOffsetFromDataTokens;
204         string TimeZoneOffsetToData;
205         string TimeZoneOffsetToDataTokens;
207         string TimeZoneURLData;
208         string TimeZoneURLTokens;
210         vector<string> AttendeeList;
211         vector<string> AttendeeListMember;
212         vector<string> AttendeeListDelegatedFrom;
213         vector<string> AttendeeListDelegatedTo;
214         vector<string> AttendeeListRole;
215         vector<string> AttendeeListRSVP;
216         vector<string> AttendeeListDirectoryEntry;
217         vector<string> AttendeeListSentBy;
218         vector<string> AttendeeListCommonName;
219         vector<string> AttendeeListCalendarUserType;
220         vector<string> AttendeeListParticipationStatus;
221         vector<string> AttendeeListLanguage;
222         vector<string> AttendeeListTokens;
224         vector<string> ContactList;
225         vector<string> ContactListAltRep;
226         vector<string> ContactListLanguage;
227         vector<string> ContactListTokens;
228         
229         string OrganiserData;
230         string OrganiserDataCommonName;
231         string OrganiserDataDirectoryEntry;
232         string OrganiserDataSentByParam;
233         string OrganiserDataLanguage;
234         string OrganiserDataTokens;
235         
236         string RecurranceIDData;
237         string RecurranceIDDataTimeZoneParam;
238         string RecurranceIDDataRangeParam;
239         string RecurranceIDDataValue;
240         string RecurranceIDDataTokens;
241         
242         vector<string> RelatedToData;
243         vector<string> RelatedToDataRelationType;
244         vector<string> RelatedToDataTokens;
245         
246         string URLData;
247         string URLDataTokens;
249         vector<string> ExcludeDateData;
250         vector<string> ExcludeDateDataValue;
251         vector<string> ExcludeDateDataTimeZoneParam;
252         vector<string> ExcludeDateDataTokens;
253         
254         vector<string> RecurranceDateData;
255         vector<string> RecurranceDateDataValue;
256         vector<string> RecurranceDateDataTimeZoneParam;
257         vector<string> RecurranceDateDataTokens;
258         
259         string RecurranceRuleData;
260         string RecurranceRuleDataTokens;
261         
262         string TriggerDataList;
263         string TriggerDataValue;
264         string TriggerDataRelatedParam;
265         string TriggerDataTokens;
266         
267         string DateTimeCreatedData;
268         string DateTimeCreatedTokens;
270         string DateTimeStampData;
271         string DateTimeStampTokens;
273         string LastModifiedData;
274         string LastModifiedTokens;
276         int SequenceData = -1;
277         string SequenceTokens;
279         vector<string> XTokensData;
280         vector<string> XTokensDataTokens;
282         vector<string> RequestStatusData;
283         vector<string> RequestStatusLanguage;
284         vector<string> RequestStatusTokens;
285         
286         vector<CalendarAlarmDataStruct> CalendarAlarmData;
287         
288         protected:
289         // Initial Loading Data.
290         vector<string> ObjectName;
291         vector<string> ObjectData;
292         
293         vector<vector<string>> EventAlarmName;
294         vector<vector<string>> EventAlarmData;
295         
296         private:
297         virtual void ProcessData() {};
298   
299 };
301 #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