Temporary fix for asking geolocation permission popup crash.
[platform/framework/web/wrt.git] / src / view / common / view_logic_security_origin_support.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16 /**
17  * @file    view_logic_security_origin_support.h
18  * @author  Jihoon Chung (jihoon.chung@samsung.com)
19  * @version 1.0
20  * @brief   Header file for security origin
21  */
22
23 #ifndef VIEW_LOGIC_SECURITY_ORIGIN_SUPPORT_H_
24 #define VIEW_LOGIC_SECURITY_ORIGIN_SUPPORT_H_
25
26 #include <memory>
27 #include <Evas.h>
28 #include <Elementary.h>
29 #include <dpl/wrt-dao-ro/common_dao_types.h>
30 #include <wrt-commons/security-origin-dao/security_origin_dao.h>
31
32 class WidgetModel;
33 namespace SecurityOriginDB {
34 class SecurityOriginDAO;
35 }
36
37 namespace ViewModule {
38 class SecurityOriginSupportImplementation;
39
40 class SecurityOriginSupport
41 {
42   public:
43     SecurityOriginSupport(WidgetModel* widgetModel);
44     virtual ~SecurityOriginSupport();
45     SecurityOriginDB::SecurityOriginDAO* getSecurityOriginDAO();
46
47   private:
48     std::unique_ptr<SecurityOriginSupportImplementation> m_impl;
49 };
50
51 namespace SecurityOriginSupportUtil {
52 class PermissionData
53 {
54   public:
55     SecurityOriginDB::SecurityOriginDAO* m_originDao;
56     SecurityOriginDB::SecurityOriginData m_originData;
57     void* m_data;
58
59     PermissionData(
60         SecurityOriginDB::SecurityOriginDAO* originDao,
61         SecurityOriginDB::SecurityOriginData originData,
62         void* data) :
63         m_originDao(originDao),
64         m_originData(originData),
65         m_data(data)
66     {}
67 };
68
69 Evas_Object* createPopup(Evas_Object* window,
70                          const char* bodyText,
71                          const char* checkText,
72                          Evas_Smart_Cb buttonCallback,
73                          void* data);
74 Evas_Object* getPopup(Evas_Object* button);
75 Evas_Object* getCheck(Evas_Object* popup);
76 SecurityOriginDB::Result getResult(Evas_Object* button);
77 };
78 } // namespace ViewModule
79
80 #endif // VIEW_LOGIC_SECURITY_ORIGIN_SUPPORT_H_