// 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 }; enum CalendarObjectSaveResult { CALENDAROBJECTSAVE_UNITTESTFAIL = -1, CALENDAROBJECTSAVE_OK, CALENDAROBJECTSAVE_CANNOTOPEN }; enum CalendarObjectValidResult{ 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(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() {}; virtual void SaveObjectData(string *saveData) {}; // Object data. 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; string classData; string classDataTokens; string completedData; string completedDataTokens; vector commentList; vector commentListAltRep; vector commentListLanguage; vector commentListTokens; vector descriptionList; vector descriptionListAltRep; vector descriptionListLanguage; vector descriptionListTokens; string geographicData; string geographicTokens; string locationData; string locationDataAltRep; string locationDataLanguage; string locationDataTokens; string percentCompleteData; string percentCompleteTokens; int priorityData = -1; string priorityTokens; vector resourcesData; vector resourcesDataAltRep; vector resourcesDataLanguage; vector resourcesDataTokens; string statusData; string statusLanguage; string statusTokens; string summaryData; string summaryDataAltRep; string summaryDataLanguage; string summaryDataTokens; string dateTimeEndData; string dateTimeEndDataValue; string dateTimeEndDataTimeZoneID; string dateTimeEndDataTokens; string dueData; string dueDataValue; string dueDataTimeZoneID; string dueDataTokens; string dateTimeStartData; string dateTimeStartDataValue; string dateTimeStartDataTimeZoneID; string dateTimeStartDataTokens; string durationData; string durationDataTokens; vector freeBusyList; vector freeBusyListType; vector freeBusyListTokens; 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