Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added Unit tests for the Colour struct.
[xestiacalendar/.git] / source / objects / CalDAV / CalDAV.h
index d527541..cbe065a 100644 (file)
 #define __OBJECTS_CALDAV_CALDAV_H__
 
 #include <curl/curl.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
 #include <string>
 #include <iostream>
 #include <vector>
 #include <stdexcept>
+#include <map>
+#include "../../common/colour.h"
+#include "../../common/text.h"
+#include "../../common/uuid.h"
 
 using namespace std;
 
@@ -37,6 +43,17 @@ enum CalDAVQueryResult {
        CALDAVQUERYRESULT_SERVERERROR
 };
 
+struct CalDAVCalendarList {
+
+       map<int,string> Name;
+       map<int,string> HREF;
+       map<int,int> Order;
+       map<int,string> Description;
+       map<int,Colour> CalColour;
+       map<int,string> Tag;
+       
+};
+
 struct CalDAVConnectionData{
        
        string Hostname = "";
@@ -90,21 +107,45 @@ struct CalDAVServerResult{
        
 };
 
+// CalDAVSendData: used for
+// sending data to the CaLDAV
+// server.
+
+struct CalDAVSendData{
+       string *readptr;
+       long sizeleft;
+       int seek = 0;
+};
+
 class CalDAV{
 
        private:
+               string ProcessXMLUserPrincipal();
+               string ProcessXMLCalendarHome();
+               CalDAVCalendarList ProcessXMLCalendarList();
+               bool MatchXMLNameTransverse(xmlNodePtr *NodePtr, string NodeName);
+               bool MatchXMLName(xmlNodePtr *NodePtrOriginal, string NodeName);
+               string FetchXMLData(xmlNodePtr *NodePtr);
+       
                CalDAVConnectionData ConnectionData;
+               CalDAVServerResult ConnectionServerResult;
                CURL *ConnectionHandle = nullptr;
                string ServerData = "";
                string ServerHeader = "";
        
        public:
+               CalDAV();
+               ~CalDAV();
                void SetupConnectionData(CalDAVConnectionData *ConnData);
                CalDAVStatus GetConnectionData();
                CalDAVServerResult Connect();
+               CalDAVServerResult GetServerResult();
                CalDAVServerSupport GetServerSupport();
-               CalDAV();
-               ~CalDAV();
+               CalDAVCalendarList GetCalendars();
+               CalDAVServerResult AddCalendar(string CalendarName);
+       
+               string GetUserPrincipal();
+               string GetCalendarHome(string UserPrincipalURI);
        
 };
 
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