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.
23 *@defgroup common-data-type
27 #ifndef __SETTING_COMMON_DATA_TYPE_H__
28 #define __SETTING_COMMON_DATA_TYPE_H__
30 #include <Elementary.h> /* including Elementary lib */
31 #include <setting-debug.h> /* including debuging type */
32 #include <setting-common-resource.h> /* including one class of data type */
33 #include <setting-common-data-error.h> /* including another class of data type */
40 #define bool Eina_Bool
42 #define PWD_FILE "/opt/data/setting/set_info"
43 //#define PLUGIN_CFG_DIR "/opt/data/setting/plugin-cfg"
44 #define PLUGIN_CFG_DIR "/opt/data/setting/plugin-xml"
46 #define SETTING_POSTINST_FILE "/var/lib/dpkg/info/org.tizen.setting.postinst"
47 #define SETTING_PACKAGE "setting"
48 #define SYSTEM_PACKAGE "sys_string"
49 #define SETTING_LOCALEDIR "/opt/apps/org.tizen.setting/res/locale"
51 #define SYSTEM_ICON_PATH "/opt/apps/org.tizen.setting/res/icons"
52 #define SETTING_ICON_PATH "/opt/apps/org.tizen.setting/res/icons"
53 #define SETTING_UG_ICON_PATH "/opt/ug/res/icon/org.tizen.setting"
54 #define SETTING_UG_PATH "/opt/ug/lib"
55 #define SETTING_UG_PATH_USR "/usr/ug/lib"
57 #define SETTING_EDJ_PATH EDJDIR
58 #define SETTING_MEMORY_EDJ_NAME SETTING_EDJ_PATH"/setting-memory.edj"
59 #define SETTING_THEME_EDJ_NAME SETTING_EDJ_PATH"/setting-theme.edj"
60 #define SETTING_SOUND_EDJ_NAME SETTING_EDJ_PATH"/setting-sound.edj"
62 /* inoti (broadcasting without data */
63 #define SETTING_TIME_CHANGED "setting_time_changed"
65 /* anci c color type */
66 #define SETTING_FONT_RED "\033[31m"
67 #define SETTING_FONT_BLACK "\033[0m"
68 #define SETTING_FONT_BGREEN "\033[36m"
70 #define THEME_STYLE "beat"
72 #define IMG_EC_ARROW_OPEN SETTING_ICON_PATH"/00_button_expand_opened.png"
73 #define IMG_EC_ARROW_CLOSE SETTING_ICON_PATH"/00_button_expand_closed.png"
75 #define SETTING_IDLE_IMAGE_PATH "/etc/idle_image/"
77 #ifdef SUPPORT_NAVIGATIONBAR
78 #define NAVI_CONTROLBAR_STYLE "navigationbar"
79 #define NAVI_DEF_BUTTON_STYLE "navigationbar_control/center"
80 #define NAVI_BACK_BUTTON_STYLE "navigationbar_backbutton/default"
82 #define NAVI_CONTROLBAR_STYLE "naviframe"
83 #define NAVI_DEF_BUTTON_STYLE "naviframe_control/default"
84 #define NAVI_BACK_BUTTON_STYLE "naviframe/back_btn/default"
87 #if SUPPORT_BOTTOM_BTNS
88 #define NAVI_CONTROLBAR_PART "controlbar"
90 #define NAVI_CONTROLBAR_PART "optionheader"
92 #define BTN_STYLE_DEF "naviframe/title/default"
93 #define NAVI_BTN_STYLE_LEFT "title_left_btn"
94 #define NAVI_BTN_STYLE_RIGHT "title_right_btn"
95 #define NAVI_BTN_STYLE_MORE "title_more_btn"
96 #define NAVI_BTN_STYLE_PREV "prev_btn"
98 #define SETTING_FONT_CONF_FILE "/opt/etc/fonts/conf.avail/99-slp.conf"
101 * @brief slider, button, and etc.
103 * @param data application context
104 * @param obj Evas Object
105 * @param event_info even type
109 typedef void (*setting_call_back_func) (void *data, Evas_Object *obj, void *event_info);
111 #define WIDGET_SCALE_FACTOR (get_widgets_factor())
112 #define SETTING_PADDING_WIDTH (8 * WIDGET_SCALE_FACTOR)
113 #define SETTING_PADDING_HEIGHT (8 * WIDGET_SCALE_FACTOR)
114 #define SETTING_HALF_SCREEN_WIDTH \
115 (SETTING_PADDING_WIDTH * 22 * WIDGET_SCALE_FACTOR)
117 #define SYS_NOTI_NAME_LEN 128
118 #define MAX_DISPLAY_NAME_LEN_ON_UI 128
119 #define MAX_COMMON_BUFFER_LEN 1024
121 #define MAX_SEARCH_STR_LEN 20
123 #define HELP_MSG_BUFF_SIZE 1000
124 #define MAX_SPECIALIZITION_LEN 1000
125 #define SPECIALIZITION_FONT 25
126 #define HELP_TITLE_SIZE 30
127 #define HELP_CONTENT_SIZE 28
129 #define PHONE_LOCK_ATTEMPS_MAX 5
130 #define SIM_LOCK_ATTEMPS_MAX 5
131 #define PHONE_LOCK_BLOCK_SECONDS 30
132 #define SIM_LOCK_BLOCK_SECONDS 30
133 #define LOCK_TIMESTAMP_LEN 64
134 #define MAX_DATETIME_FORMAT_LEN 64
135 #define MAX_DATE_FORMAT_LEN 10
137 #define SMALL_FONT_DPI (-80)
138 #define MIDDLE_FONT_DPI (-100)
139 #define LARGE_FONT_DPI (-144)
140 #define HUGE_FONT_DPI (-184)
141 #define GIANT_FONT_DPI (-240)
143 #define LABEL_FONT_SIZE_SMALL 24
144 #define LABEL_FONT_SIZE_NORMAL 35
145 #define LABEL_FONT_SIZE_LARGE 55
146 #define LABEL_FONT_SIZE_HUGE 75
147 #define LABEL_FONT_SIZE_GIANT 92
149 #define __STR_EMUL "emul"
150 #define __LEN_STR_EMUL 4
152 #define MAX_SYSTEM_SERVICE_NUM 30
153 #define SYSTEM_SERVICE_LIST_PATH "/opt/osp/system/configuration/system-services.list"
154 #define MAX_PKG_NAME_LEN 128
159 char* locale; // ex) "en_US.UTF"
160 char* title; // "United Kingdom"
161 int number; // no - UI
162 } setting_lang_entry;
166 typedef enum _Theme_Type {
169 Theme_Tizen_Black = 1,
174 typedef enum _GENDIAL_Type {
175 GENDIAL_Type_1text_1icon_2 = 0,
176 GENDIAL_Type_1text_2icon = 1,
177 GENDIAL_Type_1icon_2text = 2,
178 GENDIAL_Type_2text_2icon_4 = 3,
179 GENDIAL_Type_1text_2icon_2 = 4,
180 GENDIAL_Type_sel_all,
182 GENDIAL_Type_1line_icontext,
183 GENDIAL_Type_group_item,
184 GENDIAL_Type_2text_3,
188 typedef enum _SWALLOW_Type {
189 SWALLOW_Type_INVALID = -1,
190 SWALLOW_Type_2ICON = 0,
191 SWALLOW_Type_1ICON_1CHECK = 1,
192 SWALLOW_Type_1ICON_1RADIO = 2,
193 SWALLOW_Type_1CHECK = 3,
194 SWALLOW_Type_1CHECKICON = 4,
195 SWALLOW_Type_1RADIO = 5,
196 SWALLOW_Type_1TOGGLE = 6,
197 SWALLOW_Type_MULTILINE_1TOGGLE,
199 SWALLOW_Type_1ICON_1IMAGE,
200 SWALLOW_Type_1BUTTON,
201 SWALLOW_Type_1PROCESS,
203 SWALLOW_Type_1RADIO_SUB,
204 SWALLOW_Type_1RADIO_1PROCESS,
205 SWALLOW_Type_1RADIO_1SEARCH,
206 SWALLOW_Type_1RADIO_1LABLE,
207 SWALLOW_Type_1SEARCH,
209 SWALLOW_Type_1LINE_LAYOUT = 20,
210 SWALLOW_Type_1LINE_LAYOUT_1RADIO,
211 SWALLOW_Type_1LINE_LAYOUT_1TOGGLE,
212 SWALLOW_Type_1LINE_LAYOUT_1CHECK,
213 SWALLOW_Type_LAYOUT_ENTRY,
214 SWALLOW_Type_LAYOUT_SIMPLE_PASSWORD, // for simple password
215 SWALLOW_Type_LAYOUT_DATEFIELD,
216 SWALLOW_Type_LAYOUT_SLIDER,
217 SWALLOW_Type_LAYOUT_SPECIALIZTION,
218 SWALLOW_Type_LAYOUT_SPECIALIZTION_X,//extension
224 UNDEFINED_LIB_SYMBOL = -2,/* undefined symbol : -2 */
225 LOAD_LIB_FAILED = -1,/* load failed : -1 */
226 OPERATE_LIB_SUCESS = 0,
229 typedef enum _POPUP_BTN_RESPONSE_TYPE{
230 POPUP_RESPONSE_INVALID = -1,
231 POPUP_RESPONSE_OK = 0,
232 POPUP_RESPONSE_CANCEL = 1,
233 } POPUP_BTN_RESPONSE_TYPE;
235 *an item node in genlist
236 * @todo begings_to is requried?
237 * @todo isItemDisableFlag is required?
238 * @todo isSinglelineFlag is requred?
242 typedef struct Setting_GenGroupItem_Data Setting_GenGroupItem_Data;
244 typedef struct Setting_GenGroupItem_Data {
248 Elm_Object_Item *item;
249 SWALLOW_Type swallow_type;
250 const char *l_swallow_path;
251 const char *r_swallow_path;
253 Evas_Object *win_main;
257 Evas_Object *rgd; /**< radio button */
258 int usb_index; /**< usb_index number of radio buttons, ex) USB setting */
261 Evas_Object *eo_check; /**< slider, button, check, editfield, datefield */
262 setting_call_back_func chk_change_cb;
264 int chk_status; /**< represent check value, slider value, datefield value etc.. */
265 char *keyStr; /**< title */
266 char *sub_desc; /**< sub text */
268 /* to swallow a whole layout (genlist item is 1line-layout or 2line-layout) */
269 char *item_style; /**< itc style name */
271 /* for slider control */
272 bool isIndicatorVisible; /**< indicator option (displaying number) */
273 double slider_min; /**< to swallow a slider */
274 double slider_max; /**< to swallow a slider */
275 setting_call_back_func start_change_cb;
276 setting_call_back_func stop_change_cb;
278 /* sound/vibration */
279 int belongs_to; /**< 1: slider belongs to sound group. 0: slider belongs to vibration group */
282 Elm_Input_Panel_Layout input_type; /**< input panel type */
283 bool input_panel_disable_flag; /** do not show the input panel automatically when the widget is clicked or has focus*/
285 void *userdata; /**< just a reference, do not need release. */
289 bool isItemDisableFlag; /**< date/time UG only */
290 bool isSinglelineFlag;
292 int int_slp_setting_binded; /**< its relative vconf value must increase from 0, and step is 1. eg, 0, 1, 2, 3.. */
296 Evas_Object *notify; /**< act as any popup to show user any message */
298 Elm_Entry_Filter_Accept_Set *digits_filter_data;
299 Elm_Entry_Filter_Limit_Size *limit_filter_data;
301 Eina_List* childs; /**< child nodes if this node has child nodes for handling radio buttons */
305 SETTING_VCONF_INT_TYPE = 0,
306 SETTING_VCONF_BOOL_TYPE,
307 SETTING_VCONF_STR_TYPE
308 } setting_vconf_type;
310 #define MAX_RESET_MENU_NUM 50
312 typedef struct _item_table {
313 char *item_name; /* pointer to the key string */
315 Setting_GenGroupItem_Data *data_GenItem;
319 * @todo is 50 sufficient value?
321 typedef struct _Setting_Done_List_Data {
322 /* external input arguements */
323 Evas_Object *win_main;
325 Evas_Object *ly_parent;
326 Evas_Object *controllbar;
328 /* internal output%input arguements */
329 Item_Table chk_items[MAX_RESET_MENU_NUM];
331 Evas_Object *selInfoPop;
332 Evas_Object *selInfoPop_layout;
333 Elm_Genlist_Item_Class itc_1text_1icon;
334 Elm_Genlist_Item_Class itc_seperator;
335 Elm_Genlist_Item_Class itc_sel_all;
336 Evas_Object *select_all_checkbox;
337 Eina_Bool select_all_checked;
338 } Setting_Done_List_Data;
340 #endif /* __SETTING_COMMON_DATA_TYPE_H__ */