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_WHITELISTVIEW_H_
18 #define WEB_SRC_SETTING_WEBAPP_COMMON_WHITELISTVIEW_H_
22 #include <dpl/scoped_ptr.h>
24 #include "whiteuriview.h"
28 namespace WebAppCommonSetting {
30 class WhiteListView : public View
32 Evas_Object *m_naviFrame;
35 Evas_Object *m_selectAll;
36 unsigned int m_selectCnt;
37 unsigned int m_uriCnt;
38 Elm_Object_Item *m_editModeBtn;
39 Elm_Object_Item *m_optBtn;
41 DPL::ScopedPtr<WhiteUriView> m_whiteUriView;
43 static char *getUriStr(void *data,
46 static Evas_Object *getUriChk(void *data,
49 static void delUriData(void *data, Evas_Object *obj);
51 static void onBackBtnClicked(void *data,
54 static void onEditModeBtnClicked(void *data,
57 static void onOptBtnClicked(void *data,
60 static void onUriClicked(void *data,
63 static void onUriChkClicked(void *data,
66 static void onSelectAllChkClicked(void *data,
69 static void onSelectAllClicked(void *data,
73 static void onRemoveWhiteUriPopupOk(void *data,
76 static void onRemoveWhiteUriPopupCancel(void *data,
79 static void onWhiteUriViewUnload(void *data);
81 void addUri(DPL::String &uri);
82 Evas_Object *addToolBar(Evas_Object *parent);
83 bool pushToNaviFrame(void);
84 void popFromNaviFrame(void);
85 bool addNoContent(Evas_Object *ly);
86 bool addContents(Evas_Object *ly);
89 WhiteListView(Evas_Object *naviFrame);
93 void loadWhiteUriView(std::string *uri = NULL);
94 void delWhiteUriView(void);
96 void handleEditModeBtn(void);
97 void handleOptBtn(void);
98 void handleBackBtn(void);
99 void removeWhiteUri(void);
100 void increaseSelectCnt(void);
101 void decreaseSelectCnt(void);
102 void selectAll(Eina_Bool select);
103 bool showPopup(const char *desc,
105 Evas_Smart_Cb cancel_cb,
107 void hidePopup(void);
113 WhiteListView *m_whiteListView;
116 Eina_Bool m_selected;
118 UriData(WhiteListView *whiteListView, std::string uri) :
119 m_whiteListView(whiteListView),
122 m_selected(EINA_FALSE) { };
127 } /* WebAppCommonSetting */
129 #endif /* WEB_SRC_SETTING_WEBAPP_COMMON_WHITELISTVIEW_H_ */