4 #include <libxml/parser.h>
5 #include <libxml/tree.h>
7 #include "../vcard/vcard.h"
8 #include "../frmActivityMgr.h"
9 #include "../common/sslcertstructs.h"
11 #ifndef CALDAV_CALDAV_H
12 #define CALDAV_CALDAV_H
15 unsigned int DataFlag:2;
19 struct ContactListData{
21 std::map<wxString,FileSyncData> ListData;
24 /*struct CertificateData{
25 std::multimap<wxString,wxString> CertificateData;
30 struct CertificateCollection{
31 std::map<int,CertificateData> Certificates;
32 std::map<int,int> ParentCerticiate;
34 std::map<int,int> CertErrors;
37 //size_t WritebackFunc(char *ptr, size_t size, size_t nmemb, FILE *userdata);
39 size_t WritebackFunc(char *ptr, size_t size, size_t nmemb, wxString *userdata);
40 int ProgressFunc(void *clientdata, double TTDown, double NDown, double TTUp, double NUp);
47 bool SetupConnection(wxString SvrAddress, int SvrPort, wxString SvrUser, wxString SvrPass, bool SvrSSL);
48 bool SetupConnection(wxString SvrAddress, int SvrPort, wxString SvrUser, wxString SvrPass, bool SvrSSL, wxString SvrPrefix, wxString SvrAccount);
53 bool HasValidResponse();
54 wxString GetResponseData();
58 void SetupData(wxString Method, wxString FilenameLocation, wxString UploadData);
59 void ProcessDataThread();
60 void SetUploadMode(bool IncMode);
62 bool SetupResultBools(bool *SvrResult, bool *SvrMonitor);
63 int ProgressFuncProc(void *clientdata, double TTUp, double NUp, double TTDown, double NDown);
64 void SetupVariables(std::map<int, int> *actlist, int actindex);
65 wxString GetETagData();
66 void GetServerETagValue();
67 void GetServerETagValueThread();
68 void GetServerContactData();
69 wxString GetPageData();
70 void SetEditMode(bool EditModeInc);
71 ContactListData GetContactList(wxString SyncTokenInc);
72 void SetServerFilename(wxString Filename);
74 static int GetHTTPCode();
75 wxString GetErrorBuffer();
76 wxString GetDefaultAddressBookURL();
78 SSLCertCollection GetCertificateData();
79 static SSLCertCollection BuildSSLCollection(CURL *conn);
80 wxString ETagValueResult();
81 wxString GetErrorMessage();
82 //size_t WritebackFunc(char *ptr, size_t size, size_t nmemb, FILE *userdata);
84 static wxString ServerAddress;
85 static int ServerPort;
86 static wxString ServerUser;
87 static wxString ServerPass;
88 static wxString ServerPrefix;
89 static wxString ServerAccount;
90 static bool ServerSSL;
91 static bool *ServerResult;
92 static bool *ServerMonitor;
93 static bool SSLStatus;
94 static bool SSLVerified;
95 static bool ValidResponse;
96 static bool AuthPassed;
97 static bool HasCalDAVSupport;
98 static bool AbortConnection;
99 static wxString ServerResponse;
100 static wxString ServerMethod;
101 static wxString ServerFilenameLocation;
102 static wxString ServerUploadData;
103 static wxString ETagData;
104 static wxString ETagResult;
105 static bool UploadMode;
106 static bool EditMode;
107 static long ItemIndex;
108 static std::map<int, int> *ActivityListPtr;
109 //frmActivityMgr *ActMgrPtr;
110 static char curlerrbuffer[CURL_ERROR_SIZE];
111 static SSLCertCollection SSLCertCol;
112 static wxString ErrorMessage;
114 static int SSLErrorCode;
115 static int ConnectionErrorCode;
116 static wxString PageHeader;
117 static wxString PageData;
118 static CURLcode claconncode;
119 static int HTTPErrorCode;