8adbf4dc64d3ed71e62e7eb39fa678c34a7709fd
[profile/tv/apps/web/browser.git] / services / SettingsUI / SettingsUI.h
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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 #ifndef SETTINGSUI_H
18 #define SETTINGSUI_H
19
20 #include <Evas.h>
21 #include <boost/signals2/signal.hpp>
22
23 #include "AbstractUIComponent.h"
24 #include "AbstractService.h"
25 #include "ServiceFactory.h"
26 #include "service_macros.h"
27
28 namespace tizen_browser{
29 namespace base_ui{
30
31 class BROWSER_EXPORT SettingsUI
32         : public tizen_browser::interfaces::AbstractUIComponent
33         , public tizen_browser::core::AbstractService
34 {
35 public:
36     SettingsUI();
37     ~SettingsUI();
38     void show(Evas_Object *main_layout);
39     virtual std::string getName();
40     void showActionBar();
41     void showSettingsPage();
42     void clearItems();
43     void hide();
44
45     boost::signals2::signal<void (const std::string & )> resetBrowserClicked;
46     boost::signals2::signal<void (const std::string & )> resetMostVisitedClicked;
47     boost::signals2::signal<void (const std::string & )> deleteSelectedDataClicked;
48     boost::signals2::signal<void (const std::string & )> closeSettingsUIClicked;
49
50 private:
51     static Evas_Object* listActionBarContentGet(void *data, Evas_Object *obj, const char *part);
52     static Evas_Object* listSettingsGenlistContentGet(void *data, Evas_Object *obj, const char *part);
53
54     static char* _grid_text_get(void *data, Evas_Object *obj, const char *part);
55     static Evas_Object * _tab_grid_content_get(void *data, Evas_Object *obj, const char *part);
56     static void _itemSelected(void * data, Evas_Object * obj, void * event_info);
57     static void close_clicked_cb(void *data, Evas_Object *obj, void *event_info);
58     static void __checkbox_label_click_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
59
60     static void _del_selected_data_clicked_cb(void * data, Evas_Object * obj, void * event_info);
61     static void _reset_mv_clicked_cb(void * data, Evas_Object * obj, void * event_info);
62     static void _reset_browser_clicked_cb(void * data, Evas_Object * obj, void * event_info);
63     static void _closetabs_clicked(void * data, Evas_Object * obj, void * event_info);
64     static void _onotherdevices_clicked(void * data, Evas_Object * obj, void * event_info);
65
66 private:
67     Evas_Object *m_settings_layout;
68     Evas_Object *m_genListActionBar;
69     Evas_Object *m_scroller;
70     Evas_Object *m_items_layout;
71     Elm_Genlist_Item_Class *m_itemClassActionBar;
72     Evas_Object *m_parent;
73
74     Elm_Gengrid_Item_Class * m_item_class;
75     std::string m_edjFilePath;
76
77 };
78
79 }
80 }
81
82 #endif // BOOKMARKSUI_H