2 * Copyright 2012 Samsung Electronics Co., Ltd
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
8 * http://floralicense.org/license/
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.
17 #ifndef WEB_SRC_SETTING_WEBAPP_COMMON_LISTVIEW_H_
18 #define WEB_SRC_SETTING_WEBAPP_COMMON_LISTVIEW_H_
20 #include <Elementary.h>
22 #include <dpl/wrt-dao-ro/global_dao_read_only.h>
23 #include <dpl/scoped_ptr.h>
26 #include "whitelistview.h"
30 namespace WebAppCommonSetting {
32 typedef bool (*GetOnOffVal)(void);
34 class ListView : public View
36 Evas_Object *m_naviFrame;
39 DPL::ScopedPtr<WhiteListView> m_whiteListView;
41 /* Genlist Item Callbacks */
42 static char *getWacTitle(void *data,
45 static char *getWhiteListTitle(void *data,
48 static char *getText(void *data,
51 static Evas_Object *getOnOffIcon(void *data,
54 static void delOnOffData(void *data, Evas_Object *obj);
55 static char *getRoamingLabel(void *data,
58 static void delRoamingData(void *data, Evas_Object *obj);
59 static char *getRoamingOptLabel(void *data,
62 static Evas_Object *getRoamingOptRadio(void *data,
65 static void delRoamingExpandData(void *data, Evas_Object *obj);
68 static void onBackBtnClicked(void *data,
71 static void onOnOffItemClicked(void *data,
74 static void onCookieSharingPopupOk(void *data,
77 static void onCookieSharingPopupCancel(void *data,
80 static void onCookieSharingChanged(void *data,
83 static void onUntrustedAppApprovalPopupOk(void *data,
86 static void onUntrustedAppApprovalPopupCancel(void *data,
89 static void onUntrustedAppApprovalChanged(void *data,
92 static void onRoamingClicked(void *data,
95 static void onRoamingOptClicked(void *data,
98 static void onWhiteListClicked(void *data,
102 /* Subview Unload callback */
103 static void onWhiteListViewUnload(void *data);
105 /* Utility methods */
106 static bool getCookieSharingVal(void);
107 static bool getUntrustedAppApprovalVal(void);
109 void addWacTitle(Evas_Object *gl);
110 void addWhiteList(Evas_Object *gl);
111 void addOnOffItem(Evas_Object *gl,
113 GetOnOffVal getOnOffVal,
115 void addDesc(Evas_Object *gl, const char *title);
116 void addDepth(Evas_Object *gl);
117 void addRoamingItem(Evas_Object *gl);
118 void addRoamingOpts(Evas_Object *obj, Elm_Object_Item *it);
121 ListView(Evas_Object *naviFrame);
125 bool pushToNaviFrame(void);
126 void loadWhiteListView(void);
127 void delWhiteListView(void) { m_whiteListView.Reset(); }
128 bool showPopup(const char *desc,
130 Evas_Smart_Cb cancel_cb,
132 void hidePopup(void);
138 ListView *m_listView;
141 GetOnOffVal m_getOnOffVal;
142 Evas_Smart_Cb m_changedCb;
144 OnOffData(ListView *listView,
146 GetOnOffVal getOnOffVal,
147 Evas_Smart_Cb changedCb) :
148 m_listView(listView),
151 m_getOnOffVal(getOnOffVal),
152 m_changedCb(changedCb) { };
154 ~OnOffData(void) { };
161 ListView *m_listView;
163 RoamingData(Evas_Object *rg, ListView *listView) :
165 m_listView(listView) { };
170 evas_object_del(m_rg);
174 class RoamingExpandData
177 WrtDB::GlobalDAOReadOnly::NetworkAccessMode m_mode;
180 RoamingExpandData(WrtDB::GlobalDAOReadOnly::NetworkAccessMode mode,
184 ~RoamingExpandData(void) { };
187 class ComplianceModeData
190 ListView *m_listView;
193 Elm_Object_Item *m_it;
195 ComplianceModeData(ListView *listView, Evas_Object *gl) :
196 m_listView(listView),
200 ~ComplianceModeData(void) { };
203 } /* WebAppCommonSetting */
205 #endif /* WEB_SRC_SETTING_WEBAPP_COMMON_LISTVIEW_H_ */