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"
191 const char* name; /**< name below the icon image */
192 const char* icon_path; /**< icon path (full path) */
193 const char* ug_name; /**< UG name */
194 void* data; /* app context pointer */
195 Elm_Object_Item *item; /**< gengrid object item */
197 typedef struct _GridItem GridItem;
199 #define MAX_GENGRID_TEXT_LEN 13
200 #define MAX_GRID_NUM 12
207 #define GRID_GROUP_H_P 81
208 #define GRID_GROUP_H_L 56
210 #define MAX_MORE_MENU_NUM 6
211 extern const char *fixed_grid_pref_key[];
212 #define WIFI_LAST_ON_OFF_STATE "PREFKEY_WIFI_ON_OFF"
213 #define PREFKEY_VIEW_TYPE "PREFKEY_VIEW_TYPE"
214 #define PREFKEY_TAB_VIEW_TAB "PREFKEY_TAB_VIEW_TAB"
217 OP_WIFI_TURNING_INVALID = 0x00,
223 #define PREFKEY_SETTING_MAIN_DRIVING_MODE_ON_POPUP_REMINDER "setting/main/driving_mode/on/popup_reminder"
236 }; //genlist or gengrid
242 VIEW_All_Grid,//not used to access menus,just for groups(from GL_Group_QuickSettings to GL_Group_Apps)
279 GL_Group_QuickSettings,
282 GL_Group_SoundDisplay,
284 //GL_Group_MotionControl,
292 * @brief main view context
294 typedef struct _setting_main_appdata {
296 ui_gadget_h ug; /**< ug */
301 Evas_Object* ly_editview; /**< Edit mode */
303 Evas_Object *popup_kies_via_wifi;
304 Evas_Object *popup_wifi_mode;
305 Evas_Object *popup_flight_mode;
306 Evas_Object *popup_blocking_mode;
307 Evas_Object *popup_net_restriction_mode;
308 Evas_Object *popup_palmmotion_tts;
309 Evas_Object *popup_palmmotion_enable;
312 Evas_Object *win_main;
314 menu_list_load_fn load_fns[SETTING_TAB_VIEW_MAX][MAX_GROUP_NUM_IN_VIEW]; /**< */
316 Evas_Object *navibar_main;
317 Elm_Object_Item *main_navi_it;
319 Evas_Object *ly_main; /**< seting view main */
320 Evas_Object *gengrid;
321 Evas_Object *sc_gl[SC_Max]; /**< genlist array */
322 Evas_Object *sc_gg[SC_Max]; /**< gengrid array */
324 Setting_GenGroupItem_Data *gl_data_item[VIEW_Max][GL_Max];
325 Setting_GenGroupItem_Data *edit_group_item[GL_Max-GL_Group_QuickSettings];
327 bool isInUGMode; /**< set TRUE when UG is running */
330 * vars for flightmode
332 bool b_fm_requesting; /**< whether some request is processing. 1:yes, 0:no */
333 FLIGHT_MODE_OPEARTION fm_waiting_op;
336 Setting_GenGroupItem_Data *data_joyn;
337 Setting_GenGroupItem_Data *data_flight;
338 Setting_GenGroupItem_Data *data_multi_window;
339 Setting_GenGroupItem_Data *data_netrestrictionmode;
340 Setting_GenGroupItem_Data *data_wifi;
341 Setting_GenGroupItem_Data *data_bt;
342 Setting_GenGroupItem_Data *data_mobileApp;
344 Setting_GenGroupItem_Data *data_bright;
345 Setting_GenGroupItem_Data *data_backlight;
346 Setting_GenGroupItem_Data *data_battery;
347 Setting_GenGroupItem_Data *data_landscape;
348 Setting_GenGroupItem_Data *data_screentone;
349 Setting_GenGroupItem_Data *data_screenmode;
350 Setting_GenGroupItem_Data *data_touchkey_light_duration;
351 Setting_GenGroupItem_Data *data_powersaving;
352 Setting_GenGroupItem_Data *data_driving;
353 Setting_GenGroupItem_Data *data_blocking;
354 Setting_GenGroupItem_Data *data_personalpage;
355 Setting_GenGroupItem_Data *data_guest;
356 Setting_GenGroupItem_Data *data_high_touch_sensitivity;
358 Setting_GenGroupItem_Data *data_moreSystem;
359 Setting_GenGroupItem_Data *data_moreConnect;
360 Setting_GenGroupItem_Data *data_nfc;
361 Setting_GenGroupItem_Data *data_sbeam;
362 Setting_GenGroupItem_Data *data_motion;
363 Setting_GenGroupItem_Data *data_palmmotion;
364 Setting_GenGroupItem_Data *data_nearby_devices;
365 //following are not for update..
366 Setting_GenGroupItem_Data *data_network;
369 Setting_GenGroupItem_Data *data_fixed_gengrid_portrait;
371 Setting_GenGroupItem_Data *data_fixed_gengrid_landscape;
373 Setting_GenGroupItem_Data *data_frequently_portrait; // genlist item
374 Setting_GenGroupItem_Data *data_frequently_landscape; // genlist item
376 Setting_GenGroupItem_Data *data_frequently_used_portrait; // title
377 Setting_GenGroupItem_Data *data_frequently_used_landscape; // title
379 Setting_GenGroupItem_Data *data_recently_portrait;
380 Setting_GenGroupItem_Data *data_recently_landscape;
381 Setting_GenGroupItem_Data *data_recently_used_portrait;
382 Setting_GenGroupItem_Data *data_recently_used_landscape;
384 ListItemObject *data_no_result;
386 //---------------------------------------------------------------
388 Setting_Tab_View_Type view_type;
389 Setting_Tab_View_Type select_tab_type;
390 setting_view_type list_type;
391 Evas_Object* ly_select_tab;
392 Evas_Object *select_sub_view[SETTING_TAB_VIEW_MAX];
393 GridItem* select_edit_mode_item;
394 Evas_Object* edit_genlist;
395 Evas_Object* edit_gengrid;
396 Eina_List *edit_sel_list;
397 Elm_Object_Item *edit_navi_it;
398 Elm_Object_Item *select_ctrl_item[3];
400 Evas_Object *main_genlist; /**< 'Setting main' in main page */
402 Elm_Genlist_Item_Class itc[GENDIAL_Type_MAX];
403 Elm_Genlist_Item_Class itc_no_reult;
405 Setting_GenGroupItem_Data *check_all_item; /**< genlist node for "Select all" */
407 Evas_Object *data_roaming_popup;
410 Evas_Object *driving_mode_popup;
411 Evas_Object *driving_mode_popup_chk;
416 // listen / unlisten code
417 Eina_List *listened_list;
420 const char *more_connective_menus[MAX_MORE_MENU_NUM];
421 const char *more_system_menus[MAX_MORE_MENU_NUM];
424 Evas_Object *conform;
426 // NEW UX ---------------------------------------------------
427 Elm_Object_Item *ctrl_item[SETTING_TAB_VIEW_MAX]; // 0:Grid, 1:General 2:Applications
428 Evas_Object *sub_view[SETTING_TAB_VIEW_MAX]; // 0:Grid, 1:General 2:Applications
429 Evas_Object* view_layout; // view layout
430 Evas_Object *ctrl_bar;
432 Eina_Bool click_flag;
433 Elm_Gengrid_Item_Class *gic;
434 Elm_Gengrid_Item_Class groupic;
435 Elm_Gengrid_Item_Class editGic;
436 Ecore_Timer *save_idler;
438 Ecore_Timer *update_idler;
440 Ecore_Timer *bt_timer;
441 Ecore_Timer *nfc_timer;
442 Ecore_Timer *wifi_timer;
443 Ecore_Idler *update_font_idler;
444 Ecore_Timer *dashboard_timer;
445 int current_rotation;
449 // ----------------------------------------------------------
451 Ecore_Timer *event_freeze_timer;
453 // FEATURE : setting search
456 Evas_Object* ly_topview;
457 Evas_Object *search_genlist;
460 ListItemObject *search_selected_item_data;
462 account_subscribe_h account_subscribe_handle;
463 Evas_Object *search_bar;
464 char search_text[512 + 1];
465 char current_search_text[512+1];
466 Ecore_Idler *search_idler;
467 Eina_Bool nfc_try_activate_running;
469 Elm_Object_Item *grid_item[6];
474 Cfg_Item_Type is_searchmode;
476 Setting_GenGroupItem_Data *data_temp;
479 Evas_Object *cis_left_panel;
480 Evas_Object *cis_left_panel_list;
482 bool cis_style_gengrid;
483 Evas_Object *current_gengrid;
485 Elm_Genlist_Item_Class itc_expand_grid;
488 Ea_Theme_Color_Table *theme_table;
490 Eina_Hash *main_list_hash;
492 } setting_main_appdata;
493 extern setting_main_appdata *g_main_ad;
494 extern const char *menu_group[];
497 extern setting_view setting_view_main;
498 extern setting_view setting_view_edit_mode;
500 extern void __gl_realized(void *data, Evas_Object *obj, void *event_info);
501 extern void setting_main_refresh_topview_list(void *data);
503 extern Evas_Object *__get_top_list(void *data);
504 extern void setting_main_click_list_ex_ug_cb(void *data, Evas_Object *obj, void *event_info);
505 extern GridItem *__main_grid_item_append(Evas_Object *gengrid, const Elm_Genlist_Item_Class *itc,
506 setting_call_back_func gl_sel, const char *key_name,
507 const char *icon_path, const char *ug_name,
509 extern Eina_Bool __save_timer(void *data);
511 typedef Setting_GenGroupItem_Data* (*UI_HANDLER)(void* data, char* title, char* iconpath, char* ugname, Evas_Object *genlist, Elm_Object_Item *parent);
520 } mainlist_entry_action_type;
522 typedef struct _mainlist_entry {
524 UI_HANDLER ui_handler;
525 mainlist_entry_action_type type;
526 //--------------------------------------------------
530 #endif /* __SETTING_H__ */