Apply to remove download listener before deleting _WebImpl
[framework/osp/web.git] / src / controls / FWebCtrl_UserConfirmPopup.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_UserConfirmPopup.h
20  * @brief       The file contains the definition of _UserConfirmPopup class.
21  */
22 #ifndef _FWEB_CTRL_INTERNAL_USER_CONFIRM_POPUP_H_
23 #define _FWEB_CTRL_INTERNAL_USER_CONFIRM_POPUP_H_
24
25 #include <unique_ptr.h>
26 #include <EWebKit2.h>
27 #include <FBaseString.h>
28 #include "FWebCtrl_WebPopup.h"
29
30 namespace Tizen { namespace Ui { namespace Controls
31 {
32 class CheckButton;
33 }}}
34
35 namespace Tizen { namespace Web { namespace Controls
36 {
37
38 enum _UserConfirmPopupButtonId
39 {
40         ID_BUTTON_USER_ALLOW,
41         ID_BUTTON_USER_CANCEL,
42         ID_BUTTON_USER_CERT_VIEW
43 };
44
45 enum _UserConfirmMode
46 {
47         USER_CONFIRM_USERMEDIA,
48         USER_CONTENT_HANDLER,
49         USER_PROTOCOL_HANDLER,
50         USER_CONFIRM_GEOLOCATION,
51         USER_CONFIRM_NOTIFICATION,
52         USER_SCRIPT_ALERT,
53         USER_CONFIRM_APP_CACHE,
54         USER_CONFIRM_DB_QUOTA_EXCEDED,
55         USER_CONFIRM_LOCAL_FS_QUOTA_EXCEDED,
56         USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED
57 };
58
59 class _UserConfirmPopup
60         : public _WebPopup
61 {
62
63 public:
64         /**
65          * Constructor
66          */
67         _UserConfirmPopup(void);
68
69         /**
70          * Destructor
71          */
72         virtual ~_UserConfirmPopup(void);
73
74         result Construct(_UserConfirmMode userConfirmMode, void* pEventInfo, bool sync = false, Tizen::Base::String msg = L"");
75
76         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
77
78 private:
79         _UserConfirmPopup(const _UserConfirmPopup&);
80
81         _UserConfirmPopup& operator =(const _UserConfirmPopup&);
82
83         Tizen::Base::String GetMessageFromPolicy(void);
84
85         void HandleUserAction(Eina_Bool allow);
86
87         void RegisterHandler(bool checkhandler, Eina_Bool allow);
88         result AddGeolocationDb(Ewk_Geolocation_Permission_Request* pPolicy, bool enable);
89
90 private:
91         void* __pUserPolicyData;
92         _UserConfirmMode __userConfirmMode;
93         Tizen::Ui::Controls::CheckButton* __pCheckButton;
94
95         bool __sync;
96 }; // _UserConfirmPopup
97
98 }}} // Tizen::Web::Controls
99 #endif // _FWEB_CTRL_INTERNAL_USER_CONFIRM_POPUP_H_