X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fobjects%2FCalDAV%2FCalDAV.h;h=148f2d07728b9b50278c5a3822a6cb99afc5c79d;hb=9bb29a2ad6d50014c8bb9b54cb40c8efb1ec75e9;hp=9e9d5533618f4d88e9d3dd1d2a570febf1ef4b53;hpb=8916c05c5281bf0c97419df6e7ce6d641c56fb3e;p=xestiacalendar%2F.git diff --git a/source/objects/CalDAV/CalDAV.h b/source/objects/CalDAV/CalDAV.h index 9e9d553..148f2d0 100644 --- a/source/objects/CalDAV/CalDAV.h +++ b/source/objects/CalDAV/CalDAV.h @@ -1,14 +1,14 @@ // CalDAV.h - CalDAV Connection Object header. // -// (c) 2016 Xestia Software Development. +// (c) 2016-2017 Xestia Software Development. // // This file is part of Xestia Calendar. // -// Xestia Address Book is free software: you can redistribute it and/or modify +// 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 Address Book is distributed in the hope that it will be useful, +// 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. @@ -45,24 +45,33 @@ enum CalDAVQueryResult { struct CalDAVCalendarList { - map Name; - map HREF; - map Order; - map Description; - map CalColour; - map Tag; + map name; + map href; + map order; + map description; + map calColour; + map tag; + map tagURL; + +}; + +struct CalDAVEntryList { + + map href; + map data; + map tag; }; struct CalDAVConnectionData{ - string Hostname = ""; - int Port = 8008; - string Username = ""; - string Password = ""; - string Prefix = ""; - bool UseSSL = true; - int Timeout = 60; + string hostname = ""; + int port = 8008; + string username = ""; + string password = ""; + string prefix = ""; + bool useSSL = true; + int timeout = 60; }; @@ -73,12 +82,12 @@ struct CalDAVConnectionData{ struct CalDAVStatus{ - string Hostname; - int Port; - string Username; - string Prefix; - bool UseSSL; - int Timeout; + string hostname; + int port; + string username; + string prefix; + bool useSSL; + int timeout; }; @@ -90,7 +99,7 @@ struct CalDAVServerSupport{ // Variable name. Name in CalDAV header. - bool BasicSupport = false; // calendar-access + bool basicSupport = false; // calendar-access }; @@ -101,9 +110,9 @@ struct CalDAVServerSupport{ struct CalDAVServerResult{ - CalDAVQueryResult Result = CALDAVQUERYRESULT_NOTRUN; - CURLcode Code = CURLE_OK; - long HTTPCode = 0; + CalDAVQueryResult result = CALDAVQUERYRESULT_NOTRUN; + CURLcode code = CURLE_OK; + long httpCode = 0; }; @@ -123,54 +132,70 @@ class CalDAV{ string ProcessXMLUserPrincipal(); string ProcessXMLCalendarHome(); CalDAVCalendarList ProcessXMLCalendarList(); - bool MatchXMLNameTransverse(xmlNodePtr *NodePtr, string NodeName); - bool MatchXMLName(xmlNodePtr *NodePtrOriginal, string NodeName); - string FetchXMLData(xmlNodePtr *NodePtr); - CalDAVServerResult EditCalendarProcess(string *CalendarHREF, - string *CalendarName, - Colour *CalendarColour, - string *CalendarDescription, - int *CalendarOrder); + CalDAVEntryList ProcessXMLEntryList(); + CalDAVEntryList ProcessXMLSyncTokenList(); + string ProcessXMLEntryETag(); + bool MatchXMLNameTransverse(xmlNodePtr *nodePtr, string nodeName); + bool MatchXMLName(xmlNodePtr *nodePtrOriginal, string nodeName); + string FetchXMLData(xmlNodePtr *nodePtr); + CalDAVServerResult EditCalendarProcess(string *calendarHREF, + string *calendarName, + Colour *calendarColour, + string *calendarDescription, + int *calendarOrder); - CalDAVConnectionData ConnectionData; - CalDAVServerResult ConnectionServerResult; - CURL *ConnectionHandle = nullptr; - string ServerData = ""; - string ServerHeader = ""; + CalDAVConnectionData connectionData; + CalDAVServerResult connectionServerResult; + CURL *connectionHandle = nullptr; + string serverData = ""; + string serverHeader = ""; public: CalDAV(); ~CalDAV(); - void SetupConnectionData(CalDAVConnectionData *ConnData); + void SetupConnectionData(CalDAVConnectionData *connData); CalDAVStatus GetConnectionData(); CalDAVServerResult Connect(); CalDAVServerResult GetServerResult(); CalDAVServerSupport GetServerSupport(); CalDAVCalendarList GetCalendars(); - CalDAVServerResult AddCalendar(string CalendarName); + CalDAVEntryList GetEntryList(string *calendarHREF); + CalDAVEntryList GetEntryList(string *calendarHREF, string *calendarTag); + + CalDAVServerResult AddCalendar(string calendarName); + CalDAVServerResult AddCalendar(string *calendarName, string *calendarShortName); + + CalDAVServerResult EditCalendar(string *calendarHREF, + string *calendarName, + Colour *calendarColour, + string *calendarDescription, + int *calendarOrder); + CalDAVServerResult EditCalendar(string *calendarHREF, + Colour *calendarColour); + CalDAVServerResult EditCalendar(string *calendarHREF, + string *calendarName); + CalDAVServerResult EditCalendar(string *calendarHREF, + int *calendarOrder); + CalDAVServerResult EditCalendarDescription(string *calendarHREF, + string *calendarDescription); + + CalDAVServerResult DeleteCalendar(string *calendarHREF); + + CalDAVServerResult AddEntry(string *calendarEntryHREF, string *entryData); + CalDAVServerResult EditEntry(string *calendarEntryHREF, string *entryData, string *entryETag); + CalDAVServerResult DeleteEntry(string *calendarEntryHREF); - CalDAVServerResult EditCalendar(string *CalendarHREF, - string *CalendarName, - Colour *CalendarColour, - string *CalendarDescription, - int *CalendarOrder); - CalDAVServerResult EditCalendar(string *CalendarHREF, - Colour *CalendarColour); - CalDAVServerResult EditCalendar(string *CalendarHREF, - string *CalendarName); - CalDAVServerResult EditCalendar(string *CalendarHREF, - int *CalendarOrder); - CalDAVServerResult EditCalendarDescription(string *CalendarHREF, - string *CalendarDescription); string GetUserPrincipal(); - string GetCalendarHome(string UserPrincipalURI); + string GetCalendarHome(string userPrincipalURI); + + CalDAVServerResult GetEntryETag(string *calendarEntryHREF, string *eTagValue); }; // Subroutines that are used with the // CalDAVConnectionData struct. -bool CalDAVObjectValidSettings(CalDAVConnectionData *ConnData); -string BuildServerAddress(CalDAVConnectionData *ConnData, string URIAddress); +bool CalDAVObjectValidSettings(CalDAVConnectionData *connData); +string BuildServerAddress(CalDAVConnectionData *connData, string uriAddress); #endif