fix gbs/obs build failure
[framework/osp/web.git] / src / controls / inc / 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 <EWebKit2.h>
27 #include <unique_ptr.h>
28 #include <FBaseString.h>
29 #include <FUiIPropagatedKeyEventListener.h>
30 #include "FWebCtrl_WebPopup.h"
31
32
33 namespace Tizen { namespace Web { namespace Controls
34 {
35
36 enum _IdButtonCertificatePopup
37 {
38         ID_BUTTON_CERTIFICATE_ALLOW,
39         ID_BUTTON_CERTIFICATE_CANCEL,
40         ID_BUTTON_CERTIFICATE_VIEW,
41         ID_BUTTON_CERTIFICATE_CLOSE
42 };
43
44 enum _CertificatePopupMode
45 {
46         CERTIFICATE_POPUP_MODE_USER_CONFIRM,
47         CERTIFICATE_POPUP_MODE_VIEW
48 };
49
50 class _CertificateConfirmPopup
51         : public _WebPopup
52         , public Tizen::Ui::IPropagatedKeyEventListener
53 {
54
55 public:
56         /**
57          * Constructor
58          */
59         _CertificateConfirmPopup(void);
60
61         /**
62          * Destructor
63          */
64         virtual ~_CertificateConfirmPopup(void);
65
66         result Construct(_CertificatePopupMode certPopupMode, Ewk_Certificate_Policy_Decision* pPolicy);
67
68         void HandleUserAction(bool allow);
69
70         bool GetConfirmResult() const;
71
72         void AddCertificateDb(const Tizen::Base::String& pem, bool allow);
73
74         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
75
76         virtual bool  OnKeyPressed (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
77         virtual bool  OnKeyReleased (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
78         virtual bool  OnPreviewKeyPressed (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
79         virtual bool  OnPreviewKeyReleased (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
80         virtual bool  TranslateKeyEventInfo (Tizen::Ui::Control &source, Tizen::Ui::KeyEventInfo &keyEventInfo);
81
82 private:
83         _CertificateConfirmPopup(const _CertificateConfirmPopup&);
84
85         _CertificateConfirmPopup& operator =(const _CertificateConfirmPopup&);
86
87         result GetMessageFromPolicy(Tizen::Base::String& message);
88
89         result GenerateCertifiate(Tizen::Base::String& certString);
90
91         Tizen::Base::String GetStringOfToken(const Tizen::Base::String& parseString, const Tizen::Base::String& parseToken);
92
93 private:
94         _CertificatePopupMode __certPopupMode;
95         bool __confirm;
96
97         Ewk_Certificate_Policy_Decision* __pCertificatePolicyData;
98 }; // _CertificateConfirmPopup
99
100 }}} // Tizen::Web::Controls
101 #endif // _FWEB_CTRL_INTERNAL_CERTIFICATE_CONFIRM_POPUP_H_