Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
CardDAV2/CDO: Cleaned up headers and included stdexcept
[xestiaab/.git] / source / carddav2 / carddav2.h
index 729b24b..5a1b355 100644 (file)
 
 #include <string>
 #include <vector>
+#include <stdexcept>
 
 class CardDAV2 : public ConnectionObject {
        
        public:
        
-               using ConnectionObject::ConnectionObject;
-       
+               CardDAV2(std::string ServerAddress, int ServerPort, std::string ServerUser, std::string ServerPass, bool ServerSSL);
+               CardDAV2(std::string ServerAddress, int ServerPort, std::string ServerUser, std::string ServerPass, bool ServerSSL, std::string ServerPrefix, std::string ServerAccount);
+
                // Destructor.
        
                ~CardDAV2();
@@ -54,9 +56,9 @@ class CardDAV2 : public ConnectionObject {
                COServerResponse GetDefaultPrefix(std::string *ServerPrefix);
                COServerResponse AddContact(std::string Location, std::string Data);
                COServerResponse EditContact(std::string Location, std::string Data);
-               COServerResponse DeleteContact(std::string Location, std::string EntityTag);
+               COServerResponse DeleteContact(std::string Location);
                COServerResponse GetServerEntityTagValue(std::string Location);
-               COServerResponse GetContact(std::string Location);
+               COServerResponse GetContact(std::string Location, std::string *ContactData);
                COContactList GetContactList(std::string SyncToken);
        
                bool CanDoProcessing();
@@ -67,15 +69,33 @@ class CardDAV2 : public ConnectionObject {
                bool IsSelfSigned();
                std::string GetErrorMessage();
 
-               void BypassSSLVerification(bool EnableBypass);
-
 #if defined(__APPLE__)
+    
+               SecTrustRef BuildSSLCollection();
+    
 #elif defined(__WIN32__)
+
+               PCCERT_CONTEXT BuildSSLCollection();
+
 #else
                SSLCertCollectionString BuildSSLCollection();
 
 #endif
+
+               void BypassSSLVerification(bool EnableBypass);
        
+               struct CardDAV2PassObject {
+                       CardDAV2 *CardDAV2Object = nullptr;
+                       std::string *DataSetting = nullptr;
+                       bool ServerUsingSSL = false;
+                       CURL *ConnectionSessionObject = nullptr;
+#if defined(__APPLE__)
+                       SecTrustRef SSLContext = nullptr;
+#elif defined(__WIN32__)
+                       PCCERT_CONTEXT SSLContext = nullptr;
+#endif
+               };
+
        protected:
        private:
                
@@ -92,6 +112,9 @@ class CardDAV2 : public ConnectionObject {
                std::string PageHeader;
                char SessionErrorBuffer[CURL_ERROR_SIZE];
        
+               CardDAV2PassObject PageDataObject;
+               CardDAV2PassObject PageHeaderObject;
+
                static size_t WritebackFunc(char *ptr, size_t size, size_t nmemb, void *stream);
                size_t WritebackFuncImplementation(char *ptr, size_t size, size_t nmemb, void *stream);
        
@@ -104,13 +127,23 @@ class CardDAV2 : public ConnectionObject {
                std::string GetUserPrincipalURI();
                std::string GetAddressBookHomeURI();
                std::string GetDefaultAddressBookURI();
-       
+               void ProcessContactData(COContactList *ContactList);
+
 #if defined(__APPLE__)
+
+               SecTrustRef CertificateData = nullptr;
+       
 #elif defined(__WIN32__)
+
+               PCCERT_CONTEXT CertificateData = nullptr;
+
 #else
-               bool EnableSSLBypass = false;
 #endif
        
+               void SetCertificateData();
+
+               bool EnableSSLBypass = false;
+
 };
 
-#endif
\ No newline at end of file
+#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