// You should have received a copy of the GNU General Public License along
// with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
+#ifndef CALDAV_CALDAV_H
+#define CALDAV_CALDAV_H
+
#include <iostream>
#include <map>
#include <wx/wx.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <curl/curl.h>
+#if defined(__WIN32__)
+#include <security.h>
+#include <schannel.h>
+#endif
#include "../vcard/vcard.h"
-#include "../frmActivityMgr.h"
+#include "../actmgr/frmActivityMgr.h"
#include "../common/sslcertstructs.h"
-#ifndef CALDAV_CALDAV_H
-#define CALDAV_CALDAV_H
-
struct FileSyncData{
unsigned int DataFlag:2;
wxString ETagData;
wxString GetDefaultAddressBookURL();
void GetSSLResults();
SSLCertCollection GetCertificateData();
- static SSLCertCollection BuildSSLCollection(CURL *conn);
+ static SSLCertCollection BuildSSLCollection(CURL *conn);
wxString ETagValueResult();
wxString GetErrorMessage();
-
+ static size_t WritebackFunc(char *ptr, size_t size, size_t nmemb, wxString *stream);
+#if defined(__APPLE__) || defined(__WIN32__)
+ static CURL* GetConnectionObject();
+ static void SetConnectionObject(CURL *ConnectionObject);
+#endif
+
+#if defined(__APPLE__)
+ SecTrustRef GetTrustObject();
+#elif defined(__WIN32__)
+ PCCERT_CONTEXT GetCertificateContextPointer();
+ CERT_CONTEXT GetCertificateContext();
+#endif
+
// SSL Verification tests when connecting.
static CURLcode SSLVerifyTest();
//size_t WritebackFunc(char *ptr, size_t size, size_t nmemb, FILE *userdata);
private:
+#if defined(__APPLE__) || defined(__WIN32__)
+ static CURL* ConnectionObject;
+#endif
+#if defined(__APPLE__)
+ static SSLContext *SSLContextPointer;
+ static SecTrustRef SecTrustObject;
+#elif defined(__WIN32__)
+ static PCCERT_CONTEXT CertificateData;
+#endif
static wxString ServerAddress;
static int ServerPort;
static wxString ServerUser;