Separated sync and async popup implementations
[framework/osp/web.git] / src / controls / FWebCtrl_CertificateConfirmPopup.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        FWebCtrl_CertificateConfirmPopup.h
20  * @brief       The file contains the definition of _CertificateConfirmPopup class.
21  */
22
23 #ifndef _FWEB_CTRL_INTERNAL_CERTIFICATE_CONFIRM_POPUP_H_
24 #define _FWEB_CTRL_INTERNAL_CERTIFICATE_CONFIRM_POPUP_H_
25
26 #include <unique_ptr.h>
27 #include <EWebKit2.h>
28 #include <FBaseString.h>
29 #include "FWebCtrl_WebPopup.h"
30
31
32 namespace Tizen { namespace Web { namespace Controls
33 {
34
35 enum _IdButtonCertificatePopup
36 {
37         ID_BUTTON_CERTIFICATE_ALLOW,
38         ID_BUTTON_CERTIFICATE_CANCEL,
39         ID_BUTTON_CERTIFICATE_VIEW,
40         ID_BUTTON_CERTIFICATE_CLOSE
41 };
42
43 enum _CertificatePopupMode
44 {
45         CERTIFICATE_POPUP_MODE_USER_CONFIRM,
46         CERTIFICATE_POPUP_MODE_VIEW
47 };
48
49 class _CertificateConfirmPopup
50         : public _WebPopup
51 {
52
53 public:
54         /**
55          * Constructor
56          */
57         _CertificateConfirmPopup(void);
58
59         /**
60          * Destructor
61          */
62         virtual ~_CertificateConfirmPopup(void);
63
64         result Construct(_CertificatePopupMode certPopupMode, Ewk_Certificate_Policy_Decision* pPolicy);
65
66         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
67
68         bool GetConfirmResult() const;
69
70 private:
71         _CertificateConfirmPopup(const _CertificateConfirmPopup&);
72
73         _CertificateConfirmPopup& operator =(const _CertificateConfirmPopup&);
74
75         result GetMessageFromPolicy(Tizen::Base::String& message);
76
77         result GenerateCertifiate(Tizen::Base::String& certString);
78
79         Tizen::Base::String GetStringOfToken(const Tizen::Base::String& parseString, const Tizen::Base::String& parseToken);
80
81 private:
82         _CertificatePopupMode __certPopupMode;
83         bool __confirm;
84
85         Ewk_Certificate_Policy_Decision* __pCertificatePolicyData;
86 }; // _CertificateConfirmPopup
87
88 }}} // Tizen::Web::Controls
89 #endif // _FWEB_CTRL_INTERNAL_CERTIFICATE_CONFIRM_POPUP_H_