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