Merge "packaging: spec cleanup" into tizen
[apps/core/preloaded/settings.git] / include / setting.h
1 /*
2  * setting
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Flora License, Version 1.1 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://floralicense.org/license/
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an AS IS BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 /**
18  *@defgroup setting-app
19  *entry point of Setting application
20  */
21 #ifndef __SETTING_H__
22 #define __SETTING_H__
23
24 #include <setting-cfg.h>
25
26 #include <setting-common-draw-widget.h>
27 #include <setting-common-view.h>
28
29 /*  TAPI*/
30 #include <tapi_common.h>
31 #include <ITapiModem.h>
32
33 #include <sensors.h>
34
35 #define EDIT_PREFERRED_STR "IDS_ST_BUTTON2_EDIT_PREFERRED"
36 //#define PREFERRED_STR "IDS_ST_TAB_PREFERRED"
37 #define PREFERRED_STR "IDS_ST_BODY_FREQUENTLY_USED"
38 #define ALL_STR "IDS_ST_OPT_ALL"
39 #define SETTING_MAX_PID_LEN 128
40
41 #define NO_UG_FOUND_MSG                         _("Unsupported menu")
42 #define USB_NEED_OFF "Please turn USB tethering off first in Mobile hotspot"
43
44 #define SETTING_NFC_DESC "IDS_ST_BODY_ALLOW_DATA_EXCHANGE_WHEN_DEVICE_TOUCHES_ANOTHER_DEVICE"
45 #define SETTING_WIFI_DIRECT_DESC "IDS_ST_BODY_SET_UP_PEER_TO_PEER_CONNECTIVITY_ABB"
46
47 /**
48 * @brief
49 */
50 typedef enum _setting_view_type {
51         SETTING_VIEW_MAIN = 0,
52         SETTING_VIEW_CONNECTIVE_MORE,
53         SETTING_VIEW_SYSTEM_MORE,
54         SETTING_VIEW_ALL_CHECK = 9,
55 } Setting_View_Type;
56
57 typedef void (*menu_list_load_fn) (void *data);
58 typedef void (*menu_list_load_fn2) (void *, Cfg_Item_Position, Evas_Object *);
59
60 typedef enum _List_Load_Func_Type {
61         Func_Type_Connectivity = 0,
62         Func_Type_System = 1,
63         Func_Type_Apps = 2,
64         Func_Type_DownApp = 3,
65         Func_Type_MAX
66 } List_Load_Func_Type;
67
68 typedef enum _MAIN_PROFILE_Type {
69         MAIN_PROFILE_PREFERRED = 0,
70         MAIN_PROFILE_ALL = 1,
71         MAIN_PROFILE_MAX
72 } MAIN_PROFILE_Type;
73
74 /**
75  * enum for genlist item to be updated
76  * @see setting_update_gl_item
77  */
78 typedef enum _Update_GL_Item_Type {
79         GL_ITEM_WIFI = 0,
80         GL_ITEM_BT,
81         GL_ITEM_NFC,
82         GL_ITEM_MAP,
83         GL_ITEM_USB,
84
85         GL_ITEM_ROTATION,
86         GL_ITEM_FLIGHT,
87
88         GL_ITEM_MAX
89 } Update_GL_Item_Type;
90
91 typedef enum _FLIGHT_MODE_OPEARTION{
92         FM_INVALID = 0,//There is no request waiting for processing
93         FM_ENTER = 1,//Some "flightmode enter" request is waiting for processing
94         FM_LEAVE,//Some "flightmode leave" request is waiting for processing
95 } FLIGHT_MODE_OPEARTION;
96
97
98 #define MAX_MORE_MENU_NUM       6
99 /**
100 * @brief main view context
101 */
102 typedef struct _setting_main_appdata {
103
104         ui_gadget_h ug;
105         TapiHandle *handle;
106         Evas_Object *popup;
107         Evas_Object *app_icon;
108
109         Eina_Bool bAppPause;
110         Eina_Bool updateItems[GL_ITEM_MAX];
111
112         Ecore_Idler *refresh_idler;
113
114         Evas *evas;
115         Evas_Object *win_main;
116         Evas_Object *controlbar;
117
118         //Evas_Object *controllbar_all_check;
119         Evas_Object *gl_sel_all;
120
121         menu_list_load_fn load_fns[Func_Type_MAX];
122         MAIN_PROFILE_Type profile_type;
123
124         Evas_Object *navibar_main;
125
126         Evas_Object *ly_main;                   /**< seting view main */
127         Setting_View_Type view_load;
128         Evas_Object *genlist_load;
129
130         Elm_Object_Item *edit_item;
131         Elm_Object_Item *segment_all;
132         Elm_Object_Item *segment_preferred;
133
134         bool isInUGMode;
135
136         /* vars for flightmode */
137         bool b_fm_requesting;//whether some request is processing. 1:yes, 0:no
138         FLIGHT_MODE_OPEARTION fm_waiting_op;
139
140
141         /* special layout */
142         Setting_GenGroupItem_Data *data_flight;
143         Setting_GenGroupItem_Data *data_wifi;
144         Setting_GenGroupItem_Data *data_bt;
145         Setting_GenGroupItem_Data *data_rotationMode;
146
147         Setting_GenGroupItem_Data *data_bright;
148
149         Setting_GenGroupItem_Data *data_moreSystem;
150         Setting_GenGroupItem_Data *data_moreConnect;
151         Setting_GenGroupItem_Data *data_nfc;
152
153         //following are not for update..
154         Setting_GenGroupItem_Data *data_network;
155
156         Setting_View_Type view_type;
157
158         Evas_Object *main_genlist;                              /**< 'Setting main' in main page */
159         Evas_Object *edit_preferred_genlist;    /**< 'Edit preferred' page */
160
161         Elm_Genlist_Item_Class itc[GENDIAL_Type_MAX];
162
163         Eina_List *item_check_list;                                /**< in preferred view, store the selected items in the list.  */
164         Setting_GenGroupItem_Data *check_all_item; /**< genlist node for "Select all" */
165
166         Evas_Object *flight_popup;
167         Evas_Object *data_roaming_popup;
168
169         // listen / unlisten code
170         Eina_List *listened_list;
171         sensor_h sf_handle;
172
173         const char *more_connective_menus[MAX_MORE_MENU_NUM];
174         const char *more_system_menus[MAX_MORE_MENU_NUM];
175
176         char* plugin_path;
177         void* plugin_node;
178         char* view_to_jump;
179         char cur_loaded_ug[MAX_DISPLAY_NAME_LEN_ON_UI];
180
181         Evas_Object *conform;
182
183         int current_rotation;
184 } setting_main_appdata;
185
186 /* launch view */
187 extern setting_view setting_view_main;
188 extern setting_view setting_view_more_menu;
189 extern void __load_connectivity_menu_list(void *data, Cfg_Item_Position inputPos, Evas_Object *genlist);
190 extern void __load_system_menu_list(void *data, Cfg_Item_Position inputPos, Evas_Object *genlist);
191 extern void __gl_realized(void *data, Evas_Object *obj, void *event_info);
192
193 #endif                          /* __SETTING_H__ */