Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added initial functions for CardDAV
[xestiacalendar/.git] / source / objects / CalDAV / CalDAV.h
1 // CalDAV.h - CalDAV Connection Object header.
2 //
3 // (c) 2016 Xestia Software Development.
4 //
5 // This file is part of Xestia Calendar.
6 //
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
10 //
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
19 #ifndef __OBJECTS_CALDAV_CALDAV_H__
20 #define __OBJECTS_CALDAV_CALDAV_H__
22 #include <curl/curl.h>
23 #include <string>
25 using namespace std;
27 // CalDAVConnectionData: used for
28 // connecting to the server.
30 enum CalDAVQueryResult {
31         CALDAVQUERYRESULT_UNITTESTFAIL = -1,
32         CALDAVQUERYRESULT_OK,
33         CALDAVQUERYRESULT_NOTRUN,
34         CALDAVQUERYRESULT_SERVERERROR
35 };
37 struct CalDAVConnectionData{
38         
39         string Hostname = "";
40         int Port = 8008;
41         string Username = "";
42         string Password = "";
43         string Prefix = "";
44         bool UseSSL = true;
45         
46 };
48 // CalDAVStatusData: used for
49 // getting the current server
50 // settings for the CalDAV
51 // object.
53 struct CalDAVStatus{
55         string Hostname;
56         int Port;
57         string Username;
58         string Prefix;
59         bool UseSSL;    
61 };
63 // CalDAVServerResult: used for
64 // getting the result of the
65 // request made via the CalDAV
66 // object.
68 struct CalDAVServerResult{
70         CalDAVQueryResult Result = CALDAVQUERYRESULT_NOTRUN;
71         CURLcode Code = CURLE_OK;
72         long HTTPCode = 0;
73         
74 };
76 class CalDAV{
78         private:
79                 CalDAVConnectionData ConnectionData;
80                 CURL *ConnectionHandle = nullptr;
81         
82         public:
83                 void SetupConnectionData(CalDAVConnectionData *ConnData);
84                 CalDAVStatus GetConnectionData();
85                 CalDAVServerResult Connect();
86                 CalDAV();
87                 ~CalDAV();
88         
89 };
91 // Subroutines that are used with the 
92 // CalDAVConnectionData struct.
94 bool CalDAVObjectValidSettings(CalDAVConnectionData *ConnData);
96 #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