X-Git-Url: http://Server1/repobrowser/?p=xestiacalendar%2F.git;a=blobdiff_plain;f=source%2Fobjects%2Fcalendarobject%2FCalendarObject.h;h=1b03eee5573b458d083a2b6f4c422d3993d00847;hp=dfcf448c89730216a5dbeae48f7bf51b99dd7861;hb=49789773e2797383c866dca470fb99e80cb49e41;hpb=089fa36abd90e08c6155f9b2c0bce50a33e146e7 diff --git a/source/objects/calendarobject/CalendarObject.h b/source/objects/calendarobject/CalendarObject.h index dfcf448..1b03eee 100644 --- a/source/objects/calendarobject/CalendarObject.h +++ b/source/objects/calendarobject/CalendarObject.h @@ -1,118 +1,333 @@ +// CalendarObject.h - CalendarObject class header +// +// (c) 2016-2017 Xestia Software Development. +// +// This file is part of Xestia Calendar. +// +// Xestia Calendar is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by the +// Free Software Foundation, version 3 of the license. +// +// Xestia Calendar is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with Xestia Calendar. If not, see + +#ifndef __OBJECTS_CALENDAROBJECT_CALENDAROBJECT_H__ +#define __OBJECTS_CALENDAROBJECT_CALENDAROBJECT_H__ + #include #include #include #include #include +#include +#include + +#include "../../common/text.h" +#include "../../version.h" + +#if defined(WIN32) +#include +#endif using namespace std; enum CalendarObjectLoadResult { - CALENDAROBJECTLOAD_UNITTESTFAIL = -1, - CALENDAROBJECTLOAD_OK, - CALENDAROBJECTLOAD_MISSING, - CALENDAROBJECTLOAD_INVALIDFORMAT, - CALENDAROBJECTLOAD_CANNOTOPEN + CALENDAROBJECTLOAD_UNITTESTFAIL = -1, + CALENDAROBJECTLOAD_OK, + CALENDAROBJECTLOAD_MISSING, + CALENDAROBJECTLOAD_INVALIDFORMAT, + CALENDAROBJECTLOAD_CANNOTOPEN +}; + +enum CalendarObjectSaveResult { + CALENDAROBJECTSAVE_UNITTESTFAIL = -1, + CALENDAROBJECTSAVE_OK, + CALENDAROBJECTSAVE_CANNOTOPEN }; enum CalendarObjectValidResult{ - CALENDAROBJECTVALID_UNITTESTFAIL = -1, - CALENDAROBJECTVALID_OK, - CALENDAROBJECTVALID_INVALIDFORMAT + CALENDAROBJECTVALID_UNITTESTFAIL = -1, + CALENDAROBJECTVALID_OK, + CALENDAROBJECTVALID_INVALIDFORMAT +}; + +enum CalendarAlarmAction{ + CALENDARALARM_UNSPECIFIED = -1, + CALENDARALARM_AUDIO, + CALENDARALARM_DISPLAY, + CALENDARALARM_EMAIL +}; + +struct CalendarAlarmDataStruct{ + + CalendarAlarmAction alarmType = CALENDARALARM_UNSPECIFIED; + + string alarmAction; + string alarmActionTokens; + + string triggerData; + string triggerValue; + string triggerRelated; + string triggerTokens; + + string descriptionData; + string descriptionAltRep; + string descriptionLanguage; + string descriptionTokens; + + string repeatData; + string repeatTokens; + + string summaryData; + string summaryAltRep; + string summaryLanguage; + string summaryTokens; + + vector attendeeList; + vector attendeeListMember; + vector attendeeListDelegatedFrom; + vector attendeeListDelegatedTo; + vector attendeeListRole; + vector attendeeListRSVP; + vector attendeeListDirectoryEntry; + vector attendeeListSentBy; + vector attendeeListCommonName; + vector attendeeListCalendarUserType; + vector attendeeListParticipationStatus; + vector attendeeListLanguage; + vector attendeeListTokens; + + string durationData; + string durationTokens; + + vector attachList; + vector attachListTokens; + vector attachListEncoding; + vector attachListFormatType; + vector attachListValue; + + vector xTokensData; + vector xTokensDataTokens; + }; class CalendarObject{ public: - CalendarObjectLoadResult LoadFile(std::string LoadFilename); - CalendarObjectLoadResult LoadString(std::string *LoadStringData); + CalendarObjectLoadResult LoadFile(string loadFilename); + CalendarObjectLoadResult LoadString(string *loadStringData); + CalendarObjectSaveResult SaveFile(string saveFilename); + CalendarObjectSaveResult SaveString(string *saveStringData); CalendarObjectValidResult ValidBaseObject(); + void ProcessBaseData(); // Setup virtual subroutines for use by objects // inheriting from CalendarObject later on. virtual CalendarObjectValidResult ValidObject() { return CALENDAROBJECTVALID_OK; }; virtual void Clear() {}; - - protected: - // Initial Loading Data. - vector ObjectName; - vector ObjectData; + virtual void SaveObjectData(string *saveData) {}; // Object data. - vector AttachList; - vector AttachListTokens; - vector AttachListEncoding; - vector AttachListValue; + string methodData; + string methodTokens; + + string calendarScaleData; + string calendarScaleTokens; + + string uniqueID; + string uniqueIDTokens; + + vector attachList; + vector attachListTokens; + vector attachListEncoding; + vector attachListFormatType; + vector attachListValue; + + vector categoriesList; + vector categoriesListLanguage; + vector categoriesListTokens; - vector CategoriesList; - vector CategoriesListLanguage; - vector CateogriesListTokens; + string classData; + string classDataTokens; - std::string ClassData; - std::string ClassListTokens; + string completedData; + string completedDataTokens; - vector CommentList; - vector CommentListAltID; - vector CommentListLanguage; - vector CommentListTokens; + vector commentList; + vector commentListAltRep; + vector commentListLanguage; + vector commentListTokens; - vector DescriptionList; - vector DescriptionListAltID; - vector DescriptionListLanguage; - vector DescriptionListTokens; + vector descriptionList; + vector descriptionListAltRep; + vector descriptionListLanguage; + vector descriptionListTokens; - std::string GeographicData; - std::string GeographicTokens; + string geographicData; + string geographicTokens; - std::string LocationData; - std::string LocationDataAltID; + string locationData; + string locationDataAltRep; + string locationDataLanguage; + string locationDataTokens; - std::string PercentCompleteData; - std::string PercentCompleteTokens; + string percentCompleteData; + string percentCompleteTokens; - int PriorityData; - std::string PriorityTokens; + int priorityData = -1; + string priorityTokens; - std::string ResourcesData; - std::string ResourcesDataAltID; - std::string ResourcesDataLanguage; - std::string ResourcesDataTokens; + vector resourcesData; + vector resourcesDataAltRep; + vector resourcesDataLanguage; + vector resourcesDataTokens; - std::string StatusData; - std::string StatusTokens; + string statusData; + string statusLanguage; + string statusTokens; - std::string SummaryData; - std::string SummaryDataAltID; - std::string SummaryDataLanguage; - std::string SummaryDataTokens; + string summaryData; + string summaryDataAltRep; + string summaryDataLanguage; + string summaryDataTokens; - std::string DataTimeEndData; - std::string DataTimeEndDataValue; - std::string DataTimeEndDataTimeZoneID; - std::string DataTimeEndDataTokens; + string dateTimeEndData; + string dateTimeEndDataValue; + string dateTimeEndDataTimeZoneID; + string dateTimeEndDataTokens; - std::string DueData; - std::string DueDataValue; - std::string DueDataTimeZoneID; - std::string DueDataTokens; + string dueData; + string dueDataValue; + string dueDataTimeZoneID; + string dueDataTokens; - std::string DataTimeStartData; - std::string DataTimeStartDataValue; - std::string DataTimeStartDataTimeZoneID; - std::string DataTimeStartDataTokens; + string dateTimeStartData; + string dateTimeStartDataValue; + string dateTimeStartDataTimeZoneID; + string dateTimeStartDataTokens; - std::string DurationData; - std::string DurationDataTokens; + string durationData; + string durationDataTokens; - vector FreeBusyList; - vector FreeBusyListType; - vector FreeBusyListTokens; + vector freeBusyList; + vector freeBusyListType; + vector freeBusyListTokens; - std::string TimeTransparencyData; - std::string TimeTransparencyDataTokens; + string timeTransparencyData; + string timeTransparencyDataTokens; + + string timeZoneData; + string timeZoneDataTokens; + + vector timeZoneNameList; + vector timeZoneNameListLanguage; + vector timeZoneNameListTokens; + + string timeZoneOffsetFromData; + string timeZoneOffsetFromDataTokens; + + string timeZoneOffsetToData; + string timeZoneOffsetToDataTokens; + + string timeZoneURLData; + string timeZoneURLTokens; + + vector attendeeList; + vector attendeeListMember; + vector attendeeListDelegatedFrom; + vector attendeeListDelegatedTo; + vector attendeeListRole; + vector attendeeListRSVP; + vector attendeeListDirectoryEntry; + vector attendeeListSentBy; + vector attendeeListCommonName; + vector attendeeListCalendarUserType; + vector attendeeListParticipationStatus; + vector attendeeListLanguage; + vector attendeeListTokens; + + vector contactList; + vector contactListAltRep; + vector contactListLanguage; + vector contactListTokens; + + string organiserData; + string organiserDataCommonName; + string organiserDataDirectoryEntry; + string organiserDataSentByParam; + string organiserDataLanguage; + string organiserDataTokens; + + string recurranceIDData; + string recurranceIDDataTimeZoneParam; + string recurranceIDDataRangeParam; + string recurranceIDDataValue; + string recurranceIDDataTokens; + + vector relatedToData; + vector relatedToDataRelationType; + vector relatedToDataTokens; + + string urlData; + string urlDataTokens; + vector excludeDateData; + vector excludeDateDataValue; + vector excludeDateDataTimeZoneParam; + vector excludeDateDataTokens; + + vector recurranceDateData; + vector recurranceDateDataValue; + vector recurranceDateDataTimeZoneParam; + vector recurranceDateDataTokens; + + string recurranceRuleData; + string recurranceRuleDataTokens; + + string triggerDataList; + string triggerDataValue; + string triggerDataRelatedParam; + string triggerDataTokens; + + string dateTimeCreatedData; + string dateTimeCreatedTokens; + + string dateTimeStampData; + string dateTimeStampTokens; + + string lastModifiedData; + string lastModifiedTokens; + + int sequenceData = -1; + string sequenceTokens; + + vector xTokensData; + vector xTokensDataTokens; + + vector requestStatusData; + vector requestStatusLanguage; + vector requestStatusTokens; + + vector calendarAlarmData; + + protected: + // Initial Loading Data. + vector objectName; + vector objectData; + + vector> eventAlarmName; + vector> eventAlarmData; + private: virtual void ProcessData() {}; }; + +#endif \ No newline at end of file