4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
6 * Contact: MyoungJune Park <mj2004.park@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 *@defgroup setting-app
23 *entry point of Setting application
28 #include <setting-common-view.h>
29 #include <setting-common-search.h>
31 #define EXPORT_PUBLIC __attribute__ ((visibility ("default")))
34 #include <tapi_common.h>
35 #include <ITapiModem.h>
38 #include <notification.h>
40 #include <app_manager.h>
41 #include <efl_assist.h>
42 #include <dd-display.h>
43 /*#include <tethering.h> */
45 #define NETCONFIG_SERVICE "net.netconfig"
46 #define NETCONFIG_WIFI_INTERFACE NETCONFIG_SERVICE ".wifi"
47 #define NETCONFIG_WIFI_PATH "/net/netconfig/wifi"
49 #define FEATURE_UNAVALIABLE_WHILE_TTS_ON "IDS_SCR_POP_SCREEN_READER_IS_NOT_SUPPORTED_BY_PS_PRESS_THE_BACK_KEY_TO_RETURN_TO_THE_PREVIOUS_SCREEN"
51 #define NO_UG_FOUND_MSG "IDS_MSGF_POP_UNSUPPORTED"
52 #define USB_NEED_OFF "Please turn USB tethering off first in Mobile hotspot"
54 #define Kies_Caring_Str "IDS_KW_POP_BE_CAREFUL_WHEN_TRANSMITTING_INFORMATION_ON_AN_UNSECURED_WI_FI_NETWORK_MSG"
55 #define Kies_Warrning_Str "IDS_USB_POP_UNABLE_TO_CONNECT_TO_KIES_VIA_WI_FI_WHEN_CONNECTED_TO_KIES_VIA_USB"
57 #define _2_TAB_STR Keystr_Connection
58 #define _3_TAB_STR KeyStr_Device
59 #define _4_TAB_STR KeyStr_MotionControl /**/
60 #define _5_TAB_STR "IDS_ST_BODY_GENERAL"
61 #define _6_TAB_STR KeyStr_DownloadedAPPs
63 #define LIST_VIEW "IDS_CLD_BUTTON_LIST_VIEW"
64 #define GRID_VIEW "IDS_ST_BODY_GRID_VIEW"
65 #define TAB_VIEW "IDS_ST_OPT_TAB_VIEW"
66 #define EDIT_VIEW "IDS_ST_OPT_EDIT_QUICK_SETTINGS"
69 #define Keystr_Apps "IDS_ST_BODY_APPLICATION_SETTINGS"
70 #define Keystr_All "IDS_ST_OPT_ALL"
71 #define Keystr_MostUsed "IDS_ST_TZTAB4_MOST_USED_M_APP"
72 #define Keystr_Connection "IDS_ST_BODY_CONNECTION"
73 #define Keystr_Device "IDS_ST_BODY_DEVICE"
74 #define Keystr_General "IDS_ST_BODY_GENERAL"
77 #define USER_DEFINED_SETTING_STR "IDS_ST_HEADER_USER_SETTINGS_ABB"
78 #define FREQUENTLY_SETTING_STR "IDS_ST_BODY_FREQUENTLY_USED"
79 #define EMPTY_STR "IDS_ST_BODY_EMPTY"
81 #define ENABLE_FLIGHT_MODE_MSG "IDS_ST_BODY_FLIGHT_MODE_MSG"
86 typedef enum _Setting_Tab_View_Type {
87 SETTING_TAB_VIEW_INVALID = -1,
88 SETTING_TAB_VIEW_QUICK_SETTINGS = 0,
89 SETTING_TAB_VIEW_CONNECTION = 1,
90 SETTING_TAB_VIEW_DEVICE = 2,
91 SETTING_TAB_VIEW_CONTROL = 3,
92 SETTING_TAB_VIEW_GENERAL = 4,
93 SETTING_TAB_VIEW_APPS = 5,
95 } Setting_Tab_View_Type;
97 typedef enum _setting_view_type {
98 SETTING_INVALID_VIEW = -1,
99 SETTING_LIST_VIEW = 0,
100 SETTING_GRID_VIEW = 1,
101 SETTING_TAB_VIEW = 2,
102 SETTING_EDIT_VIEW = 3,
107 typedef void (*menu_list_load_fn)(void *data);
108 typedef void (*menu_list_load_fn2)(void *, Cfg_Item_Position, Evas_Object *);
110 #define MAX_GROUP_NUM_IN_VIEW 10
113 /* 2 - order of Connection Tab list */
114 typedef enum _List_Load_Connection_Func_Type {
115 Func_Type_Connectivity = 0,
116 Func_Type_ShareAndTransfer,
117 Func_Type_Connection_MAX
118 } List_Load_Connection_Func_Type;
120 typedef enum _List_Load_Display_Func_Type {
123 Func_Type_Display_MAX
124 } List_Load_Display_Func_Type;
126 typedef enum _List_Load_Device_Func_Type {
127 Func_Type_SoundDisplay,
129 Func_Type_MotionControl,
131 } List_Load_Device_Func_Type;
133 typedef enum _List_Load_General_Func_Type {
134 Func_Type_BackupOption,
136 Func_Type_DownloadedApp,
137 Func_Type_General_MAX
138 } List_Load_General_Func_Type;
140 typedef enum _Top_Grid_Item_Type {
146 GRID_ITEM_POWERSAVING,
148 } Top_Grid_Item_Type;
152 * enum for genlist item to be updated
153 * @see setting_update_gl_item
155 typedef enum _Update_GL_Item_Type {
165 GL_ITEM_NETRESTRICTIONMODE,
168 #if SUPPORT_BLOCKINGMODE
171 #if SUPPORT_GUESTMODE
175 } Update_GL_Item_Type;
177 typedef enum _FLIGHT_MODE_OPEARTION {
178 FM_INVALID = 0, /*< There is no request waiting for processing */
179 FM_ENTER = 1, /*< Some "flightmode enter" request is waiting for processing */
180 FM_LEAVE, /*< Some "flightmode leave" request is waiting for processing */
181 } FLIGHT_MODE_OPEARTION;
183 #define IMG_CTRL_ICON_TOP SETTING_ICON_PATH_CFG"tap/A01-1_tap_icon_popular.png"
184 #define IMG_CTRL_ICON_CONNECTION SETTING_ICON_PATH_CFG"tap/A01-1_tap_icon_connection.png"
185 #define IMG_CTRL_ICON_DISPLAY SETTING_ICON_PATH_CFG"tap/A01-1_tap_icon_device.png"
186 #define IMG_CTRL_ICON_GENERAL SETTING_ICON_PATH_CFG"tap/A01-1_tap_icon_general.png"
190 const char *name; /**< name below the icon image */
191 const char *icon_path; /**< icon path (full path) */
192 const char *ug_name; /**< UG name */
193 void *data; /* app context pointer */
194 Elm_Object_Item *item; /**< gengrid object item */
196 typedef struct _GridItem GridItem;
198 #define MAX_GENGRID_TEXT_LEN 13
199 #define MAX_GRID_NUM 12
206 #define GRID_GROUP_H_P 81
207 #define GRID_GROUP_H_L 56
209 #define MAX_MORE_MENU_NUM 6
210 extern const char *fixed_grid_pref_key[];
211 #define WIFI_LAST_ON_OFF_STATE "PREFKEY_WIFI_ON_OFF"
212 #define PREFKEY_VIEW_TYPE "PREFKEY_VIEW_TYPE"
213 #define PREFKEY_TAB_VIEW_TAB "PREFKEY_TAB_VIEW_TAB"
216 OP_WIFI_TURNING_INVALID = 0x00,
222 #define PREFKEY_SETTING_MAIN_DRIVING_MODE_ON_POPUP_REMINDER "setting/main/driving_mode/on/popup_reminder"
234 }; /*genlist or gengrid */
239 VIEW_All_Grid,/*not used to access menus,just for groups(from GL_Group_QuickSettings to GL_Group_Apps) */
275 GL_Group_QuickSettings,
278 GL_Group_SoundDisplay,
280 /*GL_Group_MotionControl, */
288 * @brief main view context
290 typedef struct _setting_main_appdata {
292 ui_gadget_h ug; /**< ug */
297 Evas_Object *ly_editview; /**< Edit mode */
299 Evas_Object *popup_kies_via_wifi;
300 Evas_Object *popup_wifi_mode;
301 Evas_Object *popup_flight_mode;
302 Evas_Object *popup_blocking_mode;
303 Evas_Object *popup_net_restriction_mode;
304 Evas_Object *popup_palmmotion_tts;
305 Evas_Object *popup_palmmotion_enable;
308 Evas_Object *win_main;
310 menu_list_load_fn load_fns[SETTING_TAB_VIEW_MAX][MAX_GROUP_NUM_IN_VIEW]; /**< */
312 Evas_Object *navibar_main;
313 Elm_Object_Item *main_navi_it;
315 Evas_Object *ly_main; /**< seting view main */
316 Evas_Object *gengrid;
317 Evas_Object *sc_gl[SC_Max]; /**< genlist array */
318 Evas_Object *sc_gg[SC_Max]; /**< gengrid array */
320 Setting_GenGroupItem_Data *gl_data_item[VIEW_Max][GL_Max];
321 Setting_GenGroupItem_Data *edit_group_item[GL_Max - GL_Group_QuickSettings];
323 bool isInUGMode; /**< set TRUE when UG is running */
326 * vars for flightmode
328 bool b_fm_requesting; /**< whether some request is processing. 1:yes, 0:no */
329 FLIGHT_MODE_OPEARTION fm_waiting_op;
332 Setting_GenGroupItem_Data *data_joyn;
333 Setting_GenGroupItem_Data *data_flight;
334 Setting_GenGroupItem_Data *data_multi_window;
335 Setting_GenGroupItem_Data *data_netrestrictionmode;
336 Setting_GenGroupItem_Data *data_wifi;
337 Setting_GenGroupItem_Data *data_bt;
338 Setting_GenGroupItem_Data *data_mobileApp;
340 Setting_GenGroupItem_Data *data_bright;
341 Setting_GenGroupItem_Data *data_backlight;
342 Setting_GenGroupItem_Data *data_battery;
343 Setting_GenGroupItem_Data *data_landscape;
344 Setting_GenGroupItem_Data *data_screentone;
345 Setting_GenGroupItem_Data *data_screenmode;
346 Setting_GenGroupItem_Data *data_touchkey_light_duration;
347 Setting_GenGroupItem_Data *data_powersaving;
348 Setting_GenGroupItem_Data *data_driving;
349 Setting_GenGroupItem_Data *data_blocking;
350 Setting_GenGroupItem_Data *data_personalpage;
351 Setting_GenGroupItem_Data *data_guest;
352 Setting_GenGroupItem_Data *data_high_touch_sensitivity;
354 Setting_GenGroupItem_Data *data_moreSystem;
355 Setting_GenGroupItem_Data *data_moreConnect;
356 Setting_GenGroupItem_Data *data_nfc;
357 Setting_GenGroupItem_Data *data_sbeam;
358 Setting_GenGroupItem_Data *data_motion;
359 Setting_GenGroupItem_Data *data_palmmotion;
360 Setting_GenGroupItem_Data *data_nearby_devices;
361 /*following are not for update.. */
362 Setting_GenGroupItem_Data *data_network;
365 Setting_GenGroupItem_Data *data_fixed_gengrid_portrait;
367 Setting_GenGroupItem_Data *data_fixed_gengrid_landscape;
369 Setting_GenGroupItem_Data *data_frequently_portrait; /* genlist item */
370 Setting_GenGroupItem_Data *data_frequently_landscape; /* genlist item */
372 Setting_GenGroupItem_Data *data_frequently_used_portrait; /* title */
373 Setting_GenGroupItem_Data *data_frequently_used_landscape; /* title */
375 Setting_GenGroupItem_Data *data_recently_portrait;
376 Setting_GenGroupItem_Data *data_recently_landscape;
377 Setting_GenGroupItem_Data *data_recently_used_portrait;
378 Setting_GenGroupItem_Data *data_recently_used_landscape;
380 ListItemObject *data_no_result;
382 /*--------------------------------------------------------------- */
384 Setting_Tab_View_Type view_type;
385 Setting_Tab_View_Type select_tab_type;
386 setting_view_type list_type;
387 Evas_Object *ly_select_tab;
388 Evas_Object *select_sub_view[SETTING_TAB_VIEW_MAX];
389 GridItem *select_edit_mode_item;
390 Evas_Object *edit_genlist;
391 Evas_Object *edit_gengrid;
392 Eina_List *edit_sel_list;
393 Elm_Object_Item *edit_navi_it;
394 Elm_Object_Item *select_ctrl_item[3];
396 Evas_Object *main_genlist; /**< 'Setting main' in main page */
398 Elm_Genlist_Item_Class itc[GENDIAL_Type_MAX];
399 Elm_Genlist_Item_Class itc_no_reult;
401 Setting_GenGroupItem_Data *check_all_item; /**< genlist node for "Select all" */
403 Evas_Object *data_roaming_popup;
406 Evas_Object *driving_mode_popup;
407 Evas_Object *driving_mode_popup_chk;
412 /* listen / unlisten code */
413 Eina_List *listened_list;
416 const char *more_connective_menus[MAX_MORE_MENU_NUM];
417 const char *more_system_menus[MAX_MORE_MENU_NUM];
420 Evas_Object *conform;
422 /* NEW UX --------------------------------------------------- */
423 Elm_Object_Item *ctrl_item[SETTING_TAB_VIEW_MAX]; /* 0:Grid, 1:General 2:Applications */
424 Evas_Object *sub_view[SETTING_TAB_VIEW_MAX]; /* 0:Grid, 1:General 2:Applications */
425 Evas_Object *view_layout; /* view layout */
426 Evas_Object *ctrl_bar;
428 Eina_Bool click_flag;
429 Elm_Gengrid_Item_Class *gic;
430 Elm_Gengrid_Item_Class groupic;
431 Elm_Gengrid_Item_Class editGic;
432 Ecore_Timer *save_idler;
434 Ecore_Timer *update_idler;
436 Ecore_Timer *bt_timer;
437 Ecore_Timer *nfc_timer;
438 Ecore_Timer *wifi_timer;
439 Ecore_Idler *update_font_idler;
440 Ecore_Timer *dashboard_timer;
441 int current_rotation;
445 /* ---------------------------------------------------------- */
447 Ecore_Timer *event_freeze_timer;
449 /* FEATURE : setting search */
452 Evas_Object *ly_topview;
453 Evas_Object *search_genlist;
456 ListItemObject *search_selected_item_data;
458 account_subscribe_h account_subscribe_handle;
459 Evas_Object *search_bar;
460 char search_text[512 + 1];
461 char current_search_text[512 + 1];
462 Ecore_Idler *search_idler;
463 Eina_Bool nfc_try_activate_running;
465 Elm_Object_Item *grid_item[6];
470 Cfg_Item_Type is_searchmode;
472 Setting_GenGroupItem_Data *data_temp;
475 Evas_Object *cis_left_panel;
476 Evas_Object *cis_left_panel_list;
478 bool cis_style_gengrid;
479 Evas_Object *current_gengrid;
481 Elm_Genlist_Item_Class itc_expand_grid;
484 Ea_Theme_Color_Table *theme_table;
486 Eina_Hash *main_list_hash;
488 } setting_main_appdata;
489 extern setting_main_appdata *g_main_ad;
490 extern const char *menu_group[];
493 extern setting_view setting_view_main;
494 extern setting_view setting_view_edit_mode;
496 extern void __gl_realized(void *data, Evas_Object *obj, void *event_info);
497 extern void setting_main_refresh_topview_list(void *data);
499 extern Evas_Object *__get_top_list(void *data);
500 extern void setting_main_click_list_ex_ug_cb(void *data, Evas_Object *obj, void *event_info);
501 extern GridItem *__main_grid_item_append(Evas_Object *gengrid, const Elm_Genlist_Item_Class *itc,
502 setting_call_back_func gl_sel, const char *key_name,
503 const char *icon_path, const char *ug_name,
505 extern Eina_Bool __save_timer(void *data);
507 typedef Setting_GenGroupItem_Data *(*UI_HANDLER)(void *data, char *title, char *iconpath, char *ugname, Evas_Object *genlist, Elm_Object_Item *parent);
515 } mainlist_entry_action_type;
517 typedef struct _mainlist_entry {
519 UI_HANDLER ui_handler;
520 mainlist_entry_action_type type;
521 /*-------------------------------------------------- */
525 #endif /* __SETTING_H__ */