X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fconnobject%2FConnectionObject.h;h=b8d82d34ff6d9e6338f0a1ccb9be4717c903aef1;hp=8e5221f246de60bf2ffb49a534d4e6805803939c;hb=f2f4ddfdf1b569af4578bda527d5329f6ccffa98;hpb=a578ed436123242f807cb59eae02fcf6c22e2458 diff --git a/source/connobject/ConnectionObject.h b/source/connobject/ConnectionObject.h index 8e5221f..b8d82d3 100644 --- a/source/connobject/ConnectionObject.h +++ b/source/connobject/ConnectionObject.h @@ -1,6 +1,6 @@ // ConnectionObject.h - ConnectionObject interface header file. // -// (c) 2012-2015 Xestia Software Development. +// (c) 2012-2016 Xestia Software Development. // // This file is part of Xestia Address Book. // @@ -24,6 +24,11 @@ #include #include "../common/sslcertstructs.h" +#if defined (__APPLE__) +#import +#import +#endif + #if defined (__WIN32__) #include #include @@ -40,7 +45,8 @@ enum COConnectResult { COCONNECT_SSLFAIL, COCONNECT_INVALID, COCONNECT_TIMEOUT, - COCONNECT_AUTHFAIL + COCONNECT_AUTHFAIL, + COCONNECT_NOCONNECTION, }; enum CORequestResult { @@ -48,6 +54,7 @@ enum CORequestResult { COREQUEST_OK, COREQUEST_ERROR_NOTCONNECTED, COREQUEST_ERROR_SERVER, + COREQUEST_NOCONNECTION, }; enum COSSLVerified { @@ -66,16 +73,16 @@ enum COContactStatus { }; struct COServerResponse { - CORequestResult RequestResult; - std::string EntityTag; - int SessionCode; - int ResultCode; - std::string ResultMessage; + CORequestResult RequestResult = COREQUEST_NOCONNECTION; + std::string EntityTag = ""; + int SessionCode = 0; + int ResultCode = 0; + std::string ResultMessage = ""; }; struct COContactData { - std::string Location; - std::string Data; + std::string Location = ""; + std::string Data = ""; COContactStatus Status = COCS_UNKNOWN; }; @@ -88,13 +95,10 @@ struct COContactList { class ConnectionObject{ public: - ConnectionObject(std::string ServerAddress, int ServerPort, std::string ServerUser, std::string ServerPass, bool ServerSSL); - ConnectionObject(std::string ServerAddress, int ServerPort, std::string ServerUser, std::string ServerPass, bool ServerSSL, std::string ServerPrefix, std::string ServerAccount); // Virtual functions to be setup by the inheriting classes. virtual void SetupConnectionObject() = 0; - //virtual ~ConnectionObject() {}; virtual bool IsTaskCompleted() = 0; @@ -120,6 +124,9 @@ class ConnectionObject{ // OS specific functions. #if defined(__APPLE__) + + virtual SecTrustRef BuildSSLCollection() = 0; + #elif defined(__WIN32__) virtual PCCERT_CONTEXT BuildSSLCollection() = 0; @@ -159,4 +166,4 @@ class ConnectionObject{ }; -#endif \ No newline at end of file +#endif