Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Fixed cleaning of old object files
[xestiaab/.git] / source / carddav / carddav.h
index aff2138..d4ac957 100644 (file)
@@ -1,16 +1,43 @@
+// carddav.h - CardDAV Object header file.
+//
+// (c) 2012-2015 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book 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,
+// 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.
+//
+// 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 <Windows.h>
+#include <basetsd.h>
+#include <winapifamily.h>
+#include <security.h>
+#include <schannel.h>
+#include <cryptuiapi.h>
+#include <sspi.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;
@@ -21,6 +48,12 @@ struct ContactListData{
        std::map<wxString,FileSyncData> ListData;
 };
 
+struct UploadDataStruc{
+       wxString *readptr;
+       long sizeleft;
+       int seek = 0;
+};
+
 /*struct CertificateData{
        std::multimap<wxString,wxString> CertificateData;
        bool CertValid;
@@ -38,6 +71,7 @@ struct CertificateCollection{
 
 size_t WritebackFunc(char *ptr, size_t size, size_t nmemb, wxString *userdata);
 int ProgressFunc(void *clientdata, double TTDown, double NDown, double TTUp, double NUp);
+size_t UploadReadFunc(void *ptr, size_t size, size_t nmemb, void *userdata);
 
 class CardDAV
 {
@@ -51,7 +85,9 @@ class CardDAV
                bool SSLVerify();
                bool AbleToLogin();
                bool HasValidResponse();
-               wxString GetResponseData();             
+               bool IsSelfSigned();
+               wxString GetResponseData();
+               void AllowSelfSignTest(bool AllowSelfSignIn);           
                bool Connect();
                bool ConnectThread();
                void ProcessData();
@@ -76,10 +112,22 @@ class CardDAV
                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();
@@ -87,6 +135,15 @@ class CardDAV
 
                //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;
@@ -117,6 +174,7 @@ class CardDAV
                static SSLCertCollection SSLCertCol;
                static wxString ErrorMessage;
                static wxString ErrorBufferMessage;
+               static bool AllowSelfSign;
        protected:
                static int SSLErrorCode;
                static int ConnectionErrorCode;
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