The license change version 1.0 to version 1.1
[apps/home/wrt-setting.git] / webapp-detail / exceptionsview.h
1 /*
2   * Copyright 2012  Samsung Electronics Co., Ltd
3   *
4   * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 #ifndef WEB_SRC_SETTING_WEBAPP_DETAIL_EXCEPTIONSVIEW_H_
18 #define WEB_SRC_SETTING_WEBAPP_DETAIL_EXCEPTIONSVIEW_H_
19
20 #include <Evas.h>
21
22 #undef None
23 #include <memory>
24 #include <wrt-commons/security-origin-dao/security_origin_dao.h>
25 #include <wrt-commons/security-origin-dao/security_origin_dao_types.h>
26
27 #include "view.h"
28
29 namespace SecurityOriginDB {
30 class SecurityOriginDAO;
31 struct SecurityOriginData;
32 }
33
34 namespace WebAppDetailSetting {
35
36 class ExceptionsView : public View
37 {
38   public:
39     ExceptionsView(Evas_Object *naviframe, DPL::String appID);
40     ~ExceptionsView(void);
41
42     bool loadView(void);
43     void loadEmptyView(Evas_Object* genlist);
44     void loadExceptionsSettingsView(
45         Evas_Object* genlist,
46         SecurityOriginDB::SecurityOriginDataList securityOriginDataList);
47
48   private:
49     Evas_Object *m_naviframe;
50     DPL::String m_appID;
51     SecurityOriginDB::SecurityOriginDAOPtr m_securityOriginDao;
52
53     //Genlist
54     static char* getEmptyTextCallback(
55         void* data,
56         Evas_Object* obj,
57         const char* part);
58     static char* getTextCallback(
59         void* data,
60         Evas_Object* obj,
61         const char* part);
62     static void delCallback(
63         void* data,
64         Evas_Object* obj);
65     static void selectedCallback(
66         void* data,
67         Evas_Object* obj,
68         void* eventInfo);
69
70     //Popup
71     static void removeItemCallback(
72         void* data,
73         Evas_Object* obj,
74         void* eventInfo);
75     static void closePopupCallback(
76         void* data,
77         Evas_Object* obj,
78         void* eventInfo);
79 };
80
81 class ExceptionsSettingsData
82 {
83   public:
84     SecurityOriginDB::SecurityOriginDAO* m_originDao;
85     SecurityOriginDB::SecurityOriginData m_originData;
86
87     ExceptionsSettingsData(
88         SecurityOriginDB::SecurityOriginDAO* dao,
89         SecurityOriginDB::SecurityOriginData data) :
90             m_originDao(dao),
91             m_originData(data)
92     {
93     };
94 };
95
96 } /* WebAppDetailSetting */
97
98 #endif /* WEB_SRC_SETTING_WEBAPP_DETAIL_EXCEPTIONSVIEW_H_ */