merge with master
[framework/osp/net.git] / src / inc / FNetHttp_HttpCommon.h
index 15c1c54..6940cab 100644 (file)
@@ -48,6 +48,7 @@ class Mutex;
 namespace Tizen { namespace Net { namespace Http
 {
 class _HttpSslInfo;
+class _HttpTransactionEvent;
 
 /**
  * The User-Agent header name
@@ -273,6 +274,7 @@ enum _HttpTransactionEventType
        _HTTP_TRANSACTION_EVENT_TYPE_COMPLETD,
        _HTTP_TRANSACTION_EVENT_TYPE_ABORTED,
        _HTTP_TRANSACTION_EVENT_TYPE_CERT_VERIFICATION_REQUIRED,
+       _HTTP_TRANSACTION_EVENT_TYPE_CERT_VERIFICATION_REQUESTED,
        _HTTP_TRANSACTION_EVENT_TYPE_UPLOAD_PROGRESS,
        _HTTP_TRANSACTION_EVENT_TYPE_DOWNLOAD_PROGRESS
 };
@@ -357,9 +359,17 @@ public:
         * Converts NetHttpTransactionEventType to string name.
         *
         * @return              The string of NetHttpTransactionEventType
-        * @param[in]   index                           The index of NetHttpTransactionEventType
+        * @param[in]   type                            The type of NetHttpTransactionEventType
         */
-       static const char* ConvertHttpTransactionEventTypeToString(_HttpTransactionEventType index);
+       static const char* ConvertHttpTransactionEventTypeToString(_HttpTransactionEventType type);
+
+       /**
+        * Converts NetHttpCertificateVerificationFlag to string name.
+        *
+        * @return              The string of NetHttpCertificateVerificationFlag
+        * @param[in]   flag                            The flag of NetHttpCertificateVerificationFlag
+        */
+       static const char* ConvertNetHttpCertificateVerificationFlagToString(NetHttpCertificateVerificationFlag flag);
 
        /**
         * Adds a buffer to the header buffer.
@@ -487,17 +497,17 @@ public:
        static Tizen::Base::Collection::IList* GetSslCertList(void);
 
        /**
-        * Adds a _HttpSslInfo
+        * Sets a _HttpSslInfo
         *
         * @return              An error code
         * @param[in]   sslInfo                         The instance of _HttpSslInfo
         * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
         * @exception   E_SYSTEM                        A system error has occurred.
         */
-       static result AddSslCertInfo(_HttpSslInfo& sslInfo);
+       static result SetSslCertInfo(_HttpSslInfo& sslInfo);
 
        /**
-        * Gets a list of _HttpSslInfo searched by socket fd.
+        * Gets an instance of _HttpSslInfo searched by socket fd.
         *
         * @return              The instance of _HttpSslInfo
         * @param[in]   socketFd                        The socket fd
@@ -505,16 +515,16 @@ public:
         * @exception   E_SYSTEM                        A system error has occurred.
         * @remarks             The specific error code can be accessed using the GetLastResult() method.
         */
-       static Tizen::Base::Collection::IList* GetSslCertInfoN(int socketFd);
+       static _HttpSslInfo* GetSslCertInfo(int socketFd);
 
        /**
         * Removes a _HttpSslInfo
         *
         * @return              An error code
-        * @param[in]   socketFd                        The socket fd
+        * @param[in]   sslInfo                         The instance of _HttpSslInfo
         * @exception   E_SYSTEM                        A system error has occurred.
         */
-       static result RemoveSslCertInfo(int socketFd);
+       static result RemoveSslCertInfo(_HttpSslInfo & sslInfo);
 
 private:
        /**
@@ -552,18 +562,23 @@ class _HttpSslInfo
 
 public:
        _HttpSslInfo(int socketFd, int depth, const Tizen::Base::String& serverCert, const Tizen::Base::String& errorMessage);
+       _HttpSslInfo(int socketFd, _HttpTransactionEvent* pHttpTransactionEvent);
        virtual ~_HttpSslInfo(void);
 
     int GetSocketFd(void) const;
     int GetDepth(void) const;
     Tizen::Base::String GetErrorMessage(void) const;
     Tizen::Base::String GetServerCert(void) const;
+    _HttpTransactionEvent* GetHttpTransactionEvent(void) const;
+    NetHttpCertificateVerificationFlag GetCertificateVerificationFlag(void) const;
 
 private:
        int __socketFd;
        int __depth;
        Tizen::Base::String __serverCert;
        Tizen::Base::String __errorMessage;
+       _HttpTransactionEvent* __pHttpTransactionEvent;
+       NetHttpCertificateVerificationFlag __flag;
 
 }; //_HttpSslInfo