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.
21 #include <setting-common-draw-widget.h>
23 #include <system_settings.h>
24 #include <efl_assist.h>
25 #include <setting-debug.h>
27 #define DEF_BUF_SIZE 32
29 static Evas_Object *_gl_Gendial_content_get(void *data, Evas_Object *obj, const char *part);
30 static char *_gl_Gendial_text_get(void *data, Evas_Object *obj, const char *part);
31 static void _gl_Gendial_del(void *data, Evas_Object *obj);
34 const Elm_Genlist_Item_Class itc_seperator = {
35 .item_style = "dialogue/separator.transparent.2",
36 .func.text_get = NULL,
37 .func.content_get = NULL,
38 .func.state_get = NULL,
43 const Elm_Genlist_Item_Class itc_bottom_seperator = {
45 .func.text_get = NULL,
46 .func.content_get = NULL,
47 .func.state_get = NULL,
52 const Elm_Genlist_Item_Class itc_sep_line = {
53 .item_style = "dialogue/separator.transparent.2",
54 .func.text_get = _gl_Gendial_text_get,
55 .func.content_get = NULL,
56 .func.state_get = NULL,
61 const Elm_Genlist_Item_Class itc_bottom_line = {
62 .item_style = "bottom_line",
63 .func.text_get = NULL,
64 .func.content_get = NULL,
65 .func.state_get = NULL,
69 #define DEFINE_ITC1(style, name) \
70 EXPORT_PUBLIC const Elm_Genlist_Item_Class name = {\
72 .func.text_get = _gl_Gendial_text_get,\
73 .func.content_get = _gl_Gendial_content_get,\
74 .func.state_get = NULL,\
75 .func.del = _gl_Gendial_del,\
78 DEFINE_ITC1("1line", itc_1text);
79 DEFINE_ITC1("1line", itc_1text_1icon_2);
80 DEFINE_ITC1("1line", itc_1text_1icon_2_tb);
82 DEFINE_ITC1("dialogue/editfield/title", itc_dialogue_editfield_title);
83 DEFINE_ITC1("1icon", itc_1icon);
84 DEFINE_ITC1("1line", itc_1icon_1text_sub);
85 DEFINE_ITC1("1line", itc_1text_1icon);
86 DEFINE_ITC1("1line", itc_1text_1icon_3);
87 DEFINE_ITC1("1line", itc_1text_2icon);
88 DEFINE_ITC1("1line", itc_1text_2icon_2);
89 DEFINE_ITC1("1line", itc_1text_2icon_10);
91 DEFINE_ITC1("2line.top", itc_2text_2);
92 DEFINE_ITC1("2line.top", itc_2text);
93 DEFINE_ITC1("multiline_sub.main", itc_multiline_2text_1icon);
94 DEFINE_ITC1("2line.top", itc_2text_1icon_3);
95 DEFINE_ITC1("2line.top", itc_2text_1icon_2);
96 DEFINE_ITC1("2line.top", itc_2text_1icon_6);
97 DEFINE_ITC1("2line.top", itc_2text_1icon_7);
98 DEFINE_ITC1("2line.top", itc_2text_1icon_10);
100 DEFINE_ITC1("2line.top.2", itc_2text_3_parent);
101 DEFINE_ITC1("2line.top", itc_1text_parent);
103 DEFINE_ITC1("2line.top", itc_2text_3);
104 DEFINE_ITC1("2line.top", itc_2text_2icon_3);
106 /*DEFINE_ITC1("multiline/1text", itc_multiline_text); */
107 DEFINE_ITC1("multiline_sub", itc_multiline_text);
108 DEFINE_ITC1("1line", itc_1text_1icon_3_tb);
109 DEFINE_ITC1("1line", itc_cm_1text_1icon_2);
110 DEFINE_ITC1("select_all", itc_sel_all);
111 /*DEFINE_ITC1("dialogue/bg/1icon", itc_bg_1icon); */
112 DEFINE_ITC1("1icon", itc_bg_1icon);
113 DEFINE_ITC1("groupindex", itc_group_item);
114 DEFINE_ITC1("1icon", itc_1icon_with_no_line);
115 DEFINE_ITC1("1icon", itc_1icon_with_no_padding);
116 DEFINE_ITC1("1line", itc_multiline_1text_1icon);
117 DEFINE_ITC1("1line", itc_1text_2icon_divider);
118 DEFINE_ITC1("1line", itc_no_group_1text_1icon_2);
120 DEFINE_ITC1("entry.main", itc_editfield);
121 DEFINE_ITC1("2line.top", itc_multiline_2text);
122 DEFINE_ITC1("1line", itc_1text_1icon_divider);
123 DEFINE_ITC1("1text", itc_normal_1text);
125 typedef struct _tagParamData {
126 Setting_GenGroupItem_Data *item_data;
128 /* Evas_Object *btn_left; */
129 /* Evas_Object *btn_right; */
131 } Datefield_Paramdata;
135 * Do process when clicking on a common genlist item
138 void setting_mouse_up_Gendial_list_radio_cb(void *data, Evas_Object *obj,
142 retm_if(event_info == NULL, "Invalid argument: event info is NULL");
143 Elm_Object_Item *item = (Elm_Object_Item *) event_info;
144 elm_genlist_item_selected_set(item, 0);
145 Setting_GenGroupItem_Data *list_item =
146 (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
148 setting_retm_if(data == NULL, "Data parameter is NULL");
149 Evas_Object *radio = data;
150 setting_retm_if(NULL == list_item, "list_item is NULL");
151 elm_radio_value_set(radio, list_item->chk_status);
154 static void __radio_changed(void *data, Evas_Object *obj, void *event_info)
156 retm_if(data == NULL, "Data parameter is NULL");
157 Setting_GenGroupItem_Data *list_item =
158 (Setting_GenGroupItem_Data *) data;
159 list_item->chk_status = elm_radio_value_get(obj); /* for update */
162 static void __entry_changed(void *data, Evas_Object *obj, void *event_info)
164 retm_if(data == NULL, "Data parameter is NULL");
166 Setting_GenGroupItem_Data *list_item =
167 (Setting_GenGroupItem_Data *) data;
168 list_item->sub_desc = (char *)g_strdup(elm_entry_entry_get(obj));
169 Evas_Object *entry_container = elm_object_parent_widget_get(obj);
170 if (entry_container) {
171 if (elm_entry_is_empty(obj)) {
172 elm_object_signal_emit(entry_container, "elm,state,guidetext,show", "elm");
173 elm_object_signal_emit(entry_container, "elm,state,eraser,hide", "elm");
175 elm_object_signal_emit(entry_container, "elm,state,guidetext,hide", "elm");
176 if (elm_object_focus_get(obj)) { /*only do when entry is focused */
177 elm_object_signal_emit(entry_container, "elm,state,eraser,show", "elm");
183 static void __entry_unfocused(void *data, Evas_Object *obj, void *event_info) /* Unfocused callback will show guidetext and hide X marked button. */
187 Evas_Object *entry_container = data;
188 /*whe entry unfocused, its guidetext will becomes "Input here" */
190 if (elm_entry_is_empty(obj)) {
191 elm_object_part_text_set(entry_container, "elm.guidetext", _("IDS_ST_BODY_TAP_TO_INSERT"));
192 elm_object_signal_emit(entry_container, "elm,state,guidetext,show", "elm");
194 elm_object_signal_emit(entry_container, "elm,state,eraser,hide", "elm");
197 static void __entry_focused(void *data, Evas_Object *obj, void *event_info) /* Focused callback will show X marked button and hide guidetext. */
201 Evas_Object *entry_container = data;
202 /*whe entry focused, its guidetext will becomes "Input here" */
204 if (!elm_entry_is_empty(obj)) {
205 elm_object_signal_emit(entry_container, "elm,state,eraser,show", "elm");
207 elm_object_part_text_set(entry_container, "elm.guidetext", _("IDS_ST_BODY_TAP_TO_INSERT"));
209 elm_object_signal_emit(entry_container, "elm,state,guidetext,hide", "elm");
211 Ecore_IMF_Context *imf_context = (Ecore_IMF_Context *)elm_entry_imf_context_get(obj);
212 if (imf_context) ecore_imf_context_input_panel_show(imf_context);
215 static void __eraser_clicked(void *data, Evas_Object *obj, const char *emission, const char *source) /* When X marked button is clicked, empty entry's contents. */
218 Evas_Object *entry = data;
219 elm_entry_entry_set(entry, "");
220 elm_object_focus_set(entry, EINA_TRUE);
223 static void __chk_changed(void *data, Evas_Object *obj, void *event_info)
225 retm_if(data == NULL, "Data parameter is NULL");
226 Setting_GenGroupItem_Data *list_item =
227 (Setting_GenGroupItem_Data *) data;
228 list_item->chk_status = elm_check_state_get(obj); /* for update */
231 static void __error_popup_response_cb(void *data, Evas_Object *obj,
235 retm_if(data == NULL, "Data parameter is NULL");
236 Setting_GenGroupItem_Data *list_item = data;
237 if (list_item->notify) {
238 evas_object_del(list_item->notify);
239 list_item->notify = NULL;
243 static void __max_len_reached(void *data, Evas_Object *obj, void *event_info)
246 retm_if(data == NULL, "Data parameter is NULL");
247 retm_if(!elm_object_focus_get(obj), "Entry is not focused");/*notify only when entry is being focused on. */
249 Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
250 if (!list_item->notify) {
251 list_item->notify = setting_create_popup_without_btn(list_item, list_item->win_main,
252 NULL, _(EXCEED_LIMITATION_STR),
253 __error_popup_response_cb,
254 POPUP_INTERVAL, FALSE, FALSE);
255 elm_object_focus_set(list_item->eo_check, EINA_FALSE);
257 /*postpone 2 seconds again */
258 elm_popup_timeout_set(list_item->notify, POPUP_INTERVAL);
263 static void __entry_keydown(void *data, Evas *e, Evas_Object *obj, void *event_info)
265 retm_if(data == NULL, "Data parameter is NULL");
266 retm_if(event_info == NULL, "event_info is NULL");
267 Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
268 Evas_Event_Key_Down *ev = (Evas_Event_Key_Down *)event_info;
269 list_item->enterKeyPressFlag = FALSE;
270 list_item->spaceKeyPressFlag = FALSE;
271 if (safeStrCmp(ev->key, "KP_Enter") == 0 /*it is for Japanese keyboard to fix N_SE-10719 */
272 || safeStrCmp(ev->key, "Return") == 0) { /*to disable the 'Enter' orginal function */
273 SETTING_TRACE("ENTER %s ev->key:%s", __FUNCTION__, ev->key);
274 list_item->enterKeyPressFlag = TRUE;
275 /*hide the eraser button */
276 /*format like:xx<br/> */
277 if (list_item->isSinglelineFlag == FALSE) {
278 const char *entry_str = remove_first_substring(elm_entry_entry_get(obj), "<br/>");
279 elm_entry_entry_set(obj, entry_str);
281 elm_entry_cursor_end_set(obj);
283 setting_hide_input_pannel_cb(obj);
285 if (safeStrCmp(ev->key, "space") == 0) {
286 list_item->spaceKeyPressFlag = TRUE;
288 list_item->spaceKeyPressFlag = FALSE;
294 * Do process when clicking radio in subitem of expandable item
297 void setting_sub_list_rd_change(void *data, Evas_Object *obj, void *event_info)
300 retm_if(data == NULL, "Data parameter is NULL");
301 Setting_GenGroupItem_Data *list_item =
302 (Setting_GenGroupItem_Data *) data;
303 list_item->chk_status = elm_radio_value_get(obj); /* for update */
305 Elm_Object_Item *subItem = list_item->item;
306 Elm_Object_Item *parentItem = elm_genlist_item_parent_get(subItem);
308 Setting_GenGroupItem_Data *data_subItem = elm_object_item_data_get(subItem); /* subItem data */
309 Setting_GenGroupItem_Data *data_parentItem = elm_object_item_data_get(parentItem); /* parent data */
311 ret_if(NULL == data_subItem || NULL == data_parentItem);
313 setting_set_int_slp_key(data_parentItem->int_slp_setting_binded,
314 list_item->chk_status, &err);
316 data_parentItem->sub_desc = (char *)g_strdup(_(data_subItem->keyStr));
317 elm_object_item_data_set(data_parentItem->item, data_parentItem);
318 elm_genlist_item_update(data_parentItem->item);
322 * Do process when clicking on subitem of expandable item
325 void setting_sub_list_sel_cb(void *data, Evas_Object *obj, void *event_info)
329 retm_if(event_info == NULL, "Invalid argument: event info is NULL");
330 Elm_Object_Item *subitem = (Elm_Object_Item *) event_info;
331 Elm_Object_Item *parentItem = elm_genlist_item_parent_get(subitem);
332 elm_genlist_item_selected_set(subitem, 0);
333 Setting_GenGroupItem_Data *data_subItem =
334 elm_object_item_data_get(subitem);
335 Setting_GenGroupItem_Data *data_parentItem = elm_object_item_data_get(parentItem); /* parent data */
336 ret_if(NULL == data_subItem || NULL == data_parentItem);
338 elm_radio_value_set(data_subItem->rgd, data_subItem->chk_status);
340 setting_set_int_slp_key(data_parentItem->int_slp_setting_binded,
341 data_subItem->chk_status, &err);
342 setting_retm_if(0 != err, "Set vconf error[%d]", data_parentItem->int_slp_setting_binded);
344 data_parentItem->sub_desc = (char *)g_strdup(data_subItem->keyStr);
345 elm_object_item_data_set(data_parentItem->item, data_parentItem);
346 elm_genlist_item_update(data_parentItem->item);
347 elm_genlist_item_expanded_set(parentItem, EINA_FALSE);
351 static Eina_Bool __upadte_list_on_idler(void *data)
355 retv_if(data == NULL, FALSE);
356 Elm_Object_Item *item = data;
357 elm_genlist_item_update(item);
358 return ECORE_CALLBACK_CANCEL;
359 /*return EINA_FALSE; */
362 static void __exp_list_smart_cb(void *data, Evas_Object *obj, void *event_info)
364 ret_if(data == NULL || event_info == NULL);
365 Elm_Object_Item *item = (Elm_Object_Item *) event_info;
366 Setting_GenGroupItem_Data *data_parentItem = elm_object_item_data_get(item); /* parent data */
367 char *cb_type = data;
369 /*SETTING_TRACE_DEBUG("cb_type: %s", cb_type); */
370 if (0 == safeStrCmp(cb_type, "drag")
371 || 0 == safeStrCmp(cb_type, "longpressed")) {
372 } else if (0 == safeStrCmp(cb_type, "contracted")) {
373 elm_genlist_item_subitems_clear(item);
374 /*SETTING_TRACE_DEBUG("%s:%d", _(data_parentItem->keyStr), data_parentItem->con_style); */
375 if (data_parentItem) {
376 setting_genlist_item_groupstyle_set(data_parentItem, data_parentItem->con_style);
377 const char *tmp = data_parentItem->r_swallow_path;
378 data_parentItem->r_swallow_path = g_strdup(SETTING_IMAGE_PATH_CFG"00_list_button_expand_closed.png");
379 elm_object_item_data_set(data_parentItem->item, data_parentItem);
380 elm_genlist_item_update(data_parentItem->item);
383 } else if (0 == safeStrCmp(cb_type, "expanded")) {
384 /*SETTING_TRACE_DEBUG("%s:%d", _(data_parentItem->keyStr), data_parentItem->con_style); */
385 if (data_parentItem) {
386 setting_genlist_item_groupstyle_set(data_parentItem, data_parentItem->exp_style);
387 const char *tmp = data_parentItem->r_swallow_path;
388 data_parentItem->r_swallow_path = g_strdup(SETTING_IMAGE_PATH_CFG"00_list_button_expand_opened.png");
389 elm_object_item_data_set(data_parentItem->item, data_parentItem);
390 elm_genlist_item_update(data_parentItem->item);
396 static void _gl_Gendial_sel(void *data, Evas_Object *obj, void *event_info)
398 /* SETTING_TRACE_BEGIN; */
399 retm_if(event_info == NULL, "Invalid argument: event info is NULL");
400 Elm_Object_Item *item = (Elm_Object_Item *) event_info;
401 elm_genlist_item_selected_set(item, 0);
404 static void _gl_Gendial_sel_expand(void *data, Evas_Object *obj,
407 /* SETTING_TRACE_BEGIN; */
408 retm_if(event_info == NULL, "Invalid argument: event info is NULL");
409 Elm_Object_Item *item = (Elm_Object_Item *) event_info;
410 elm_genlist_item_selected_set(item, 0);
411 bool status = !elm_genlist_item_expanded_get(item);
412 elm_genlist_item_expanded_set(item, status);
415 static char *_gl_Gendial_text_get(void *data, Evas_Object *obj,
418 /*SETTING_TRACE_BEGIN; */
419 Setting_GenGroupItem_Data *item_data =
420 (Setting_GenGroupItem_Data *) data;
421 /* SETTING_TRACE("part:%s", part); */
422 if (SWALLOW_Type_LAYOUT_ENTRY == item_data->swallow_type) { /* no need to create 'text' part */
426 char *ret_str = NULL;
427 /* for font size view */
428 if (SWALLOW_Type_1RADIO_1LABLE == item_data->swallow_type) {
429 char speciliztion[MAX_SPECIALIZITION_LEN] = {0,};
431 /*SETTING_TRACE("item_data->chk_status:%d", item_data->chk_status); */
432 if (SYSTEM_SETTINGS_FONT_SIZE_SMALL == item_data->chk_status) {
433 font_size = LABEL_FONT_SIZE_SMALL;
434 } else if (SYSTEM_SETTINGS_FONT_SIZE_LARGE == item_data->chk_status) {
435 font_size = LABEL_FONT_SIZE_LARGE;
436 } else if (SYSTEM_SETTINGS_FONT_SIZE_HUGE == item_data->chk_status) {
437 font_size = LABEL_FONT_SIZE_HUGE;
438 } else if (SYSTEM_SETTINGS_FONT_SIZE_GIANT == item_data->chk_status) {
439 font_size = LABEL_FONT_SIZE_GIANT;
441 font_size = LABEL_FONT_SIZE_NORMAL;
443 /*SETTING_TRACE("font_size:%d", font_size); */
444 snprintf(speciliztion, sizeof(speciliztion), "<font_size=%d>%s</font_size>",
445 font_size, _(item_data->keyStr));
446 ret_str = (char *)g_strdup(speciliztion);
451 /*SETTING_TRACE("part:[%s], text:[%s] ", part, _(item_data->keyStr)); */
452 if (!safeStrCmp(part, "elm.text.main") || !safeStrCmp(part, "elm.text.main.left") || !safeStrCmp(part, "elm.text.main.left.top")) { /* title */
453 if (item_data->keyStr) {
454 ret_str = (char *)g_strdup(_(item_data->keyStr)); /* use item_data->keyStr */
457 } else if (!safeStrCmp(part, "elm.text.2") || !safeStrCmp(part, "elm.text.sub.left.bottom")) { /* bottom or right */
458 if (item_data->sub_desc) {
459 ret_str = (char *)g_strdup(_(item_data->sub_desc));
462 } else if (!safeStrCmp(part, "elm.text.multiline")) { /* title */
463 if (item_data->keyStr) {
464 ret_str = (char *)g_strdup(_(item_data->keyStr));
474 static Evas_Object *__add_check(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
476 retv_if(!item_data || !parent, NULL);
477 Evas_Object *content = elm_layout_add(parent);
478 Evas_Object *check = elm_check_add(content);
479 /*elm_layout_theme_set(content, "layout", "list/C/type.2", "default"); */
480 /* To fix check button flicker issue when rotate the screen*/
481 if (item_data->isItemDisableFlag)
482 elm_object_disabled_set(check, EINA_FALSE);
484 elm_check_state_set(check, item_data->chk_status);
485 evas_object_propagate_events_set(check, 0);
486 evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
487 evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
489 /*SETTING_TRACE("item_data->swallow_type:%d", item_data->swallow_type); */
491 if (SWALLOW_Type_1ICON_1CHECK == item_data->swallow_type
492 || SWALLOW_Type_1CHECK == item_data->swallow_type
493 || SWALLOW_Type_1CHECKICON == item_data->swallow_type) {
494 /*elm_object_style_set(check, "default/genlist"); */
495 elm_check_state_pointer_set(check, (Eina_Bool *)(&(item_data->chk_status)));
496 /*evas_object_repeat_events_set(check, EINA_TRUE); */
497 evas_object_pass_events_set(check, 1);
499 evas_object_pass_events_set(check, 1);
503 item_data->eo_check = check;
504 setting_genlist_unregister_tts_access_highlight(item_data->eo_check, item_data->itc);
506 if (item_data->chk_change_cb) {
507 evas_object_smart_callback_add(check, "changed", item_data->chk_change_cb, item_data);
509 evas_object_smart_callback_add(check, "changed", __chk_changed, item_data);
511 evas_object_show(check);
513 /*Evas_Object *content = elm_layout_add(parent); */
515 elm_layout_theme_set(content, "layout", "list/B/type.4", "default");
516 elm_layout_content_set(content, "elm.swallow.content", check);
520 static Evas_Object *__add_check_icon(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
522 retv_if(!item_data || !parent, NULL);
523 __add_check(item_data, parent);
524 Evas_Object *check = item_data->eo_check;
526 Evas_Object *thumb = NULL;
527 if (item_data->r_swallow_path) {
528 thumb = elm_icon_add(parent);
529 elm_image_file_set(thumb,
530 item_data->r_swallow_path,
532 evas_object_size_hint_aspect_set(thumb,
533 EVAS_ASPECT_CONTROL_VERTICAL,
537 Evas_Object *layout = elm_layout_add(parent);
538 elm_layout_file_set(layout, SETTING_THEME_EDJ_NAME,
540 evas_object_size_hint_weight_set(layout,
543 elm_object_part_content_set(layout, "checkbox", check);
544 elm_object_part_content_set(layout, "thumbnail", thumb);
545 evas_object_show(layout);
549 static Evas_Object *__add_toggle(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
551 retv_if(!item_data || !parent, NULL);
552 Evas_Object *ly_toggle = elm_layout_add(parent);
553 elm_layout_theme_set(ly_toggle, "layout", "list/C/type.3", "default");
554 __add_check(item_data, parent);
555 Evas_Object *check = item_data->eo_check;
556 elm_object_style_set(check, "on&off");
558 /*SETTING_TRACE_DEBUG("toggleDisableFlag %u", item_data->toggleDisableFlag); */
559 if (item_data->toggleDisableFlag)
560 elm_object_disabled_set(check, EINA_TRUE);
562 if (SWALLOW_Type_1TOGGLE == item_data->swallow_type
563 || SWALLOW_Type_1ICON_1RADIO == item_data->swallow_type) {
564 /*SETTING_TRACE("Re-registered"); */
565 char state[MAX_SPECIALIZITION_LEN] = {0,};
566 snprintf(state, sizeof(state),
567 _("IDS_ST_BODY_P1SS_IS_CURRENTLY_P2SS_T_TTS"),
568 _(item_data->keyStr), item_data->chk_status ? _("IDS_ST_BODY_ON_M_STATUS") : _("IDS_ST_BODY_ALERTTYPE_OFF"));
570 Evas_Object *eo = elm_object_item_access_object_get(item_data->item);
571 elm_access_info_set(eo, ELM_ACCESS_STATE, isEmptyStr(state) ? NULL : state);
573 setting_genlist_unregister_tts_access_highlight(item_data->eo_check, item_data->itc);
575 elm_layout_content_set(ly_toggle, "elm.swallow.content", check);
580 static Evas_Object *__add_dot_toggle(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
582 /*SETTING_TRACE_BEGIN; */
583 retv_if(!item_data || !parent || -1 == item_data->chk_status, NULL);
586 Evas_Object *eo_img = NULL;
587 eo_img = elm_image_add(parent);
590 evas_object_propagate_events_set(eo_img, EINA_FALSE);
591 if (0 == item_data->chk_status) {
592 elm_image_file_set(eo_img, SETTING_ICON_PATH_CFG"A01-1_top_off.png", NULL);
593 } else if (1 == item_data->chk_status) {
594 elm_image_file_set(eo_img, SETTING_ICON_PATH_CFG"A01-1_top_on.png", NULL);
596 evas_object_size_hint_min_set(eo_img, ELM_SCALE_SIZE(40), ELM_SCALE_SIZE(40));
597 evas_object_size_hint_max_set(eo_img, 40, 40);
598 evas_object_show(eo_img);
605 static Evas_Object *__add_multiline_toggle(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
607 retv_if(!item_data || !parent, NULL);
608 Evas_Object *chk = __add_toggle(item_data, parent);
609 elm_object_style_set(chk, "on&off");
614 static Evas_Object *__add_radio(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
616 retv_if(!item_data || !parent, NULL);
617 if (!item_data->rgd) { /* exceptional handling */
618 item_data->rgd = elm_radio_add(parent);
619 elm_radio_state_value_set(item_data->rgd, -1);
621 Evas_Object *ly_radio = elm_layout_add(parent);
622 elm_layout_theme_set(ly_radio, "layout", "list/B/type.4", "default");
623 Evas_Object *radio = elm_radio_add(ly_radio);
624 evas_object_propagate_events_set(radio, EINA_FALSE);
625 evas_object_repeat_events_set(radio, EINA_TRUE);
626 elm_radio_state_value_set(radio,
627 item_data->chk_status);
628 elm_radio_group_add(radio, item_data->rgd);
629 evas_object_show(radio);
630 item_data->eo_check = radio;
631 if (item_data->chk_change_cb) {
632 evas_object_smart_callback_add(radio,
634 item_data->chk_change_cb,
637 evas_object_smart_callback_add(radio,
642 setting_genlist_unregister_tts_access_highlight(item_data->eo_check, item_data->itc);
643 elm_layout_content_set(ly_radio, "elm.swallow.content", radio);
648 static Evas_Object *__add_radio_right(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
650 retv_if(!item_data || !parent, NULL);
651 if (!item_data->rgd) {
652 item_data->rgd = elm_radio_add(parent);
653 elm_radio_state_value_set(item_data->rgd, -1);
655 Evas_Object *ly_radio = elm_layout_add(parent);
656 elm_layout_theme_set(ly_radio, "layout", "list/C/type.2", "default");
657 Evas_Object *radio = elm_radio_add(ly_radio);
659 elm_object_style_set(radio, "list");
661 elm_radio_state_value_set(radio,
662 item_data->chk_status);
663 elm_radio_group_add(radio, item_data->rgd);
664 evas_object_show(radio);
665 item_data->eo_check = radio;
666 if (item_data->chk_change_cb) {
667 evas_object_smart_callback_add(radio,
669 item_data->chk_change_cb,
672 evas_object_smart_callback_add(radio,
677 setting_genlist_unregister_tts_access_highlight(item_data->eo_check, item_data->itc);
678 elm_layout_content_set(ly_radio, "elm.swallow.content", radio);
683 static Evas_Object *__add_radio_text(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
685 retv_if(!item_data || !parent, NULL);
686 if (!item_data->rgd) { /* exceptional handling */
687 item_data->rgd = elm_radio_add(parent);
688 elm_radio_state_value_set(item_data->rgd, -1);
690 Evas_Object *radio = elm_radio_add(parent);
691 evas_object_propagate_events_set(radio, EINA_FALSE);
692 evas_object_repeat_events_set(radio, EINA_FALSE);
693 elm_radio_state_value_set(radio,
694 item_data->chk_status);
695 elm_radio_group_add(radio, item_data->rgd);
696 evas_object_show(radio);
697 item_data->eo_check = radio;
698 if (item_data->chk_change_cb) {
699 evas_object_smart_callback_add(radio,
701 item_data->chk_change_cb,
704 evas_object_smart_callback_add(radio,
713 static Evas_Object *__add_button(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
715 retv_if(!item_data || !parent, NULL);
716 Evas_Object *btn = elm_button_add(parent);
717 elm_object_text_set(btn, "Edit");
718 evas_object_show(btn);
719 if (item_data->r_swallow_path) {
720 elm_object_style_set(btn, item_data->r_swallow_path);
722 if (item_data->keyStr && item_data->swallow_type != SWALLOW_Type_1RADIO_1BTN) {
723 elm_object_text_set(btn, _(item_data->keyStr));
725 evas_object_propagate_events_set(btn, EINA_FALSE);
727 if (item_data->stop_change_cb) { /* just only for 1radio_1btn type */
728 /* arrow button's tts info */
729 if (safeStrCmp(item_data->keyStr, "IDS_ST_BODY_SIMPLE_PASSWORD") == 0)
730 setting_set_tts_info(btn, "Change simple password", NULL, NULL, NULL);
731 else if (safeStrCmp(item_data->keyStr, "IDS_ST_BODY_PASSWORD") == 0)
732 setting_set_tts_info(btn, "Change password", NULL, NULL, NULL);
734 evas_object_smart_callback_add(btn,
736 item_data->stop_change_cb,
738 } else if (item_data->chk_change_cb) { /* for other types */
739 evas_object_smart_callback_add(btn,
741 item_data->chk_change_cb,
744 SETTING_TRACE_DEBUG("toggleDisableFlag %u", item_data->toggleDisableFlag);
745 if (item_data->toggleDisableFlag)
746 elm_object_disabled_set(btn, EINA_TRUE);
751 static Evas_Object *__add_gif(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
753 retv_if(!item_data || !parent, NULL);
754 Evas_Object *image = NULL;
755 const char **png_list = (const char **)item_data->belongs_to;
757 /*SETTING_TRACE("item_data->belongs_to:%p", png_list); */
758 if (png_list && *png_list) {
759 if (png_list[1]) { /*png_list is an array end with 'NULL', and it has at least 2 png file, */
760 image = setting_create_gif(parent, png_list);
761 } else { /*png_list just has one png file, */
762 image = setting_create_image(parent, *png_list);
769 static Evas_Object *__add_image(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
771 retv_if(!item_data || !parent || !item_data->l_swallow_path, NULL);
772 Evas_Object *image = NULL;
773 image = setting_create_image(parent, item_data->l_swallow_path);
777 static void __entry_without_layout_focused_cb(void *data, Evas_Object *obj, void *ei) /* Focused callback will show X marked button and hide guidetext. */
780 Setting_GenGroupItem_Data *id = data;
781 if (!elm_entry_is_empty(obj)) {
782 elm_object_item_signal_emit(id->item, "elm,state,eraser,show", "");
784 elm_object_item_signal_emit(id->item, "elm,state,rename,hide", "");
787 Evas_Object *acc = elm_object_item_access_object_get(id->item);
790 const char *txt = elm_entry_entry_get(obj);
791 if (!txt || 0 == strlen(txt))
792 txt = elm_object_part_text_get(obj, "elm.guide");
794 /* Say entry focused */
795 Eina_Stringshare *str = eina_stringshare_printf("%s, Edit Field, Keyboard opened", txt);
796 elm_access_say((char *)str);
797 eina_stringshare_del(str);
801 static void __entry_without_layout_unfocused_cb(void *data, Evas_Object *obj, void *event_info) /* Unfocused callback will show guidetext and hide X marked button. */
804 setting_retm_if(data == NULL, "invalid parameter: data is NULL");
805 Setting_GenGroupItem_Data *id = data;
806 setting_retm_if(id->item == NULL, "item is NULL");
807 elm_object_item_signal_emit(id->item, "elm,state,eraser,hide", "");
808 elm_object_item_signal_emit(id->item, "elm,state,rename,show", "");
812 static void __rejected_char_cb(void *data, Evas_Object *obj, void *event_info)
816 /*SETTING_TRACE_DEBUG("Input char is not an Alphanumeric&Symbol."); */
817 setting_create_simple_popup(NULL, elm_object_parent_widget_get(obj), NULL, _("IDS_ST_BODY_PASSWORD_CONTAINS_INVALID_CHARACTER_ABB"));
820 static Evas_Object *__add_entry_without_layout(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
822 elm_genlist_mode_set(parent, ELM_LIST_COMPRESS); /* resolve abnormal height issue */
823 Evas_Object *entry = NULL;
824 Ea_Editfield_Type type;
826 if (item_data->isPasswordFlag) {
827 type = EA_EDITFIELD_SCROLL_SINGLELINE_PASSWORD;
828 } else if (item_data->isSinglelineFlag) {
829 type = EA_EDITFIELD_SINGLELINE;
831 type = EA_EDITFIELD_MULTILINE;
833 item_data->eo_check = entry = ea_editfield_add(parent, type);
834 evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
835 evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
836 if (item_data->focus_unallowed) {
837 elm_object_focus_allow_set(entry, EINA_FALSE);
839 elm_entry_input_panel_layout_set(entry,
840 item_data->input_type);
841 /*elm_entry_context_menu_disabled_set(entry, TRUE); */
842 /*elm_entry_magnifier_disabled_set(entry, TRUE); */
843 elm_entry_prediction_allow_set(entry, FALSE);
844 elm_entry_input_panel_return_key_type_set(entry, item_data->return_key_type);
845 if (item_data->disable_auto_cap) {
846 elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_NONE);
849 if (item_data->isSinglelineFlag) {
850 elm_entry_scrollable_set(entry, EINA_TRUE);
851 elm_entry_single_line_set(entry, EINA_TRUE);
852 elm_object_signal_emit(entry, "elm,state,scroll,enabled", "");
854 /*for multi-line editfield or entry, need to disable clear button,refer to P130802-3553*/
855 ea_editfield_clear_button_disabled_set(entry, EINA_TRUE);
858 if (item_data->isPasswordFlag) {
859 /*elm_entry_single_line_set(entry, EINA_TRUE); */
860 elm_entry_password_set(entry, EINA_TRUE);
861 elm_entry_input_panel_return_key_disabled_set(entry, EINA_TRUE);
863 static Elm_Entry_Filter_Accept_Set accept_filter_data;
864 accept_filter_data.accepted = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!""#$%&'()*+,-./:;<=>?@[]\\^_`{|}~";
865 accept_filter_data.rejected = NULL;
866 elm_entry_markup_filter_append(entry, elm_entry_filter_accept_set, &accept_filter_data);
868 evas_object_smart_callback_add(entry, "rejected", __rejected_char_cb, item_data);
871 if (item_data->limit_filter_data) {
872 elm_entry_markup_filter_append
874 elm_entry_filter_limit_size,
875 item_data->limit_filter_data);
877 if (item_data->maxlength_reached_cb) {
878 evas_object_smart_callback_add(entry,
880 item_data->maxlength_reached_cb,
883 evas_object_smart_callback_add(entry,
890 /*SETTING_TRACE("item_data->stop_change_cb:%p", item_data->stop_change_cb); */
891 if (item_data->stop_change_cb) {/*invoked when stop focusing on */
892 evas_object_smart_callback_add(entry,
894 item_data->stop_change_cb,
897 evas_object_smart_callback_add(entry,
899 __entry_without_layout_unfocused_cb,
902 if (item_data->digits_filter_data) {
903 elm_entry_markup_filter_append(entry,
904 elm_entry_filter_accept_set,
905 item_data->digits_filter_data);
909 if (item_data->sub_desc && safeStrLen(item_data->sub_desc) > 0) {
910 elm_entry_entry_set(entry, item_data->sub_desc);
912 if (item_data->guide_text) {
913 elm_object_part_text_set(entry, "elm.guide", _(item_data->guide_text)); /* Add guide text to elm_entry. */
915 elm_object_part_text_set(entry, "elm.guide", _("IDS_ST_BODY_TAP_TO_INSERT"));
920 /* for Setting App, All the entrys's context popup shouldn't be able */
921 /* to insert images, text is the only one can be inserted. */
922 elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT);
924 if (item_data->chk_change_cb) {
925 evas_object_smart_callback_add(entry,
927 item_data->chk_change_cb,
929 evas_object_smart_callback_add(entry,
931 item_data->chk_change_cb,
935 evas_object_smart_callback_add(entry, "changed", __entry_changed, item_data);
938 /* callback for handling enter key */
939 if (item_data->activated_cb) {
940 evas_object_smart_callback_add(entry,
942 item_data->activated_cb,
946 /*SETTING_TRACE("item_data->focus_cb:%p", item_data->focus_cb); */
948 if (item_data->focus_cb) {
949 evas_object_smart_callback_add(entry, "focused", item_data->focus_cb, item_data);
951 evas_object_smart_callback_add(entry, "focused", __entry_without_layout_focused_cb, item_data);
954 /*elm_object_signal_callback_add(ed_name, "elm,eraser,clicked", "elm", __eraser_clicked, entry); */
956 if (item_data->start_change_cb) {
957 evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN, (Evas_Object_Event_Cb)(item_data->start_change_cb), item_data->userdata);
959 evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN, __entry_keydown, item_data);
962 Ecore_IMF_Context *imf_context = (Ecore_IMF_Context *)elm_entry_imf_context_get(entry);
963 if (imf_context && item_data->x_callback_cb) {
964 ecore_imf_context_input_panel_event_callback_add(imf_context,
965 ECORE_IMF_INPUT_PANEL_STATE_EVENT,
966 item_data->x_callback_cb,
967 item_data->userdata);
969 if (item_data->input_panel_disable_flag) {
970 elm_entry_input_panel_enabled_set(entry, EINA_FALSE);
972 if (entry && item_data->entry_auto_focus) {
973 evas_object_show(entry);
974 elm_object_focus_set(entry, EINA_TRUE);
980 static Evas_Object *__add_entry(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
982 retv_if(!item_data || !parent, NULL);
983 elm_genlist_mode_set(parent, ELM_LIST_COMPRESS); /* resolve abnormal height issue */
984 Evas_Object *ed_name =
985 setting_create_editfiled(parent, _(item_data->keyStr),
986 item_data->sub_desc, item_data->guide_text);
987 evas_object_pass_events_set(ed_name, 1);
988 evas_object_propagate_events_set(ed_name, 0);
989 Evas_Object *entry = elm_object_part_content_get(ed_name, "elm.swallow.content");
990 item_data->eo_check = entry;
991 elm_entry_input_panel_layout_set(entry,
992 item_data->input_type);
994 if (item_data->isSinglelineFlag) {
995 elm_entry_scrollable_set(entry, EINA_TRUE);
996 elm_entry_single_line_set(entry, EINA_TRUE);
999 if (item_data->isPasswordFlag) {
1000 elm_entry_single_line_set(entry, EINA_TRUE);
1001 elm_entry_password_set(entry, EINA_TRUE);
1004 if (item_data->limit_filter_data) {
1005 elm_entry_markup_filter_append
1007 elm_entry_filter_limit_size,
1008 item_data->limit_filter_data);
1010 if (item_data->maxlength_reached_cb) {
1011 evas_object_smart_callback_add(entry,
1012 "maxlength,reached",
1013 item_data->maxlength_reached_cb,
1016 evas_object_smart_callback_add(entry,
1017 "maxlength,reached",
1022 if (item_data->stop_change_cb) {/*invoked when stop focusing on */
1023 evas_object_smart_callback_add(entry,
1025 item_data->stop_change_cb,
1028 evas_object_smart_callback_add(entry,
1033 if (item_data->digits_filter_data) {
1034 elm_entry_markup_filter_append(entry,
1035 elm_entry_filter_accept_set,
1036 item_data->digits_filter_data);
1039 /* for Setting App, All the entrys's context popup shouldn't be able */
1040 /* to insert images, text is the only one can be inserted. */
1041 elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT);
1043 if (item_data->chk_change_cb) {
1044 evas_object_smart_callback_add(entry,
1046 item_data->chk_change_cb,
1050 evas_object_smart_callback_add(entry, "changed", __entry_changed, item_data);
1053 /* callback for handling enter key */
1054 if (item_data->activated_cb) {
1055 evas_object_smart_callback_add(entry,
1057 item_data->activated_cb,
1061 if (item_data->focus_cb) {
1062 evas_object_smart_callback_add(entry, "focused", item_data->focus_cb, item_data);
1064 evas_object_smart_callback_add(entry, "focused", __entry_focused, ed_name);
1067 elm_object_signal_callback_add(ed_name, "elm,eraser,clicked", "elm", __eraser_clicked, entry);
1069 if (item_data->start_change_cb) {
1070 evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN, (Evas_Object_Event_Cb)(item_data->start_change_cb), item_data->userdata);
1072 evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN, __entry_keydown, item_data);
1075 Ecore_IMF_Context *imf_context = (Ecore_IMF_Context *)elm_entry_imf_context_get(entry);
1077 ecore_imf_context_input_panel_event_callback_add(imf_context,
1078 ECORE_IMF_INPUT_PANEL_STATE_EVENT,
1079 item_data->x_callback_cb,
1080 item_data->userdata);
1082 if (item_data->input_panel_disable_flag) {
1083 elm_entry_input_panel_enabled_set(entry, EINA_FALSE);
1088 static Evas_Object *__add_5step_slider(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
1090 SETTING_TRACE_BEGIN;
1091 retv_if(!item_data || !parent, NULL);
1092 Evas_Object *li_slider =
1093 setting_create_5step_slider(parent, item_data->evas,
1094 item_data->l_swallow_path,
1095 item_data->r_swallow_path,
1096 item_data->chk_status,
1097 item_data->isIndicatorVisible,
1098 item_data->slider_min,
1099 item_data->slider_max,
1100 item_data->chk_change_cb,
1101 item_data->start_change_cb,
1102 item_data->stop_change_cb,
1104 evas_object_pass_events_set(li_slider, 1);
1105 evas_object_propagate_events_set(li_slider, 0);
1106 item_data->eo_check = li_slider;
1110 static Evas_Object *__add_slider(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
1112 retv_if(!item_data || !parent, NULL);
1113 Evas_Object *li_slider =
1114 setting_create_slider(parent, item_data->evas,
1115 item_data->l_swallow_path,
1116 item_data->r_swallow_path,
1117 item_data->chk_status,
1118 item_data->isIndicatorVisible,
1119 item_data->slider_min,
1120 item_data->slider_max,
1121 item_data->chk_change_cb,
1122 item_data->start_change_cb,
1123 item_data->stop_change_cb,
1125 evas_object_pass_events_set(li_slider, 1);
1126 evas_object_propagate_events_set(li_slider, 0);
1127 item_data->eo_check = li_slider;
1131 static Evas_Object *__add_layout(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
1133 retv_if(!item_data || !parent, NULL);
1134 Evas_Object *layout = elm_layout_add(parent);
1135 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1136 setting_retvm_if(layout == NULL, FALSE, "layout == NULL");
1137 elm_layout_theme_set(layout, "layout", "application", "default");
1138 int w = item_data->chk_status;
1139 int h = item_data->chk_status;
1140 elm_object_part_content_set(layout, "elm.swallow.bg", setting_create_blank_rect_customize(parent, w, h));
1141 /*elm_object_part_content_set(layout, "elm.swallow.content", navi); */
1143 char **load_arglist = (char **)item_data->belongs_to;
1144 char *load_name = item_data->keyStr;
1145 char *load_style = item_data->item_style;
1146 if (0 == safeStrCmp(load_style, "APP"))
1147 app_launcher(load_name);/*how to adjust the size */
1148 else if (0 == safeStrCmp(load_style, "UG")) {
1149 struct ug_cbs cbs = {0,};
1151 cbs.layout_cb = __ug_layout_cb;
1152 cbs.result_cb = __ug_result_cb;
1153 cbs.destroy_cb = __ug_destroy_cb;
1156 ad->camera_ug = setting_ug_create(NULL, load_name, UG_MODE_FULLVIEW, ad->app_control_handle, &cbs);
1163 static void __picker_popup_cancel_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
1165 SETTING_TRACE_BEGIN;
1166 Evas_Object *popup = data;
1167 evas_object_del(popup);
1170 static void __picker_popup_set_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
1172 /*printf("Set clicked\n"); */
1173 SETTING_TRACE_BEGIN;
1174 SETTING_TRACE("DEFAULT @@@");
1175 elm_object_signal_emit(data, "picker,action,value,set", "");
1176 /*Evas_Object *popup = evas_object_data_get((Evas_Object *)data, "popup"); */
1177 /*evas_object_del(popup); */
1180 static Evas_Object *_datefield_picker_popup_add(Evas_Object *parent, Evas_Object *datetime, void *data)
1182 Datefield_Paramdata *param = (Datefield_Paramdata *)data;
1184 Setting_GenGroupItem_Data *item_data = param->item_data;
1186 Evas_Object *popup = elm_popup_add(parent);
1187 ea_object_event_callback_add(popup, EA_CALLBACK_BACK, ea_popup_back_cb, NULL);
1189 Evas_Object *cancel_btn = elm_button_add(popup);
1190 elm_object_style_set(cancel_btn, "popup");
1191 elm_object_text_set(cancel_btn, "Cancel");
1192 elm_object_part_content_set(popup, "button1", cancel_btn);
1193 evas_object_smart_callback_add(cancel_btn, "clicked", __picker_popup_cancel_btn_clicked_cb, popup);
1195 Evas_Object *set_btn = elm_button_add(popup);
1196 elm_object_style_set(set_btn, "popup");
1197 elm_object_text_set(set_btn, "Set");
1198 elm_object_part_content_set(popup, "button2", set_btn);
1200 if (item_data->activated_cb)
1201 /*evas_object_smart_callback_add(set_btn, "clicked", item_data->activated_cb, datetime); */
1202 evas_object_smart_callback_add(set_btn, "clicked", item_data->activated_cb, item_data);
1204 evas_object_smart_callback_add(set_btn, "clicked", __picker_popup_set_btn_clicked_cb, datetime);
1209 static void _datefield_date_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
1211 SETTING_TRACE_BEGIN;
1213 /*Evas_Object *parent = data; */
1214 Datefield_Paramdata *param = (Datefield_Paramdata *)data;
1215 Evas_Object *popup = _datefield_picker_popup_add(param->parent, obj/*elm_button*/, param/* context */);
1217 elm_object_part_text_set(popup, "title,text", "Set date");
1219 Evas_Object *datetime = elm_datetime_add(param->parent);
1221 evas_object_data_set(datetime, "popup", popup);
1223 /*--------------------------------------- */
1224 param->item_data->eo_check = datetime;
1225 /*--------------------------------------- */
1227 elm_object_content_set(popup, datetime);
1228 evas_object_show(popup);
1230 /*--------------------------------------- */
1231 /*param->item_data->eo_check = param->box; */
1232 /*--------------------------------------- */
1235 static void _datefield_time_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
1237 SETTING_TRACE_BEGIN;
1238 Datefield_Paramdata *param = (Datefield_Paramdata *)data;
1240 Evas_Object *datetime = elm_datetime_add(param->parent);
1242 elm_object_style_set(datetime, "date_layout");
1244 char *pa_time_format = get_pa_time_format_str();
1245 if (pa_time_format) {
1246 if (!strncmp(pa_time_format, "IDS_ST_BODY_12_HOURS", strlen("IDS_ST_BODY_12_HOURS")))
1247 elm_datetime_format_set(datetime, "%l:%M %P");
1249 elm_datetime_format_set(datetime, "%H:%M");
1252 evas_object_size_hint_align_set(datetime, 0.5 , 0.5);
1253 evas_object_show(datetime);
1255 Evas_Object *popup = _datefield_picker_popup_add(param->parent, obj, (void *)data);
1256 elm_object_part_text_set(popup, "title,text", "Set time");
1258 evas_object_data_set(datetime, "popup", popup);
1260 /*--------------------------------------- */
1261 param->item_data->eo_check = datetime;
1262 /*--------------------------------------- */
1264 elm_object_content_set(popup, datetime);
1265 evas_object_show(popup);
1267 FREE(pa_time_format);
1268 /*--------------------------------------- */
1269 /*param->item_data->eo_check = param->box; */
1270 /*--------------------------------------- */
1273 EXPORT_PUBLIC char *__setting_phone_lang_get_by_pattern(const char *locale, const char *skeleton)
1275 /*setting_retvm_if(!locale, NULL, "locale parameter is NULL"); */
1276 /*setting_retvm_if(data == NULL, NULL, "Data parameter is NULL"); */
1278 /*remove ".UTF-8" in locale */
1279 char locale_tmp[DEF_BUF_SIZE] = {0,};
1280 strncpy(locale_tmp, locale, DEF_BUF_SIZE);
1281 locale_tmp[DEF_BUF_SIZE - 1] = '\0';
1283 char *p = safeStrStr(locale_tmp, ".UTF-8");
1288 char *ret_str = NULL;
1289 UChar customSkeleton[SETTING_STR_SLP_LEN] = { 0, };
1290 UErrorCode status = U_ZERO_ERROR;
1291 UDateFormat *formatter = NULL;
1293 UChar bestPattern[SETTING_STR_SLP_LEN] = { 0, };
1294 UChar formatted[SETTING_STR_SLP_LEN] = { 0, };
1296 char bestPatternString[SETTING_STR_SLP_LEN] = { 0, };
1297 char formattedString[SETTING_STR_SLP_LEN] = { 0, };
1299 u_uastrncpy(customSkeleton, skeleton, safeStrLen(skeleton));
1301 UDateTimePatternGenerator *pattern_generator;
1302 pattern_generator = udatpg_open(locale_tmp, &status);
1304 int32_t bestPatternCapacity = (int32_t)(sizeof(bestPattern) / sizeof((bestPattern)[0]));
1305 (void)udatpg_getBestPattern(pattern_generator, customSkeleton, u_strlen(customSkeleton), bestPattern, bestPatternCapacity, &status);
1307 u_austrcpy(bestPatternString, bestPattern);
1308 SETTING_TRACE("BestPattern is %s", bestPatternString);
1310 UDate date = ucal_getNow();
1311 formatter = udat_open(UDAT_IGNORE, UDAT_IGNORE, locale_tmp, NULL, -1, bestPattern, -1, &status);
1312 int32_t formattedCapacity = (int32_t)(sizeof(formatted) / sizeof((formatted)[0]));
1313 (void)udat_format(formatter, date, formatted, formattedCapacity, NULL, &status);
1314 u_austrcpy(formattedString, formatted);
1315 SETTING_TRACE("DATE & TIME is %s", formattedString);
1317 udat_close(formatter);
1319 ret_str = g_strdup(formattedString);
1327 static Evas_Object *__add_datefield_new(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
1329 SETTING_TRACE_BEGIN;
1330 retv_if(!item_data || !parent, NULL);
1332 Datefield_Paramdata *param = malloc(sizeof(Datefield_Paramdata));
1333 setting_retvm_if(NULL == param, NULL, "param is NULL");
1335 param->item_data = item_data;
1336 /*param->parent = parent; */
1337 param->parent = item_data->nf;
1339 char *date = __setting_phone_lang_get_by_pattern("en_US", "MMM/d/yyyy");
1340 char *pa_time_format = get_pa_time_format_str();
1343 if (pa_time_format) {
1344 if (!strncmp(pa_time_format, "IDS_ST_BODY_12_HOURS", strlen("IDS_ST_BODY_12_HOURS")))
1345 time = __setting_phone_lang_get_by_pattern("en_US", "hhmm");
1347 time = __setting_phone_lang_get_by_pattern("en_US", "Hm");
1348 SETTING_TRACE("DATE : %s ", date);
1349 SETTING_TRACE("TIME : %s ", time);
1352 Evas_Object *btn_left = elm_button_add(parent);
1353 elm_object_style_set(btn_left, "datetime");
1354 evas_object_size_hint_weight_set(btn_left, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1355 evas_object_size_hint_min_set(btn_left, ELM_SCALE_SIZE(90), -1);
1356 evas_object_resize(btn_left, 300, -1);
1358 elm_object_text_set(btn_left, date);
1359 evas_object_smart_callback_add(btn_left, "clicked", _datefield_date_btn_clicked_cb , param);
1360 evas_object_show(btn_left);
1362 Evas_Object *btn_right = elm_button_add(parent);
1363 elm_object_style_set(btn_right, "datetime");
1364 evas_object_size_hint_weight_set(btn_right, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1365 evas_object_size_hint_min_set(btn_right, ELM_SCALE_SIZE(90), -1);
1366 evas_object_resize(btn_right, 270, -1);
1367 elm_object_text_set(btn_right, time);
1368 evas_object_smart_callback_add(btn_right, "clicked", _datefield_time_btn_clicked_cb , param);
1369 evas_object_show(btn_right);
1371 param->item_data->btn_left = btn_left;
1372 param->item_data->btn_right = btn_right;
1374 Evas_Object *box = elm_box_add(parent);
1375 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1377 Evas_Object *box1 = elm_box_add(box);
1378 evas_object_size_hint_weight_set(box1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1379 elm_box_horizontal_set(box1, 1);
1380 elm_box_align_set(box1, 0.5, 0.0);
1381 elm_box_padding_set(box1, ELM_SCALE_SIZE(15), ELM_SCALE_SIZE(5));
1383 elm_box_pack_end(box1, btn_left);
1384 elm_box_pack_end(box1, btn_right);
1385 evas_object_show(box1);
1387 elm_box_pack_end(box, box1);
1388 evas_object_show(box);
1390 FREE(pa_time_format);
1394 static Evas_Object *__add_radio_search(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
1396 retv_if(!item_data || !parent, NULL);
1397 Evas_Object *box = elm_box_add(parent);
1398 elm_box_horizontal_set(box, 1);
1401 /*Evas_Object *radio = __add_radio(item_data, parent);
1402 setting_disable_evas_object(radio);
1403 elm_box_pack_end(box, radio);
1406 Evas_Object *separator =
1407 setting_create_blank_rect_customize(box,
1408 SETTING_HALF_SCREEN_WIDTH,
1409 SETTING_PADDING_HEIGHT);
1410 elm_box_pack_end(box, separator);*/
1412 /*c.progressbar.. */
1413 Evas_Object *progressbar = elm_progressbar_add(parent);
1414 elm_object_style_set(progressbar, PROGRESSBAR_STYLE);
1415 evas_object_size_hint_align_set(progressbar,
1416 EVAS_HINT_FILL, 0.5);
1417 evas_object_size_hint_weight_set(progressbar,
1420 elm_progressbar_pulse(progressbar, EINA_TRUE);
1421 evas_object_show(progressbar);
1422 elm_box_pack_end(box, progressbar);
1424 evas_object_show(box);
1428 static Evas_Object *__add_search(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
1430 retv_if(!item_data || !parent, NULL);
1431 /* added by JTS: CQ H0100135171 */
1432 Evas_Object *box = elm_box_add(parent);
1433 elm_box_horizontal_set(box, 1);
1436 Evas_Object *separator =
1437 setting_create_blank_rect_customize(box,
1438 SETTING_HALF_SCREEN_WIDTH, SETTING_PADDING_HEIGHT);
1439 elm_box_pack_end(box, separator);
1441 /*c.progressbar.. */
1442 Evas_Object *progressbar = elm_progressbar_add(parent);
1443 elm_object_style_set(progressbar, PROGRESSBAR_STYLE);
1444 evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.5);
1445 evas_object_size_hint_weight_set(progressbar,
1446 EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1447 elm_progressbar_pulse(progressbar, EINA_TRUE);
1448 evas_object_show(progressbar);
1449 elm_box_pack_end(box, progressbar);
1451 evas_object_show(box);
1456 static Evas_Object *__add_process(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
1458 retv_if(!item_data || !parent, NULL);
1459 Evas_Object *progressbar = elm_progressbar_add(parent);
1460 elm_object_style_set(progressbar, PROGRESSBAR_STYLE);
1461 evas_object_size_hint_align_set(progressbar,
1462 EVAS_HINT_FILL, 0.5);
1463 evas_object_size_hint_weight_set(progressbar,
1466 elm_progressbar_pulse(progressbar, EINA_TRUE);
1467 evas_object_show(progressbar);
1471 static Evas_Object *__add_radio_lable(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
1473 retv_if(!item_data || !parent, NULL);
1476 Evas_Object *radio = __add_radio(item_data, parent);
1481 static Evas_Object *__add_left_default(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
1483 if (!item_data || !parent || !item_data->l_swallow_path) {
1487 if (SWALLOW_Type_1ICON_WITHOUT_CIRCLE_BG == item_data->swallow_type
1488 || SWALLOW_Type_1ICON_1DOTTOOGLE == item_data->swallow_type
1489 || SWALLOW_Type_1ICON_1IMAGE == item_data->swallow_type) {
1490 Evas_Object *icon = elm_icon_add(parent);
1491 elm_image_file_set(icon, item_data->l_swallow_path, NULL);
1492 evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
1496 Evas_Object *ic = NULL;
1497 ic = elm_layout_add(parent);
1498 Evas_Object *c = NULL;
1500 elm_layout_theme_set(ic, "layout", "list/B/type.4", "default");
1501 c = elm_image_add(parent);
1502 elm_image_file_set(c, item_data->l_swallow_path, NULL);
1503 setting_decorate_image_RGBA(c, 14, 41, 73, 255);
1504 evas_object_size_hint_align_set(c, EVAS_HINT_FILL, EVAS_HINT_FILL);
1505 evas_object_size_hint_weight_set(c, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1506 elm_layout_content_set(ic, "elm.swallow.content", c);
1511 static Evas_Object *__add_right_default(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
1513 if (!item_data || !parent || !item_data->r_swallow_path) {
1518 Evas_Object *icon = elm_icon_add(parent);
1519 elm_image_file_set(icon, item_data->r_swallow_path, NULL);
1520 evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
1521 if (!safeStrCmp(item_data->r_swallow_path, SETTING_IMAGE_PATH_CFG"00_list_button_expand_closed.png"))
1522 else if (!safeStrCmp(item_data->r_swallow_path, SETTING_IMAGE_PATH_CFG"00_list_button_expand_opened.png"))
1525 Evas_Object *ic = NULL;
1526 ic = elm_layout_add(parent);
1527 Evas_Object *icon = NULL;
1529 elm_layout_theme_set(ic, "layout", "list/C/type.3", "default");
1530 icon = elm_image_add(parent);
1531 if (!safeStrCmp(item_data->r_swallow_path, SETTING_IMAGE_PATH_CFG"00_list_button_expand_closed.png"))
1532 setting_decorate_image_RGBA(icon, 14, 41, 73, 255);
1533 else if (!safeStrCmp(item_data->r_swallow_path, SETTING_IMAGE_PATH_CFG"00_list_button_expand_opened.png"))
1534 setting_decorate_image_RGBA(icon, 14, 41, 73, 255);
1535 elm_image_file_set(icon, item_data->r_swallow_path, NULL);
1536 evas_object_size_hint_align_set(icon, 0.0, EVAS_HINT_FILL);
1537 evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1538 elm_layout_content_set(ic, "elm.swallow.content", icon);
1545 typedef Evas_Object *(*__drawer_fp)(Setting_GenGroupItem_Data *item_data, Evas_Object *parent);
1547 SWALLOW_Type type; /* ui type */
1550 static __Content_Drawer __cd_left[SWALLOW_Type_MAX] = {
1552 {SWALLOW_Type_1CHECK, __add_check},
1553 {SWALLOW_Type_1ICON_1CHECK, __add_check},
1554 {SWALLOW_Type_1TOGGLE, __add_toggle},
1555 {SWALLOW_Type_1RADIO, __add_radio},
1556 {SWALLOW_Type_1BUTTON, __add_button},
1557 {SWALLOW_Type_1GIF, __add_gif},
1558 {SWALLOW_Type_1IMAGE, __add_image},
1559 {SWALLOW_Type_1TEXT_1IMAGE, __add_image},
1561 /*base objects in an layout */
1562 {SWALLOW_Type_LAYOUT_ENTRY, __add_entry},
1563 {SWALLOW_Type_LAYOUT_SLIDER, __add_slider},
1564 {SWALLOW_Type_LAYOUT_5STEP_SLIDER, __add_5step_slider},
1565 /*{SWALLOW_Type_LAYOUT_DATEFIELD, __add_datefield2}, */
1566 {SWALLOW_Type_LOAD_LAYOUT, __add_layout},
1568 /*other compelx objects */
1569 {SWALLOW_Type_1SEARCH, __add_search},
1570 {SWALLOW_Type_1PROCESS, __add_process},
1571 {SWALLOW_Type_MULTILINE_1TOGGLE, __add_multiline_toggle},
1572 {SWALLOW_Type_1CHECKICON, __add_check_icon},
1573 {SWALLOW_Type_1RADIO_1SEARCH, __add_radio_search},
1574 {SWALLOW_Type_1RADIO_1LABLE, __add_radio_lable},
1575 {SWALLOW_Type_1RADIO_1BTN, __add_radio},
1576 {SWALLOW_Type_1RADIO_1TEXT, __add_radio_text},
1578 /*left part object of the type */
1579 {SWALLOW_Type_1ICON_1RADIO, __add_left_default},
1580 {SWALLOW_Type_1ICON_1PROCESS, __add_left_default},
1581 {SWALLOW_Type_1RADIO_1PROCESS, __add_radio},
1583 static __Content_Drawer __cd_right[SWALLOW_Type_MAX] = {
1584 /*right part object of the type */
1585 {SWALLOW_Type_1CHECK_RIGHT, __add_check},
1586 {SWALLOW_Type_1ICON_1RADIO, __add_toggle},
1587 {SWALLOW_Type_1ICON_1CHECK, __add_right_default},
1588 {SWALLOW_Type_1ICON_1DOTTOOGLE, __add_dot_toggle},
1589 {SWALLOW_Type_1ICON_1PROCESS, __add_process},
1590 {SWALLOW_Type_1RADIO_1PROCESS, __add_process},
1591 {SWALLOW_Type_1RADIO_1BTN, __add_button},
1592 {SWALLOW_Type_1RADIO_RIGHT, __add_radio_right},
1595 static __Content_Drawer __cd_end[SWALLOW_Type_MAX] = {
1596 /*end part object of the type */
1597 {SWALLOW_Type_1RADIO, __add_radio},
1600 static void __multiline_eraser_clicked(void *data, Evas_Object *obj, void *event_info) /* When X marked button clicked, make string as empty. */
1602 Setting_GenGroupItem_Data *list_item = data;
1603 Evas_Object *entry = elm_object_item_part_content_get(list_item->item, "elm.icon.entry");
1604 elm_object_focus_set(entry, EINA_TRUE); /* After button is clicked, entry should get focus again. */
1605 elm_entry_entry_set(entry, "");
1608 static Evas_Object *_gl_Gendial_content_get(void *data, Evas_Object *obj,
1611 retv_if(!data, NULL);
1612 Setting_GenGroupItem_Data *item_data = data;
1613 retv_if(!data, NULL);
1614 __Content_Drawer *cd_list = NULL;
1615 __drawer_fp fp = NULL;
1616 /*SETTING_TRACE("content get [%s]",part); */
1619 if (!safeStrCmp(part, "elm.icon.1")) { /* LEFT AREA */
1620 if (item_data->swallow_type == SWALLOW_Type_LAYOUT_EDITFIELD
1621 && item_data->isPasswordFlag == TRUE)
1623 fp = __add_left_default; /*hold default drawer */
1624 cd_list = __cd_left;
1625 } else if (!safeStrCmp(part, "elm.icon.2")) { /* RIGHT AREA */
1626 if (item_data->swallow_type == SWALLOW_Type_LAYOUT_EDITFIELD
1627 && item_data->isPasswordFlag == TRUE)
1629 fp = __add_right_default; /*hold default drawer */
1630 cd_list = __cd_right;
1631 } else if (!safeStrCmp(part, "elm.icon")) { /* CENTER WHOLE */
1632 fp = __add_left_default; /*hold default drawer */
1633 cd_list = __cd_left;
1634 } else if (!safeStrCmp(part, "elm.swallow.end")) {
1635 /*the default value of fp is NULL here */
1638 /* To do : add code for editfield */
1639 else if (!safeStrCmp(part, "elm.icon.entry")) {
1640 if (item_data->swallow_type == SWALLOW_Type_LAYOUT_DATEFIELD) {
1641 /*fp = __add_datefield; */
1642 fp = __add_datefield_new;
1644 fp = __add_entry_without_layout;
1646 } else if (!safeStrCmp(part, "elm.icon.eraser")) {
1647 /*fp = __add_button_eraser; */
1648 Evas_Object *btn = elm_button_add(obj);
1649 elm_object_style_set(btn, "editfield_clear"); /*Make "X" marked button by changing style. */
1650 evas_object_smart_callback_add(btn, "clicked", __multiline_eraser_clicked, item_data);
1652 } else if (!safeStrCmp(part, "elm.icon.edit")) {
1653 Evas_Object *btn = elm_button_add(obj);
1654 elm_object_style_set(btn, "minus");
1655 evas_object_propagate_events_set(btn, EINA_FALSE);
1660 /*if (!cd_list) return NULL;//invalid part */
1664 for (; idx < SWALLOW_Type_MAX; idx++) {
1665 if (item_data->swallow_type == cd_list[idx].type) { /*match using swallow type */
1666 fp = cd_list[idx].draw;
1671 return fp ? fp(item_data, obj) : NULL;
1674 static void _gl_Gendial_del(void *data, Evas_Object *obj)
1676 /* SETTING_TRACE_BEGIN; */
1677 Setting_GenGroupItem_Data *item_data =
1678 (Setting_GenGroupItem_Data *) data;
1680 item_data->eo_check = NULL;/*set to NULL at once */
1681 G_FREE(item_data->keyStr);
1682 G_FREE(item_data->sub_desc);
1683 G_FREE(item_data->guide_text);
1684 G_FREE((item_data->l_swallow_path));
1685 G_FREE((item_data->r_swallow_path));
1686 G_FREE(item_data->item_style);
1689 if (item_data->digits_filter_data) {
1690 G_FREE(item_data->digits_filter_data->accepted);
1691 G_FREE(item_data->digits_filter_data->rejected);
1692 FREE(item_data->digits_filter_data);
1696 if (item_data->notify) {
1697 evas_object_del(item_data->notify);
1698 item_data->notify = NULL;
1701 FREE(item_data->limit_filter_data);
1702 __BACK_POINTER_UNSET(item_data);
1706 /* SETTING_TRACE_END; */
1710 * To intialize an Elm_Genlist_Item_Class, according to item style
1712 * @param[in] item_style
1713 * @param[in/out] itc
1716 bool setting_create_Gendial_itc(const char *item_style,
1717 Elm_Genlist_Item_Class *itc)
1719 itc->item_style = item_style;
1720 itc->func.text_get = _gl_Gendial_text_get;
1721 itc->func.content_get = _gl_Gendial_content_get;
1722 itc->func.state_get = NULL;
1723 itc->func.del = _gl_Gendial_del; /* _gl_Gendial_del; */
1728 * Create group style item
1730 * @return a pointer to Setting_GenGroupItem_Data
1733 Setting_GenGroupItem_Data *setting_create_Gendial_field_group_titleItem(Evas_Object *genlist,
1734 const Elm_Genlist_Item_Class *itc,
1735 Elm_Object_Item *parent,
1736 Elm_Genlist_Item_Type flag, /* ELM_GENLIST_ITEM_GROUP or ELM_GENLIST_ITEM_NONE */
1738 setting_call_back_func gl_sel)
1740 /* SETTING_TRACE_BEGIN; */
1742 ADD_GL_SEPARATOR(genlist);
1743 Setting_GenGroupItem_Data *item_data =
1744 (Setting_GenGroupItem_Data *) calloc(1,
1746 (Setting_GenGroupItem_Data));
1747 setting_retvm_if(!item_data, NULL, "calloc failed");
1748 item_data->keyStr = (char *)g_strdup(keyStr);
1749 if (itc && itc->item_style) {
1750 item_data->itc = (char *)g_strdup(itc->item_style);
1754 elm_genlist_item_append(genlist, itc, item_data, parent,
1755 flag, gl_sel, NULL);
1758 elm_genlist_item_append(genlist, itc, item_data, parent,
1759 flag, _gl_Gendial_sel, NULL);
1761 elm_genlist_item_select_mode_set(item_data->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1766 * Create separator style item with title
1768 * @return a pointer to Setting_GenGroupItem_Data
1770 EXPORT_PUBLIC Setting_GenGroupItem_Data *setting_create_Gendial_field_titleItem(
1771 Evas_Object *genlist,
1772 const Elm_Genlist_Item_Class *itc,
1774 setting_call_back_func gl_sel)
1776 /* SETTING_TRACE_BEGIN; */
1777 Setting_GenGroupItem_Data *item_data =
1778 (Setting_GenGroupItem_Data *) calloc(1,
1780 (Setting_GenGroupItem_Data));
1781 setting_retvm_if(!item_data, NULL, "calloc failed");
1782 item_data->keyStr = (char *)g_strdup(keyStr);
1783 if (itc && itc->item_style) {
1784 item_data->itc = (char *)g_strdup(itc->item_style);
1788 elm_genlist_item_append(genlist, itc, item_data, NULL,
1789 ELM_GENLIST_ITEM_NONE, gl_sel,
1793 elm_genlist_item_append(genlist, itc, item_data, NULL,
1794 ELM_GENLIST_ITEM_NONE,
1795 _gl_Gendial_sel, NULL);
1797 elm_genlist_item_select_mode_set(item_data->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1802 * Create 1radio-1text style item
1804 * @return a pointer to Setting_GenGroupItem_Data
1807 Setting_GenGroupItem_Data *setting_create_Gendial_field_1radio(
1808 Evas_Object *genlist,
1809 const Elm_Genlist_Item_Class *itc,
1810 setting_call_back_func gl_sel,
1812 SWALLOW_Type swallow_type,
1813 Evas_Object *rgd, int chk_status,
1815 setting_call_back_func chk_change_cb)
1817 /* SETTING_TRACE_BEGIN; */
1818 Setting_GenGroupItem_Data *item_data =
1819 (Setting_GenGroupItem_Data *) calloc(1,
1821 (Setting_GenGroupItem_Data));
1822 setting_retvm_if(!item_data, NULL, "calloc failed");
1823 item_data->keyStr = (char *)g_strdup(keyStr);
1824 item_data->swallow_type = swallow_type;
1825 item_data->chk_status = chk_status;
1826 item_data->chk_change_cb = chk_change_cb;
1827 item_data->rgd = rgd;
1828 if (itc && itc->item_style) {
1829 item_data->itc = (char *)g_strdup(itc->item_style);
1834 elm_genlist_item_append(genlist, itc, item_data, NULL,
1835 ELM_GENLIST_ITEM_NONE, gl_sel,
1839 elm_genlist_item_append(genlist, itc, item_data, NULL,
1840 ELM_GENLIST_ITEM_NONE,
1841 _gl_Gendial_sel, sel_data);
1847 * Create 1radio-2text style item
1849 * @return a pointer to Setting_GenGroupItem_Data
1852 Setting_GenGroupItem_Data *setting_create_Gendial_field_1radio_2text(
1853 Evas_Object *genlist,
1854 const Elm_Genlist_Item_Class *itc,
1855 setting_call_back_func gl_sel,
1857 SWALLOW_Type swallow_type,
1858 Evas_Object *rgd, int chk_status,
1861 setting_call_back_func chk_change_cb)
1863 /* SETTING_TRACE_BEGIN; */
1864 Setting_GenGroupItem_Data *item_data =
1865 (Setting_GenGroupItem_Data *) calloc(1,
1867 (Setting_GenGroupItem_Data));
1868 setting_retvm_if(!item_data, NULL, "calloc failed");
1869 item_data->keyStr = (char *)g_strdup(keyStr);
1870 item_data->swallow_type = swallow_type;
1871 item_data->chk_status = chk_status;
1872 item_data->chk_change_cb = chk_change_cb;
1873 item_data->rgd = rgd;
1874 item_data->sub_desc = (char *)g_strdup(sub_desc);
1875 if (itc && itc->item_style) {
1876 item_data->itc = (char *)g_strdup(itc->item_style);
1881 elm_genlist_item_append(genlist, itc, item_data, NULL,
1882 ELM_GENLIST_ITEM_NONE, gl_sel,
1886 elm_genlist_item_append(genlist, itc, item_data, NULL,
1887 ELM_GENLIST_ITEM_NONE,
1888 _gl_Gendial_sel, sel_data);
1895 Setting_GenGroupItem_Data *setting_create_Gendial_field_1radio_1button(
1896 Evas_Object *genlist,
1897 const Elm_Genlist_Item_Class *itc,
1898 setting_call_back_func gl_sel,
1900 SWALLOW_Type swallow_type,
1902 Evas_Object *rgd, int chk_status,
1904 setting_call_back_func chk_change_cb,
1905 setting_call_back_func btn_clicked_cb)
1907 /* SETTING_TRACE_BEGIN; */
1908 Setting_GenGroupItem_Data *item_data =
1909 (Setting_GenGroupItem_Data *) calloc(1,
1911 (Setting_GenGroupItem_Data));
1912 setting_retvm_if(!item_data, NULL, "calloc failed");
1913 item_data->keyStr = (char *)g_strdup(keyStr);
1914 item_data->swallow_type = swallow_type;
1915 if (SWALLOW_Type_1RADIO_RIGHT == swallow_type) {
1916 /*Radio in right,so icon is in left */
1917 item_data->l_swallow_path = (char *)g_strdup(button_style);
1919 item_data->r_swallow_path = (char *)g_strdup(button_style);
1921 item_data->chk_status = chk_status;
1922 item_data->chk_change_cb = chk_change_cb;
1923 item_data->stop_change_cb = btn_clicked_cb;
1924 item_data->rgd = rgd;
1925 if (itc && itc->item_style) {
1926 item_data->itc = (char *)g_strdup(itc->item_style);
1931 elm_genlist_item_append(genlist, itc, item_data, NULL,
1932 ELM_GENLIST_ITEM_NONE, gl_sel,
1936 elm_genlist_item_append(genlist, itc, item_data, NULL,
1937 ELM_GENLIST_ITEM_NONE,
1938 _gl_Gendial_sel, sel_data);
1944 Setting_GenGroupItem_Data *setting_create_Gendial_field_2radio(
1945 Evas_Object *genlist,
1946 const Elm_Genlist_Item_Class *itc,
1947 setting_call_back_func gl_sel,
1949 SWALLOW_Type swallow_type,
1950 Evas_Object *rgd, int chk_status,
1952 const char *sub_desc,
1953 setting_call_back_func chk_change_cb)
1955 /* SETTING_TRACE_BEGIN; */
1956 Setting_GenGroupItem_Data *item_data =
1957 (Setting_GenGroupItem_Data *) calloc(1,
1959 (Setting_GenGroupItem_Data));
1960 setting_retvm_if(!item_data, NULL, "calloc failed");
1961 item_data->keyStr = (char *)g_strdup(keyStr);
1962 item_data->sub_desc = (char *)g_strdup(sub_desc);
1963 item_data->swallow_type = swallow_type;
1964 item_data->chk_status = chk_status;
1965 item_data->chk_change_cb = chk_change_cb;
1966 item_data->rgd = rgd;
1967 if (itc && itc->item_style) {
1968 item_data->itc = (char *)g_strdup(itc->item_style);
1973 elm_genlist_item_append(genlist, itc, item_data, NULL,
1974 ELM_GENLIST_ITEM_NONE, gl_sel,
1978 elm_genlist_item_append(genlist, itc, item_data, NULL,
1979 ELM_GENLIST_ITEM_NONE,
1980 _gl_Gendial_sel, sel_data);
1986 * Create common style item with menu icon
1988 * @return a pointer to Setting_GenGroupItem_Data
1991 Setting_GenGroupItem_Data *setting_create_Gendial_field_groupitem(
1992 Evas_Object *genlist,
1993 const Elm_Genlist_Item_Class *itc,
1994 Elm_Object_Item *parent,
1995 setting_call_back_func gl_sel,
1997 SWALLOW_Type swallow_type,
1999 char *r_icon_path, int chk_status,
2000 const char *keyStr, char *sub_desc,
2001 setting_call_back_func
2004 /* SETTING_TRACE_BEGIN; */
2005 Setting_GenGroupItem_Data *item_data = (
2006 Setting_GenGroupItem_Data *) calloc(1, sizeof(Setting_GenGroupItem_Data));
2007 setting_retvm_if(!item_data, NULL, "calloc failed");
2009 /* to do formatting customizition in one place */
2010 if (SWALLOW_Type_LAYOUT_SPECIALIZTION == swallow_type
2011 || SWALLOW_Type_LAYOUT_SPECIALIZTION_X == swallow_type) {
2012 elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
2014 char speciliztion[MAX_SPECIALIZITION_LEN] = { 0, };
2015 char *temp1 = (char *)keyStr;
2016 char *temp2 = strchr(temp1, '&');
2019 while (NULL != temp2) {
2020 if (0 == safeStrNCmp(temp2, "&", strlen("&")) ||/*'&' */
2021 0 == safeStrNCmp(temp2, "<", strlen("<")) ||/*'<' */
2022 0 == safeStrNCmp(temp2, ">", strlen(">")) ||/*'>' */
2023 0 == safeStrNCmp(temp2, """, strlen(""")) ||/*double quotes */
2024 0 == safeStrNCmp(temp2, "'", strlen("'")) ||/*single quotes */
2025 0 == safeStrNCmp(temp2, " ", strlen(" ")) ||/*space character */
2026 0 == safeStrNCmp(temp2, "©", strlen("©")) ||/*copyright character */
2027 0 == safeStrNCmp(temp2, "®", strlen("®"))/*registeration character */
2028 ) {/*escape character,do nothing */
2030 if ('\0' == temp[0]) break;
2031 temp2 = strchr(temp, '&');
2033 g_strlcat(speciliztion, temp1, temp2 - temp1 + 1);
2034 g_strlcat(speciliztion, "&", MAX_SPECIALIZITION_LEN);
2036 if ('\0' == temp1[0]) break;
2037 temp2 = strchr(temp1, '&');
2040 if ('\0' != temp1[0]) {
2041 g_strlcat(speciliztion, temp1, MAX_SPECIALIZITION_LEN);
2045 item_data->keyStr = (char *)g_strdup(speciliztion);
2047 item_data->keyStr = (char *)g_strdup(keyStr);
2050 item_data->sub_desc = NULL;
2052 item_data->sub_desc = (char *)g_strdup(sub_desc);
2054 item_data->swallow_type = swallow_type;
2055 item_data->l_swallow_path = (char *)g_strdup(l_icon_path);
2056 item_data->r_swallow_path = (char *)g_strdup(r_icon_path);
2057 item_data->chk_status = chk_status;
2058 item_data->chk_change_cb = chk_change_cb;
2059 if (itc && itc->item_style) {
2060 item_data->itc = (char *)g_strdup(itc->item_style);
2063 const char *insert_type = evas_object_data_get(genlist, "InsertType");
2064 /*SETTING_TRACE("insert_type:%s", insert_type); */
2065 if (!gl_sel) gl_sel = _gl_Gendial_sel;
2066 if (0 == safeStrCmp(insert_type, "Insert before")) {
2068 elm_genlist_item_insert_before(genlist, itc, item_data, parent, parent,
2069 ELM_GENLIST_ITEM_NONE, gl_sel,
2071 } else if (0 == safeStrCmp(insert_type, "Insert after")) {
2073 elm_genlist_item_insert_after(genlist, itc, item_data, parent, parent,
2074 ELM_GENLIST_ITEM_NONE, gl_sel,
2076 } else if (0 == safeStrCmp(insert_type, "Prepend")) {
2078 elm_genlist_item_prepend(genlist, itc, item_data, parent,
2079 ELM_GENLIST_ITEM_NONE, gl_sel,
2083 elm_genlist_item_append(genlist, itc, item_data, parent,
2084 ELM_GENLIST_ITEM_NONE, gl_sel,
2087 /*help text clicking issue */
2088 if (SWALLOW_Type_LAYOUT_SPECIALIZTION_X == swallow_type)
2089 elm_genlist_item_select_mode_set(item_data->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
2090 evas_object_data_set(genlist, "InsertType", NULL);/*redundant process,it should be due to invokers,but maybe they forget it */
2096 Setting_GenGroupItem_Data *setting_create_Gendial_field_helpitem_without_bottom_separator(
2097 Evas_Object *genlist,
2098 const Elm_Genlist_Item_Class *itc,
2099 SWALLOW_Type swallow_type,
2102 /* SETTING_TRACE_BEGIN; */
2103 Setting_GenGroupItem_Data *item_data = (
2104 Setting_GenGroupItem_Data *) calloc(1, sizeof(Setting_GenGroupItem_Data));
2105 setting_retvm_if(!item_data, NULL, "calloc failed");
2107 elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
2109 char speciliztion[MAX_SPECIALIZITION_LEN] = { 0, };
2110 char *temp1 = (char *)keyStr;
2111 char *temp2 = strchr(temp1, '&');
2114 while (NULL != temp2) {
2115 if (0 == safeStrNCmp(temp2, "&", strlen("&")) ||/*'&' */
2116 0 == safeStrNCmp(temp2, "<", strlen("<")) ||/*'<' */
2117 0 == safeStrNCmp(temp2, ">", strlen(">")) ||/*'>' */
2118 0 == safeStrNCmp(temp2, """, strlen(""")) ||/*double quotes */
2119 0 == safeStrNCmp(temp2, "'", strlen("'")) ||/*single quotes */
2120 0 == safeStrNCmp(temp2, " ", strlen(" ")) ||/*space character */
2121 0 == safeStrNCmp(temp2, "©", strlen("©")) ||/*copyright character */
2122 0 == safeStrNCmp(temp2, "®", strlen("®"))/*registeration character */
2123 ) {/*escape character,do nothing */
2125 if ('\0' == temp[0]) break;
2126 temp2 = strchr(temp, '&');
2128 g_strlcat(speciliztion, temp1, temp2 - temp1 + 1);
2129 g_strlcat(speciliztion, "&", MAX_SPECIALIZITION_LEN);
2131 if ('\0' == temp1[0]) break;
2132 temp2 = strchr(temp1, '&');
2135 if ('\0' != temp1[0]) {
2136 g_strlcat(speciliztion, temp1, MAX_SPECIALIZITION_LEN);
2140 item_data->keyStr = (char *)g_strdup(speciliztion);
2141 item_data->swallow_type = swallow_type;
2142 if (itc && itc->item_style) {
2143 item_data->itc = (char *)g_strdup(itc->item_style);
2147 elm_genlist_item_append(genlist, itc, item_data, NULL,
2148 ELM_GENLIST_ITEM_NONE,
2151 elm_genlist_item_select_mode_set(item_data->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
2156 Setting_GenGroupItem_Data *setting_create_Gendial_field_insert_help_without_bottom_separator(
2157 Evas_Object *genlist,
2158 const Elm_Genlist_Item_Class *itc,
2159 Elm_Object_Item *after_it,
2160 SWALLOW_Type swallow_type,
2163 /* SETTING_TRACE_BEGIN; */
2164 Setting_GenGroupItem_Data *item_data = (
2165 Setting_GenGroupItem_Data *) calloc(1, sizeof(Setting_GenGroupItem_Data));
2166 setting_retvm_if(!item_data, NULL, "calloc failed");
2168 elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
2170 char speciliztion[MAX_SPECIALIZITION_LEN] = { 0, };
2171 char *temp1 = (char *)keyStr;
2172 char *temp2 = strchr(temp1, '&');
2175 while (NULL != temp2) {
2176 if (0 == safeStrNCmp(temp2, "&", strlen("&")) ||/*'&' */
2177 0 == safeStrNCmp(temp2, "<", strlen("<")) ||/*'<' */
2178 0 == safeStrNCmp(temp2, ">", strlen(">")) ||/*'>' */
2179 0 == safeStrNCmp(temp2, """, strlen(""")) ||/*double quotes */
2180 0 == safeStrNCmp(temp2, "'", strlen("'")) ||/*single quotes */
2181 0 == safeStrNCmp(temp2, " ", strlen(" ")) ||/*space character */
2182 0 == safeStrNCmp(temp2, "©", strlen("©")) ||/*copyright character */
2183 0 == safeStrNCmp(temp2, "®", strlen("®"))/*registeration character */
2184 ) {/*escape character,do nothing */
2186 if ('\0' == temp[0]) break;
2187 temp2 = strchr(temp, '&');
2189 g_strlcat(speciliztion, temp1, temp2 - temp1 + 1);
2190 g_strlcat(speciliztion, "&", MAX_SPECIALIZITION_LEN);
2192 if ('\0' == temp1[0]) break;
2193 temp2 = strchr(temp1, '&');
2196 if ('\0' != temp1[0]) {
2197 g_strlcat(speciliztion, temp1, MAX_SPECIALIZITION_LEN);
2201 item_data->keyStr = (char *)g_strdup(speciliztion);
2202 item_data->swallow_type = swallow_type;
2203 if (itc && itc->item_style) {
2204 item_data->itc = (char *)g_strdup(itc->item_style);
2208 elm_genlist_item_insert_after(genlist, itc, item_data, NULL, after_it,
2209 ELM_GENLIST_ITEM_NONE,
2212 elm_genlist_item_select_mode_set(item_data->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
2218 * Common function to create a genlist item
2219 * @return a pointer to Setting_GenGroupItem_Data
2221 EXPORT_PUBLIC Setting_GenGroupItem_Data *setting_create_Gendial_field_def(Evas_Object *
2223 const Elm_Genlist_Item_Class *itc,
2224 setting_call_back_func
2234 setting_call_back_func chk_change_cb)
2236 return setting_create_Gendial_field_groupitem(genlist, itc, NULL,
2238 swallow_type, l_icon_path,
2239 r_icon_path, chk_status,
2245 * Create 1entry style item
2247 * @return a pointer to Setting_GenGroupItem_Data
2250 Setting_GenGroupItem_Data *setting_create_Gendial_field_entry_fo(
2251 Evas_Object *genlist,
2252 const Elm_Genlist_Item_Class *itc,
2253 setting_call_back_func gl_sel,
2255 SWALLOW_Type swallow_type,
2261 setting_call_back_func chk_change_cb,
2262 setting_call_back_func chk_focus_out_cb,
2263 Elm_Input_Panel_Layout input_type,
2264 bool isPasswordFlag,
2272 /* SETTING_TRACE_BEGIN; */
2273 Setting_GenGroupItem_Data *item_data = (Setting_GenGroupItem_Data *) calloc(1, sizeof(Setting_GenGroupItem_Data));
2274 setting_retvm_if(!item_data, NULL, "calloc failed");
2275 item_data->keyStr = (char *)g_strdup(keyStr);
2276 item_data->sub_desc = (char *)g_strdup(sub_desc);
2277 item_data->swallow_type = swallow_type;
2278 item_data->l_swallow_path = (char *)g_strdup(l_icon_path);
2279 item_data->r_swallow_path = (char *)g_strdup(r_icon_path);
2280 item_data->chk_status = chk_status;
2281 item_data->chk_change_cb = chk_change_cb;
2282 item_data->stop_change_cb = chk_focus_out_cb;
2283 item_data->isSinglelineFlag = true;
2285 item_data->input_type = input_type;
2286 item_data->isPasswordFlag = isPasswordFlag;
2287 item_data->isFocusFlag = isFocusFlag;
2288 if (itc && itc->item_style) {
2289 item_data->itc = (char *)g_strdup(itc->item_style);
2292 Elm_Entry_Filter_Accept_Set *digits_filter_data =
2293 (Elm_Entry_Filter_Accept_Set *) calloc(1, sizeof(Elm_Entry_Filter_Accept_Set));
2294 if (!digits_filter_data) {
2295 SETTING_TRACE_ERROR("calloc Elm_Entry_Filter_Accept_Set failed");
2296 /* free allocated data */
2297 G_FREE(item_data->keyStr);
2298 G_FREE(item_data->sub_desc);
2299 G_FREE(item_data->l_swallow_path);
2300 G_FREE(item_data->r_swallow_path);
2301 G_FREE(item_data->itc);
2307 Elm_Entry_Filter_Limit_Size *limit_filter_data =
2308 (Elm_Entry_Filter_Limit_Size *) calloc(1, sizeof(Elm_Entry_Filter_Limit_Size));
2309 if (!limit_filter_data) {
2310 SETTING_TRACE_ERROR("calloc Elm_Entry_Filter_Limit_Size failed");
2312 /* free allocated data */
2313 G_FREE(item_data->keyStr);
2314 G_FREE(item_data->sub_desc);
2315 G_FREE(item_data->l_swallow_path);
2316 G_FREE(item_data->r_swallow_path);
2317 G_FREE(item_data->itc);
2319 FREE(digits_filter_data);
2323 limit_filter_data->max_char_count = max_char_count;
2324 limit_filter_data->max_byte_count = max_byte_count;
2325 digits_filter_data->accepted = (char *)g_strdup(accepted);
2326 digits_filter_data->rejected = (char *)g_strdup(rejected);
2328 item_data->digits_filter_data = digits_filter_data;
2329 item_data->limit_filter_data = limit_filter_data;
2330 item_data->userdata = sel_data;
2332 item_data->minlength = min_char_count;
2336 elm_genlist_item_append(genlist, itc, item_data, NULL,
2337 ELM_GENLIST_ITEM_NONE, gl_sel,
2341 elm_genlist_item_append(genlist, itc, item_data, NULL,
2342 ELM_GENLIST_ITEM_NONE,
2343 _gl_Gendial_sel, sel_data);
2349 * Create 1entry style item
2350 * @return a pointer to Setting_GenGroupItem_Data
2353 Setting_GenGroupItem_Data *setting_create_Gendial_field_entry(Evas_Object *
2355 const Elm_Genlist_Item_Class *itc,
2356 setting_call_back_func gl_sel,
2365 setting_call_back_func
2367 Elm_Input_Panel_Layout
2369 bool isPasswordFlag,
2376 /* SETTING_TRACE_BEGIN; */
2377 Setting_GenGroupItem_Data *item_data = (Setting_GenGroupItem_Data *) calloc(1,
2378 sizeof(Setting_GenGroupItem_Data));
2379 setting_retvm_if(!item_data, NULL, "calloc failed");
2380 item_data->keyStr = (char *)g_strdup(keyStr);
2381 item_data->sub_desc = (char *)g_strdup(sub_desc);
2382 item_data->swallow_type = swallow_type;
2383 item_data->l_swallow_path = (char *)g_strdup(l_icon_path);
2384 item_data->r_swallow_path = (char *)g_strdup(r_icon_path);
2385 item_data->chk_status = chk_status;
2386 item_data->chk_change_cb = chk_change_cb;
2388 item_data->input_type = input_type;
2389 item_data->isPasswordFlag = isPasswordFlag;
2390 item_data->isFocusFlag = isFocusFlag;
2391 if (itc && itc->item_style) {
2392 item_data->itc = (char *)g_strdup(itc->item_style);
2395 Elm_Entry_Filter_Accept_Set *digits_filter_data =
2396 (Elm_Entry_Filter_Accept_Set *) calloc(1, sizeof(Elm_Entry_Filter_Accept_Set));
2397 if (!digits_filter_data) {
2398 SETTING_TRACE_ERROR("calloc Elm_Entry_Filter_Accept_Set failed");
2399 /* free allocated data */
2400 G_FREE(item_data->keyStr);
2401 G_FREE(item_data->sub_desc);
2402 G_FREE(item_data->l_swallow_path);
2403 G_FREE(item_data->r_swallow_path);
2404 G_FREE(item_data->itc);
2410 Elm_Entry_Filter_Limit_Size *limit_filter_data =
2411 (Elm_Entry_Filter_Limit_Size *) calloc(1, sizeof(Elm_Entry_Filter_Limit_Size));
2412 if (!limit_filter_data) {
2413 SETTING_TRACE_ERROR("calloc Elm_Entry_Filter_Limit_Size failed");
2415 /* free allocated data */
2416 G_FREE(item_data->keyStr);
2417 G_FREE(item_data->sub_desc);
2418 G_FREE(item_data->l_swallow_path);
2419 G_FREE(item_data->r_swallow_path);
2420 G_FREE(item_data->itc);
2422 FREE(digits_filter_data);
2426 limit_filter_data->max_char_count = max_char_count;
2427 limit_filter_data->max_byte_count = max_byte_count;
2428 digits_filter_data->accepted = (char *)g_strdup(accepted);
2429 digits_filter_data->rejected = (char *)g_strdup(rejected);
2431 item_data->digits_filter_data = digits_filter_data;
2432 item_data->limit_filter_data = limit_filter_data;
2433 item_data->userdata = sel_data;
2437 elm_genlist_item_append(genlist, itc, item_data, NULL,
2438 ELM_GENLIST_ITEM_NONE, gl_sel,
2442 elm_genlist_item_append(genlist, itc, item_data, NULL,
2443 ELM_GENLIST_ITEM_NONE,
2444 _gl_Gendial_sel, sel_data);
2447 if (swallow_type == SWALLOW_Type_LAYOUT_EDITFIELD)
2448 elm_genlist_item_select_mode_set(item_data->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
2454 * Create 1entry style item with parameter return_key_type
2455 * @return a pointer to Setting_GenGroupItem_Data
2458 Setting_GenGroupItem_Data *setting_create_Gendial_field_entry_with_return_key(Evas_Object *
2460 const Elm_Genlist_Item_Class *itc,
2461 setting_call_back_func gl_sel,
2470 setting_call_back_func
2472 setting_call_back_func
2474 Elm_Input_Panel_Layout
2476 bool isPasswordFlag,
2482 Elm_Input_Panel_Return_Key_Type return_key_type,
2483 setting_call_back_func
2485 setting_call_back_func x_callback_cb)
2487 /* SETTING_TRACE_BEGIN; */
2488 Setting_GenGroupItem_Data *item_data = (Setting_GenGroupItem_Data *) calloc(1,
2489 sizeof(Setting_GenGroupItem_Data));
2490 setting_retvm_if(!item_data, NULL, "calloc failed");
2491 item_data->keyStr = (char *)g_strdup(keyStr);
2492 item_data->sub_desc = (char *)g_strdup(sub_desc);
2493 item_data->swallow_type = swallow_type;
2494 item_data->l_swallow_path = (char *)g_strdup(l_icon_path);
2495 item_data->r_swallow_path = (char *)g_strdup(r_icon_path);
2496 item_data->chk_status = chk_status;
2497 item_data->chk_change_cb = chk_change_cb;
2498 item_data->maxlength_reached_cb = max_reach_cb;
2499 item_data->x_callback_cb = x_callback_cb;
2501 item_data->input_type = input_type;
2502 item_data->isPasswordFlag = isPasswordFlag;
2503 item_data->isSinglelineFlag = isPasswordFlag;
2504 item_data->isFocusFlag = isFocusFlag;
2505 item_data->return_key_type = return_key_type;
2506 item_data->disable_auto_cap = EINA_TRUE;
2507 if (itc && itc->item_style) {
2508 item_data->itc = (char *)g_strdup(itc->item_style);
2510 Elm_Entry_Filter_Accept_Set *digits_filter_data =
2511 (Elm_Entry_Filter_Accept_Set *) calloc(1, sizeof(Elm_Entry_Filter_Accept_Set));
2512 if (!digits_filter_data) {
2513 SETTING_TRACE_ERROR("calloc Elm_Entry_Filter_Accept_Set failed");
2514 /* free allocated data */
2515 G_FREE(item_data->keyStr);
2516 G_FREE(item_data->sub_desc);
2517 G_FREE(item_data->l_swallow_path);
2518 G_FREE(item_data->r_swallow_path);
2519 G_FREE(item_data->itc);
2525 Elm_Entry_Filter_Limit_Size *limit_filter_data =
2526 (Elm_Entry_Filter_Limit_Size *) calloc(1, sizeof(Elm_Entry_Filter_Limit_Size));
2527 if (!limit_filter_data) {
2528 SETTING_TRACE_ERROR("calloc Elm_Entry_Filter_Limit_Size failed");
2530 /* free allocated data */
2531 G_FREE(item_data->keyStr);
2532 G_FREE(item_data->sub_desc);
2533 G_FREE(item_data->l_swallow_path);
2534 G_FREE(item_data->r_swallow_path);
2535 FREE(item_data->itc);
2537 FREE(digits_filter_data);
2541 limit_filter_data->max_char_count = max_char_count;
2542 limit_filter_data->max_byte_count = max_byte_count;
2543 digits_filter_data->accepted = (char *)g_strdup(accepted);
2544 digits_filter_data->rejected = (char *)g_strdup(rejected);
2546 item_data->digits_filter_data = digits_filter_data;
2547 item_data->limit_filter_data = limit_filter_data;
2548 item_data->userdata = sel_data;
2552 elm_genlist_item_append(genlist, itc, item_data, NULL,
2553 ELM_GENLIST_ITEM_NONE, gl_sel,
2557 elm_genlist_item_append(genlist, itc, item_data, NULL,
2558 ELM_GENLIST_ITEM_NONE,
2559 _gl_Gendial_sel, sel_data);
2562 if (swallow_type == SWALLOW_Type_LAYOUT_EDITFIELD)
2563 elm_genlist_item_select_mode_set(item_data->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
2569 * Create 1entry style item
2570 * @return a pointer to Setting_GenGroupItem_Data
2573 Setting_GenGroupItem_Data *setting_create_Gendial_field_editfield(Evas_Object *
2575 const Elm_Genlist_Item_Class *itc,
2576 setting_call_back_func gl_sel,
2582 setting_call_back_func
2584 setting_call_back_func
2586 setting_call_back_func
2588 setting_call_back_func
2590 setting_call_back_func
2592 Elm_Input_Panel_Layout
2594 bool isPasswordFlag,
2601 /* SETTING_TRACE_BEGIN; */
2602 Setting_GenGroupItem_Data *item_data = (Setting_GenGroupItem_Data *) calloc(1,
2603 sizeof(Setting_GenGroupItem_Data));
2604 setting_retvm_if(!item_data, NULL, "calloc failed");
2605 item_data->keyStr = (char *)g_strdup(keyStr);
2606 item_data->sub_desc = (char *)g_strdup(sub_desc);
2607 item_data->swallow_type = swallow_type;
2608 item_data->l_swallow_path = NULL;
2609 item_data->r_swallow_path = NULL;
2610 item_data->chk_status = 0;
2611 item_data->chk_change_cb = chk_change_cb;
2612 item_data->focus_cb = focused_cb;
2613 item_data->stop_change_cb = unfocused_cb;
2614 item_data->activated_cb = activated_cb;
2615 item_data->maxlength_reached_cb = max_reached_cb;
2617 item_data->input_type = input_type;
2618 item_data->isPasswordFlag = isPasswordFlag;
2620 item_data->guide_text = (char *)g_strdup(_("IDS_ST_BODY_ENTER_PASSWORD"));
2621 item_data->isSinglelineFlag = isPasswordFlag;
2622 item_data->isFocusFlag = isFocusFlag;
2623 item_data->userdata = sel_data;
2624 if (itc && itc->item_style) {
2625 item_data->itc = (char *)g_strdup(itc->item_style);
2627 Elm_Entry_Filter_Accept_Set *digits_filter_data =
2628 (Elm_Entry_Filter_Accept_Set *) calloc(1, sizeof(Elm_Entry_Filter_Accept_Set));
2629 if (!digits_filter_data) {
2630 SETTING_TRACE_ERROR("calloc Elm_Entry_Filter_Accept_Set failed");
2631 /* free allocated data */
2632 G_FREE(item_data->keyStr);
2633 G_FREE(item_data->sub_desc);
2634 G_FREE(item_data->guide_text);
2635 G_FREE(item_data->itc);
2641 Elm_Entry_Filter_Limit_Size *limit_filter_data =
2642 (Elm_Entry_Filter_Limit_Size *) calloc(1, sizeof(Elm_Entry_Filter_Limit_Size));
2643 if (!limit_filter_data) {
2644 SETTING_TRACE_ERROR("calloc Elm_Entry_Filter_Limit_Size failed");
2646 /* free allocated data */
2647 G_FREE(item_data->keyStr);
2648 G_FREE(item_data->sub_desc);
2649 G_FREE(item_data->guide_text);
2650 G_FREE(item_data->itc);
2652 FREE(digits_filter_data);
2656 limit_filter_data->max_char_count = max_char_count;
2657 limit_filter_data->max_byte_count = max_byte_count;
2658 digits_filter_data->accepted = (char *)g_strdup(accepted);
2659 digits_filter_data->rejected = (char *)g_strdup(rejected);
2661 item_data->digits_filter_data = digits_filter_data;
2662 item_data->limit_filter_data = limit_filter_data;
2663 item_data->userdata = sel_data;
2667 elm_genlist_item_append(genlist, itc, item_data, NULL,
2668 ELM_GENLIST_ITEM_NONE, gl_sel,
2672 elm_genlist_item_append(genlist, itc, item_data, NULL,
2673 ELM_GENLIST_ITEM_NONE,
2674 _gl_Gendial_sel, sel_data);
2676 elm_genlist_item_select_mode_set(item_data->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
2682 * General function to create a parent item of expandable item
2684 * @return a pointer to Setting_GenGroupItem_Data
2687 Setting_GenGroupItem_Data *setting_create_Gendial_exp_parent_field(
2688 Evas_Object *genlist,
2689 const Elm_Genlist_Item_Class *itc,
2690 setting_call_back_func gl_sel,
2692 SWALLOW_Type swallow_type,
2695 setting_group_style exp_style,
2696 setting_group_style con_style)
2698 /* SETTING_TRACE_BEGIN; */
2699 Setting_GenGroupItem_Data *item_data =
2700 (Setting_GenGroupItem_Data *) calloc(1,
2702 (Setting_GenGroupItem_Data));
2703 setting_retvm_if(!item_data, NULL, "calloc failed");
2704 item_data->keyStr = (char *)g_strdup(keyStr);
2705 item_data->sub_desc = (char *)g_strdup(sub_desc);
2706 item_data->swallow_type = swallow_type;
2707 item_data->exp_style = exp_style;
2708 item_data->con_style = con_style;
2709 item_data->group_style = con_style;
2710 item_data->r_swallow_path = (char *)g_strdup(SETTING_IMAGE_PATH_CFG"00_list_button_expand_closed.png");
2711 if (itc && itc->item_style) {
2712 item_data->itc = (char *)g_strdup(itc->item_style);
2716 elm_genlist_item_append(genlist, itc, item_data, NULL,
2717 ELM_GENLIST_ITEM_TREE, gl_sel,
2721 elm_genlist_item_append(genlist, itc, item_data, NULL,
2722 ELM_GENLIST_ITEM_TREE,
2723 _gl_Gendial_sel_expand, sel_data);
2729 * General function to create a subitem of expandable item
2731 * @return a pointer to Setting_GenGroupItem_Data
2734 Setting_GenGroupItem_Data *setting_create_Gendial_exp_sub_field(
2735 Evas_Object *genlist,
2736 const Elm_Genlist_Item_Class *itc,
2737 setting_call_back_func gl_sel,
2739 Elm_Object_Item *parent,
2740 SWALLOW_Type swallow_type,
2741 Evas_Object *rgd, int chk_status,
2743 setting_call_back_func
2746 /* SETTING_TRACE_BEGIN; */
2747 Setting_GenGroupItem_Data *item_data =
2748 (Setting_GenGroupItem_Data *) calloc(1,
2750 (Setting_GenGroupItem_Data));
2751 setting_retvm_if(!item_data, NULL, "calloc failed");
2752 item_data->keyStr = (char *)g_strdup(keyStr);
2753 item_data->swallow_type = swallow_type;
2754 item_data->chk_status = chk_status;
2755 item_data->rgd = rgd;
2756 if (itc && itc->item_style) {
2757 item_data->itc = (char *)g_strdup(itc->item_style);
2760 gl_sel = setting_sub_list_sel_cb;
2762 if (!chk_change_cb) {
2763 chk_change_cb = setting_sub_list_rd_change;
2766 item_data->chk_change_cb = chk_change_cb;
2768 elm_genlist_item_append(genlist, itc, item_data, parent,
2769 ELM_GENLIST_ITEM_NONE, gl_sel, sel_data);
2775 * General function to create a subitem of expandable item with group style
2777 * @return a pointer to Setting_GenGroupItem_Data
2780 Setting_GenGroupItem_Data *setting_create_Gendial_exp_sub_field_with_group_style(
2781 Evas_Object *genlist,
2782 const Elm_Genlist_Item_Class *itc,
2783 setting_call_back_func gl_sel,
2785 Elm_Object_Item *parent,
2786 SWALLOW_Type swallow_type,
2787 Evas_Object *rgd, int chk_status,
2789 setting_call_back_func
2791 setting_group_style group_style)
2794 Setting_GenGroupItem_Data *item_data =
2795 (Setting_GenGroupItem_Data *) calloc(1,
2797 (Setting_GenGroupItem_Data));
2798 setting_retvm_if(!item_data, NULL, "calloc failed");
2799 item_data->keyStr = (char *)g_strdup(keyStr);
2800 item_data->swallow_type = swallow_type;
2801 item_data->chk_status = chk_status;
2802 item_data->rgd = rgd;
2803 if (itc && itc->item_style) {
2804 item_data->itc = (char *)g_strdup(itc->item_style);
2807 gl_sel = setting_sub_list_sel_cb;
2809 if (!chk_change_cb) {
2810 chk_change_cb = setting_sub_list_rd_change;
2813 item_data->chk_change_cb = chk_change_cb;
2814 item_data->group_style = group_style;
2816 elm_genlist_item_append(genlist, itc, item_data, parent,
2817 ELM_GENLIST_ITEM_NONE, gl_sel, sel_data);
2822 * To make genlist support expandable style item
2825 void setting_enable_expandable_genlist(Evas_Object *genlist, void *data,
2826 setting_call_back_func gl_exp_cb,
2827 setting_call_back_func gl_smart_cb)
2829 ret_if(NULL == genlist);
2830 elm_genlist_tree_effect_enabled_set(genlist, EINA_FALSE);
2832 gl_smart_cb = __exp_list_smart_cb;
2836 evas_object_smart_callback_add(genlist, "expanded", gl_exp_cb, data);
2837 evas_object_smart_callback_add(genlist, "contracted", gl_smart_cb, "contracted");
2838 evas_object_smart_callback_add(genlist, "expanded", gl_smart_cb, "expanded");
2840 evas_object_smart_callback_add(genlist, "drag", gl_smart_cb, "drag");
2841 evas_object_smart_callback_add(genlist, "longpressed", gl_smart_cb, "longpressed");
2847 setting_create_Gendial_itc("dialogue/1text.2icon.2",
2848 &(networkUG->itc_1text_2icon));
2850 1. create a process genlist item : [intial state is 'PROCESS']
2851 ad->data_searching_net = setting_create_Gendial_field_1radio(scroller, &(ad->itc_1text_2icon),
2852 setting_network_select_network_mouse_up_Gendial_list_radio_cb, ad,
2853 SWALLOW_Type_1RADIO_1PROCESS,
2854 ad->chk_sel, TAPI_NETWORK_SELECTIONMODE_MANUAL,
2855 "Searching..", NULL);
2856 or [intial state is 'UNPROCESS']
2857 ad->data_searching_net = setting_create_Gendial_field_1radio(scroller, &(ad->itc_1text_2icon),
2858 setting_network_select_network_mouse_up_Gendial_list_radio_cb, ad,
2859 SWALLOW_Type_1RADIO,
2860 ad->chk_sel, TAPI_NETWORK_SELECTIONMODE_MANUAL,
2861 "Searching..", NULL);
2863 2. to set the PROCESS state at any place as you like:
2864 setting_begin_progress_genlist_item(ad->data_searching_net); -- change from UNPROCESS->PROCESS
2865 setting_finish_progress_genlist_item(ad->data_searching_net);--change from PROCESS->UNPROCESS
2868 void setting_begin_progress_genlist_item(Setting_GenGroupItem_Data *data_item)
2871 if (SWALLOW_Type_1RADIO != data_item->swallow_type) {
2875 data_item->swallow_type = SWALLOW_Type_1RADIO_1PROCESS;
2876 elm_object_item_data_set(data_item->item, data_item);
2877 elm_genlist_item_update(data_item->item);
2882 void setting_finish_progress_genlist_item(Setting_GenGroupItem_Data *data_item)
2885 if (SWALLOW_Type_1RADIO_1PROCESS != data_item->swallow_type) {
2888 data_item->swallow_type = SWALLOW_Type_1RADIO;
2889 elm_object_item_data_set(data_item->item, data_item);
2890 elm_genlist_item_update(data_item->item);
2895 * Check if some item is selected in done-list
2898 bool setting_done_list_is_some_item_selected(Setting_Done_List_Data *list_data)
2900 SETTING_TRACE_BEGIN;
2901 bool isFound = FALSE; /* wether can found some item checked */
2903 for (; idx < list_data->cur_item_num; idx++) {
2904 if (list_data->chk_items[idx].data_GenItem->chk_status) {
2912 static void __setting_done_list_item_sel(void *data)
2914 SETTING_TRACE_BEGIN;
2915 retm_if(data == NULL, "data == NULL");
2916 Setting_Done_List_Data *list_data = (Setting_Done_List_Data *)data;
2920 /* else for other checks, do rotinue checking */
2921 bool isFound = FALSE; /* wether found the item not checked */
2922 for (idx = 0; idx < list_data->cur_item_num; idx++) {
2923 if (!list_data->chk_items[idx].data_GenItem->chk_status) {
2924 /* SETTING_TRACE("%s not select", _(list_data->chk_items[idx].item_name)); */
2928 /* SETTING_TRACE("%s select", _(list_data->chk_items[idx].item_name)); */
2933 list_data->cur_item_selnum = sel_num;
2934 if (isFound) { /* reset state of chk_sel_all */
2935 list_data->select_all_checked = 0;
2936 elm_check_state_pointer_set(list_data->select_all_checkbox, &list_data->select_all_checked);
2938 list_data->select_all_checked = 1;
2939 elm_check_state_pointer_set(list_data->select_all_checkbox, &list_data->select_all_checked);
2943 char text[MAX_DISPLAY_NAME_LEN_ON_UI + 1] = {0, };
2944 snprintf(text, MAX_DISPLAY_NAME_LEN_ON_UI, _("IDS_ST_HEADER_PD_SELECTED"), sel_num);
2945 elm_object_item_part_text_set(list_data->navi_it, "elm.text.title", text);
2947 elm_object_item_part_text_set(list_data->navi_it, "elm.text.title", _(list_data->navi_title));
2950 /* SETTING_TRACE("sel_num:%d", sel_num); */
2952 if (list_data->navi_it) {
2953 Evas_Object *toolbar = elm_object_item_part_content_get(list_data->navi_it, "toolbar");
2954 elm_object_item_disabled_set(elm_toolbar_last_item_get(toolbar), EINA_TRUE);
2956 evas_object_hide(list_data->selInfoPop);
2960 if (list_data->navi_it) {
2961 Evas_Object *toolbar = elm_object_item_part_content_get(list_data->navi_it, "toolbar");
2962 elm_object_item_disabled_set(elm_toolbar_last_item_get(toolbar), EINA_FALSE);
2967 * Do process when clicking the check object in the done-list item
2970 void setting_done_list_Gendial_chk_btn_cb(void *data, Evas_Object *obj,
2973 SETTING_TRACE_BEGIN;
2975 retm_if(data == NULL, "Data parameter is NULL");
2976 Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
2979 list_item->chk_status = elm_check_state_get(obj);
2981 Setting_Done_List_Data *list_data = list_item->userdata;
2982 __setting_done_list_item_sel(list_data);
2985 static void setting_done_list_Gendial_mouse_up_cb(void *data, Evas_Object *obj,
2989 retm_if(event_info == NULL, "Invalid argument: event info is NULL");
2990 Elm_Object_Item *item = (Elm_Object_Item *) event_info;
2991 elm_genlist_item_selected_set(item, 0);
2992 Setting_GenGroupItem_Data *list_item =
2993 (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
2994 setting_retm_if(NULL == list_item, "list_item is NULL");
2997 setting_update_gl_item_chk_status(list_item, !(list_item->chk_status));
2999 /* other process.. */
3000 Setting_Done_List_Data *list_data = list_item->userdata;
3001 __setting_done_list_item_sel(list_data);
3004 static void __setting_select_all_done(void *data)
3006 SETTING_TRACE_BEGIN;
3007 retm_if(data == NULL, "data == NULL");
3008 Setting_Done_List_Data *list_data = (Setting_Done_List_Data *)data;
3013 if (list_data->select_all_checked) {
3014 /* set all other checks state to be 1 */
3015 SETTING_TRACE_DEBUG("Select All checked");
3016 for (idx = 0; idx < list_data->cur_item_num; idx++) {
3017 list_data->chk_items[idx].data_GenItem->chk_status = 1;
3018 elm_object_item_data_set(list_data->chk_items[idx].data_GenItem->item, list_data->chk_items[idx].data_GenItem);
3019 elm_genlist_item_update(list_data->chk_items[idx].data_GenItem->item);
3021 sel_num = list_data->cur_item_num;
3023 SETTING_TRACE_DEBUG("Select All unchecked");
3024 /* set all other checks state to be 0 */
3025 for (idx = 0; idx < list_data->cur_item_num; idx++) {
3026 list_data->chk_items[idx].data_GenItem->chk_status = 0;
3027 elm_object_item_data_set(list_data->chk_items[idx].data_GenItem->item, list_data->chk_items[idx].data_GenItem);
3028 elm_genlist_item_update(list_data->chk_items[idx].data_GenItem->item);
3033 /* text set and timeout set */
3035 char text[MAX_DISPLAY_NAME_LEN_ON_UI + 1] = {0, };
3036 snprintf(text, MAX_DISPLAY_NAME_LEN_ON_UI, _("IDS_ST_HEADER_PD_SELECTED"), sel_num);
3037 elm_object_item_part_text_set(list_data->navi_it, "elm.text.title", text);
3039 elm_object_item_part_text_set(list_data->navi_it, "elm.text.title", _(list_data->navi_title));
3041 /* SETTING_TRACE("sel_num:%d", sel_num); */
3043 if (list_data->navi_it) {
3044 Evas_Object *toolbar = elm_object_item_part_content_get(list_data->navi_it, "toolbar");
3045 elm_object_item_disabled_set(elm_toolbar_last_item_get(toolbar), EINA_TRUE);
3048 evas_object_hide(list_data->selInfoPop);
3052 if (list_data->navi_it) {
3053 Evas_Object *toolbar = elm_object_item_part_content_get(list_data->navi_it, "toolbar");
3054 elm_object_item_disabled_set(elm_toolbar_last_item_get(toolbar), EINA_FALSE);
3058 static void __setting_select_all_layout_mouse_up_cb(void *data, Evas_Object *obj, void *event_info)
3060 SETTING_TRACE_BEGIN;
3061 retm_if(data == NULL, "data == NULL");
3062 Setting_Done_List_Data *list_data = (Setting_Done_List_Data *)data;
3064 list_data->select_all_checked = !list_data->select_all_checked;
3065 /*elm_check_state_pointer_set(list_data->select_all_checkbox, &list_data->select_all_checked); */
3067 __setting_select_all_done(list_data);
3070 /*static void __setting_select_all_check_changed_cb(void *data, Evas_Object *obj, void *event_info)
3072 SETTING_TRACE_BEGIN;
3073 retm_if(data == NULL, "data == NULL");
3074 Setting_Done_List_Data *list_data = (Setting_Done_List_Data *)data;
3075 list_data->select_all_checkbox = obj;
3076 list_data->select_all_checked = elm_check_state_get(list_data->select_all_checkbox);
3077 elm_check_state_pointer_set(list_data->select_all_checkbox, &list_data->select_all_checked);
3078 __setting_select_all_done(data);
3080 static void setting_callback_select_all_button_pressed_cb(void *data, Evas_Object *obj, void *event_info)
3082 SETTING_TRACE_BEGIN;
3083 retm_if(data == NULL, "data is NULL");
3085 Evas_Object *select_button_ic = (Evas_Object *)data;
3086 elm_image_file_set(select_button_ic, SETTING_ICON_PATH_CFG"select_all.png", NULL);
3088 static void setting_callback_select_all_button_unpressed_cb(void *data, Evas_Object *obj, void *event_info)
3090 SETTING_TRACE_BEGIN;
3091 retm_if(data == NULL, "data is NULL");
3093 Evas_Object *select_button_ic = (Evas_Object *)data;
3094 elm_image_file_set(select_button_ic, SETTING_ICON_PATH_CFG"select_all.png", NULL);
3097 * The API to create done-list.
3099 * @param[in] list_data
3100 * @return a done-list
3103 Evas_Object *setting_create_done_list(Setting_Done_List_Data *list_data, const char *title)
3105 SETTING_TRACE_BEGIN;
3106 retvm_if(list_data == NULL, NULL, "list_data == NULL");
3107 setting_create_Gendial_itc("1line", &(list_data->itc_1text_1icon));
3109 elm_object_item_part_text_set(list_data->navi_it, "elm.text.title", _(title));
3111 title = elm_object_item_part_text_get(list_data->navi_it, "elm.text.title");
3114 memset((char *)(list_data->navi_title), 0, sizeof(list_data->navi_title));
3115 safeCopyStr((char *)(list_data->navi_title), title, sizeof(list_data->navi_title));
3116 SETTING_TRACE("list_data->navi_title:%s", list_data->navi_title);
3118 Evas_Object *allbtn = elm_button_add(list_data->win_main);
3119 elm_object_style_set(allbtn, "naviframe/title_icon");
3121 Evas_Object *icon = elm_icon_add(allbtn);
3122 elm_image_file_set(icon, SETTING_ICON_PATH_CFG"select_all.png", NULL);
3124 elm_object_content_set(allbtn, icon);
3125 elm_object_focus_allow_set(allbtn, EINA_FALSE);
3126 evas_object_propagate_events_set(allbtn, EINA_FALSE);
3127 evas_object_smart_callback_add(allbtn, "clicked", __setting_select_all_layout_mouse_up_cb, list_data);
3128 evas_object_smart_callback_add(allbtn, "pressed", setting_callback_select_all_button_pressed_cb, icon);
3129 evas_object_smart_callback_add(allbtn, "unpressed", setting_callback_select_all_button_unpressed_cb, icon);
3131 evas_object_show(allbtn);
3132 elm_object_item_part_content_set(list_data->navi_it, "title_right_btn", allbtn);
3134 Evas_Object *scroller = elm_genlist_add(list_data->win_main);
3135 retvm_if(scroller == NULL, NULL, "scroller == NULL");
3136 //elm_genlist_realization_mode_set(scroller, EINA_TRUE);
3137 elm_genlist_clear(scroller); /* first to clear list */
3138 evas_object_smart_callback_add(scroller, "realized", __gl_realized_cb, NULL);
3142 for (; index < list_data->cur_item_num; index++) {
3143 list_data->chk_items[index].data_GenItem =
3144 setting_create_Gendial_field_def(scroller,
3145 &(list_data->itc_1text_1icon),
3146 setting_done_list_Gendial_mouse_up_cb,
3148 SWALLOW_Type_1CHECK, NULL,
3150 list_data->chk_items
3151 [index].item_name, NULL,
3152 setting_done_list_Gendial_chk_btn_cb);
3153 if (list_data->chk_items[index].data_GenItem) {
3154 list_data->chk_items[index].data_GenItem->userdata = list_data;
3156 SETTING_TRACE_ERROR("list_data->chk_items[index].data_GenItem is NULL");
3165 * The API to create done-list-with-image
3167 * @param[in] list_data
3168 * @return a done-list-with-image
3171 Evas_Object *setting_create_done_list_with_image(Setting_Done_List_Data *list_data, const char *title)
3173 SETTING_TRACE_BEGIN;
3174 retvm_if(list_data == NULL, NULL, "list_data == NULL");
3175 setting_create_Gendial_itc("1text.2icon.4", &(list_data->itc_1text_2icon));
3177 elm_object_item_part_text_set(list_data->navi_it, "elm.text.title", title);
3179 /*elm_object_item_part_text_set(list_data->navi_it, "elm.text.title", _(KeyStr_Select_Item)); */
3180 memset((char *)(list_data->navi_title), 0, sizeof(list_data->navi_title));
3181 safeCopyStr((char *)(list_data->navi_title), elm_object_item_part_text_get(list_data->navi_it, "elm.text.title"), sizeof(list_data->navi_title));
3182 SETTING_TRACE("list_data->navi_title:%s", list_data->navi_title);
3184 Evas_Object *allbtn = elm_button_add(list_data->win_main);
3185 elm_object_style_set(allbtn, "naviframe/title_icon");
3186 Evas_Object *icon = elm_icon_add(allbtn);
3187 elm_image_file_set(icon, SETTING_ICON_PATH_CFG"select_all.png", NULL);
3189 /*evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1 , 1); */
3190 /*elm_image_resizable_set(icon, EINA_TRUE, EINA_TRUE); */
3191 elm_object_content_set(allbtn, icon);
3192 elm_object_focus_allow_set(allbtn, EINA_FALSE);
3193 evas_object_propagate_events_set(allbtn, EINA_FALSE);
3194 evas_object_smart_callback_add(allbtn, "clicked", __setting_select_all_layout_mouse_up_cb, list_data);
3195 evas_object_smart_callback_add(allbtn, "pressed", setting_callback_select_all_button_pressed_cb, icon);
3196 evas_object_smart_callback_add(allbtn, "unpressed", setting_callback_select_all_button_unpressed_cb, icon);
3198 evas_object_show(allbtn);
3199 elm_object_item_part_content_set(list_data->navi_it, "title_right_btn", allbtn);
3201 Evas_Object *scroller = elm_genlist_add(list_data->win_main);
3202 retvm_if(scroller == NULL, NULL, "scroller == NULL");
3203 //elm_genlist_realization_mode_set(scroller, EINA_TRUE);
3204 elm_genlist_clear(scroller); /* first to clear list */
3205 evas_object_smart_callback_add(scroller, "realized", __gl_realized_cb, NULL);
3208 for (; index < list_data->cur_item_num; index++) {
3209 list_data->chk_items[index].data_GenItem =
3210 setting_create_Gendial_field_def(scroller,
3211 &(list_data->itc_1text_2icon),
3212 setting_done_list_Gendial_mouse_up_cb,
3214 SWALLOW_Type_1CHECK, NULL,
3215 list_data->allow_items[index].thumb_path, 0,
3216 list_data->chk_items
3217 [index].item_name, NULL,
3218 setting_done_list_Gendial_chk_btn_cb);
3219 if (list_data->chk_items[index].data_GenItem) {
3220 list_data->chk_items[index].data_GenItem->userdata = list_data;
3222 SETTING_TRACE_ERROR("list_data->chk_items[index].data_GenItem is NULL");
3230 * To disable a specialized genlist item
3235 void setting_disable_genlist_item(Elm_Object_Item *item)
3238 elm_object_item_disabled_set(item, EINA_TRUE); /* make it be dim displayed */
3239 /*elm_genlist_item_update(item); */
3244 * To enable a specialized genlist item
3249 void setting_enable_genlist_item(Elm_Object_Item *item)
3252 elm_object_item_disabled_set(item, EINA_FALSE); /* make it be normally displayed */
3253 /*elm_genlist_item_update(item); */
3258 void setting_genlist_item_disabled_set(Setting_GenGroupItem_Data *item_data, int disable)
3260 if (item_data && item_data->item) {
3261 elm_object_item_disabled_set(item_data->item, disable); /* make it be dim displayed */
3264 EXPORT_PUBLIC void setting_genlist_unregister_tts_access_highlight(Evas_Object *obj, const char *itc)
3266 setting_retm_if(!obj, "obj is NULL");
3267 if (!itc || (itc && 0 != safeStrCmp(itc, "dialogue/1text.2icon.divider")
3268 && 0 != safeStrCmp(itc, "dialogue/1text.1icon.divider")
3269 && 0 != safeStrCmp(itc, "dialogue/setting.1text.2icon.4.divider.tb")
3270 && 0 != safeStrCmp(itc, "dialogue/setting.1text.2icon.divider")
3271 && 0 != safeStrCmp(itc, "dialogue/newset.1text.2icon.divider"))) {
3273 /*SETTING_TRACE("check/radio highlight is unregistered"); */
3274 elm_access_object_unregister(obj);
3280 void __add_gl_tts_feature(Elm_Object_Item *item)
3282 /*SETTING_TRACE_BEGIN; */
3284 const Elm_Genlist_Item_Class *itc = elm_genlist_item_item_class_get(item);
3286 /*SETTING_TRACE("itc->item_style:%s", itc->item_style); */
3287 if (0 == safeStrCmp(itc->item_style, "dialogue/separator")) {
3288 elm_object_item_access_unregister(item);
3292 /*all items which may have text to read */
3293 Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *)elm_object_item_data_get(item);
3295 if (isSpaceStr(list_item->keyStr)) {
3296 elm_object_item_access_unregister(item);
3300 if (!safeStrCmp(itc->item_style, "1icon/with_no_line")
3301 && list_item->swallow_type == SWALLOW_Type_1BUTTON) {
3302 elm_object_item_access_unregister(item);
3306 char lable[MAX_SPECIALIZITION_LEN] = {0,};
3307 char state[MAX_SPECIALIZITION_LEN] = {0,};
3308 char guide[MAX_SPECIALIZITION_LEN] = {0,};
3313 /*SETTING_TRACE("list_item->keyStr:%s", _(list_item->keyStr)); */
3314 if (list_item->swallow_type == SWALLOW_Type_1TOGGLE
3315 || list_item->swallow_type == SWALLOW_Type_1ICON_1RADIO
3316 || list_item->swallow_type == SWALLOW_Type_1RADIO
3317 || list_item->swallow_type == SWALLOW_Type_1CHECK
3318 || list_item->swallow_type == SWALLOW_Type_1RADIO_1LABLE
3319 || list_item->swallow_type == SWALLOW_Type_1ICON_1DOTTOOGLE) {
3320 /*unregister_access_highlight(list_item); */
3323 switch (list_item->swallow_type) {
3324 case SWALLOW_Type_1TOGGLE:
3325 case SWALLOW_Type_1ICON_1RADIO: {
3326 /*SETTING_TRACE("case SWALLOW_Type_1TOGGLE or SWALLOW_Type_1ICON_1RADIO"); */
3327 /*"dialogue/1text.2icon.divider".keystr current is on/off,switch the switcher to chaneg it,click the item for detail settings" */
3328 /*not:keystr current is on/off,switch the switcher or click the item to chaneg it. */
3329 g_strlcat(lable, _(list_item->keyStr), MAX_SPECIALIZITION_LEN);
3330 snprintf(state, sizeof(state),
3331 _("IDS_ST_BODY_P1SS_IS_CURRENTLY_P2SS_T_TTS"),
3332 _(list_item->keyStr), list_item->chk_status ? _("IDS_ST_BODY_ON_M_STATUS") : _("IDS_ST_BODY_ALERTTYPE_OFF"));
3334 if (0 == safeStrCmp(itc->item_style, "dialogue/1text.2icon.divider")
3335 || 0 == safeStrCmp(itc->item_style, "dialogue/1text.1icon.divider")) {
3336 /*g_strlcat(guide, _("Tap switcher to change it, or double tap the item for detail settings"), MAX_SPECIALIZITION_LEN); */
3337 g_strlcat(guide, _("IDS_ST_BODY_TOGGLE_THE_BUTTON_TO_ENABLE_OR_DISABLE_SCREEN_READER_OR_DOUBLE_TAP_TO_OPEN_THE_MENU_T_TTS"), MAX_SPECIALIZITION_LEN);
3339 /*g_strlcat(guide, _("Tap item or switcher to chaneg it."), MAX_SPECIALIZITION_LEN); */
3340 g_strlcat(guide, _("IDS_ST_BODY_DOUBLE_TAP_TO_EDIT_THIS_FIELD_T_TTS"), MAX_SPECIALIZITION_LEN);
3344 case SWALLOW_Type_1CHECK:
3345 case SWALLOW_Type_1RADIO:
3346 case SWALLOW_Type_1RADIO_1LABLE: {
3347 /*SETTING_TRACE("case SWALLOW_Type_1CHECK or SWALLOW_Type_1RADIO or SWALLOW_Type_1RADIO_1LABLE"); */
3348 /*keystr, click to select it */
3349 g_strlcat(lable, _(list_item->keyStr), MAX_SPECIALIZITION_LEN);
3350 /*g_strlcat(guide, _("Double tap it to select"), MAX_SPECIALIZITION_LEN); */
3351 g_strlcat(guide, _("IDS_ST_BODY_DOUBLE_TAP_TO_EDIT_THIS_FIELD_T_TTS"), MAX_SPECIALIZITION_LEN);
3354 case SWALLOW_Type_1ICON_1PROCESS: {
3355 /*SETTING_TRACE("case SWALLOW_Type_1ICON_1PROCESS"); */
3356 /*keystr,its setting is in processing */
3357 g_strlcat(lable, _(list_item->keyStr), MAX_SPECIALIZITION_LEN);
3358 g_strlcat(guide, _("IDS_ST_BODY_YOUR_CHANGES_ARE_BEING_MADE_T_TTS"), MAX_SPECIALIZITION_LEN);
3361 case SWALLOW_Type_LAYOUT_ENTRY:
3362 case SWALLOW_Type_LAYOUT_EDITFIELD: {
3363 /*SETTING_TRACE("case SWALLOW_Type_LAYOUT_ENTRY"); */
3364 /*keystr is substr,to tap and modify it if you want */
3365 g_strlcat(lable, _(list_item->keyStr), MAX_SPECIALIZITION_LEN);
3366 snprintf(state, sizeof(state), _("IDS_ST_BODY_P1SS_IS_CURRENTLY_P2SS_T_TTS"), _(list_item->keyStr), list_item->sub_desc);
3367 g_strlcat(guide, _("IDS_ST_BODY_DOUBLE_TAP_TO_EDIT_THIS_FIELD_T_TTS"), MAX_SPECIALIZITION_LEN);
3370 case SWALLOW_Type_LAYOUT_DATEFIELD: {
3373 /*SETTING_TRACE("case SWALLOW_Type_LAYOUT_DATEFIELD"); */
3376 case SWALLOW_Type_INVALID:
3377 case SWALLOW_Type_1ICON_1DOTTOOGLE: {
3378 /*SETTING_TRACE("case SWALLOW_Type_INVALID"); */
3379 g_strlcat(lable, _(list_item->keyStr), MAX_SPECIALIZITION_LEN);
3380 /*SETTING_TRACE("list_item->sub_desc:%s", list_item->sub_desc); */
3381 if (list_item->sub_desc) {
3382 snprintf(state, sizeof(state), _("IDS_ST_BODY_P1SS_IS_CURRENTLY_P2SS_T_TTS"), _(list_item->keyStr), _(list_item->sub_desc));
3384 /*SETTING_TRACE("state:%s", state); */
3386 if (0 != safeStrCmp(itc->item_style, "dialogue/multiline/2text")
3387 && 0 != safeStrCmp(itc->item_style, "dialogue/2text.1icon.3")) {
3388 if (0 == safeStrCmp(itc->item_style, "dialogue/2text.3/expandable")) {
3389 g_strlcat(guide, _("IDS_ST_BODY_DOUBLE_TAP_TO_OPEN_THE_MENU_T_TTS"), MAX_SPECIALIZITION_LEN);
3391 g_strlcat(guide, _(TTS_CONTENT_MENU_CLICK_INFO), MAX_SPECIALIZITION_LEN);
3393 /*SETTING_TRACE("guild:%s", guide); */
3396 /*read the KEYSTR directly */
3397 case SWALLOW_Type_1TEXT_1IMAGE: {
3398 g_strlcat(lable, _(list_item->keyStr), MAX_SPECIALIZITION_LEN);
3401 case SWALLOW_Type_LAYOUT_SPECIALIZTION:
3402 default: { /*skip them */
3407 /*SETTING_TRACE("speciliztion:%s", speciliztion); */
3408 Evas_Object *eo = elm_object_item_access_object_get(item);
3409 /*setting_set_tts_info(eo, speciliztion, " ", NULL, TTS_CONTENT_MENU_CLICK_INFO); */
3410 setting_set_tts_info(eo, lable, " ", isEmptyStr(state) ? NULL : state, isEmptyStr(guide) ? NULL : guide);
3415 void setting_check_genlist_item_bottom_line(Elm_Object_Item *item)
3417 /*SETTING_TRACE_BEGIN; */
3419 const Elm_Genlist_Item_Class *itc = elm_genlist_item_item_class_get(item);
3420 if (itc && itc->item_style) {
3421 /*SETTING_TRACE("itc->item_style:%s", itc->item_style); */
3422 if (0 == safeStrCmp(itc->item_style, "groupindex")
3423 || 0 == safeStrNCmp(itc->item_style, "dialogue/separator", safeStrLen("dialogue/separator"))
3424 || 0 == safeStrNCmp(itc->item_style, "bottom_line", safeStrLen("bottom_line"))
3425 || 0 == safeStrNCmp(itc->item_style, "multiline_sub", safeStrLen("multiline_sub"))
3426 || 0 == safeStrNCmp(itc->item_style, "1icon", safeStrLen("1icon"))
3428 if (0 == safeStrCmp(itc->item_style, "groupindex")) {
3429 Elm_Object_Item *prev_item = elm_genlist_item_prev_get(item);
3431 const Elm_Genlist_Item_Class *itc2 = elm_genlist_item_item_class_get(prev_item);
3432 if (itc2 && !safeStrCmp(itc2->item_style, "bottom_line")) {
3433 elm_object_item_del(prev_item);
3440 /*SETTING_TRACE("Adding[prev_item:%p, next_item:%p].....", prev_item, next_item); */
3441 Evas_Object *scroller = elm_object_item_widget_get(item);
3442 Elm_Object_Item *parent = elm_genlist_item_parent_get(item);
3443 /*SETTING_TRACE("parent:%p", parent); */
3444 if (parent) { /*expandable */
3445 Elm_Object_Item *it = elm_genlist_item_insert_before(scroller, &(itc_bottom_line), NULL, parent,
3446 item, ELM_GENLIST_ITEM_NONE, NULL, NULL);
3447 elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
3448 //Evas_Object *real_obj = elm_object_item_edje_get(item);
3449 //setting_decorate_image_RGBA(real_obj, 0, 0, 85, 255);
3457 void __gl_realized_cb(void *data, Evas_Object *obj, void *event_info)
3459 /*SETTING_TRACE_BEGIN; */
3460 setting_retm_if(event_info == NULL, "invalid parameter: event_info is NULL");
3461 Elm_Object_Item *item = (Elm_Object_Item *)event_info;
3462 Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *)elm_object_item_data_get(item);
3464 __add_gl_tts_feature(item);
3466 setting_check_genlist_item_bottom_line(item);
3469 /*SETTING_TRACE("%s:%d", _(list_item->keyStr), list_item->group_style); */
3470 if (list_item->group_style == SETTING_GROUP_STYLE_TOP) {
3471 elm_object_item_signal_emit(item, "elm,state,top", "");
3472 } else if (list_item->group_style == SETTING_GROUP_STYLE_BOTTOM) {
3473 elm_object_item_signal_emit(item, "elm,state,bottom", "");
3474 } else if (list_item->group_style == SETTING_GROUP_STYLE_CENTER) {
3475 elm_object_item_signal_emit(item, "elm,state,center", "");
3477 elm_object_item_signal_emit(item, "elm,state,normal", "");
3480 /* item is used for description */
3481 elm_object_item_signal_emit(item, "elm,state,center", "");
3485 EXPORT_PUBLIC void setting_genlist_item_groupstyle_set(Setting_GenGroupItem_Data *list_item, setting_group_style group_style)
3488 list_item->group_style = group_style;
3489 /*SETTING_TRACE("list_item->group_style:%d", list_item->group_style); */
3490 if (list_item->item) {
3491 /*SETTING_TRACE("%s:%d", _(list_item->keyStr), list_item->group_style); */
3492 if (list_item->group_style == SETTING_GROUP_STYLE_TOP) {
3493 elm_object_item_signal_emit(list_item->item, "elm,state,top", "");
3494 } else if (list_item->group_style == SETTING_GROUP_STYLE_BOTTOM) {
3495 elm_object_item_signal_emit(list_item->item, "elm,state,bottom", "");
3496 } else if (list_item->group_style == SETTING_GROUP_STYLE_CENTER) {
3497 elm_object_item_signal_emit(list_item->item, "elm,state,center", "");
3499 elm_object_item_signal_emit(list_item->item, "elm,state,normal", "");
3505 /*for check,radio,slider etc.. */
3506 EXPORT_PUBLIC void setting_update_gl_item_chk_status(Setting_GenGroupItem_Data *item_data, int status)
3508 if (item_data && item_data->chk_status != status) {
3509 item_data->chk_status = status;
3510 if (item_data->item) {
3511 /*SETTING_TRACE_DEBUG("update item %d", item_data->chk_status); */
3512 elm_genlist_item_fields_update(item_data->item, "*", ELM_GENLIST_ITEM_FIELD_CONTENT);
3517 /*do not check current status, only update the icon.2 of item which has 2 icons. */
3518 EXPORT_PUBLIC void setting_force_update_gl_item_chk_status(Setting_GenGroupItem_Data *item_data, int status)
3521 item_data->chk_status = status;
3522 if (item_data->item) {
3523 /*SETTING_TRACE_DEBUG("update item %s : %d", item_data->keyStr, item_data->chk_status); */
3524 elm_genlist_item_fields_update(item_data->item, "elm.icon.2", ELM_GENLIST_ITEM_FIELD_CONTENT);