2bd29dad48b2a4cbf3a1cbfe7efd365f4349b9f8
[apps/core/preloaded/settings.git] / setting-common / src / setting-common-draw-genlist.c
1 /*
2  * setting
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
5  *
6  * Contact: MyoungJune Park <mj2004.park@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 #include <setting-common-draw-widget.h>
22 #include <glib.h>
23 #include <utilX.h>
24 #include <Ecore_X.h>
25 #include <system_settings.h>
26
27 static Evas_Object *_gl_Gendial_content_get(void *data, Evas_Object *obj, const char *part);
28 static char *_gl_Gendial_text_get(void *data, Evas_Object *obj, const char *part);
29 static void _gl_Gendial_del(void *data, Evas_Object *obj);
30 const Elm_Genlist_Item_Class itc_seperator = {
31         .item_style = "dialogue/separator/21/with_line",
32         .func.text_get = NULL,
33         .func.content_get = NULL,
34         .func.state_get = NULL,
35         .func.del = NULL,
36 };
37
38 const Elm_Genlist_Item_Class itc_bottom_seperator = {
39         .item_style = "dialogue/separator/20",
40         .func.text_get = NULL,
41         .func.content_get = NULL,
42         .func.state_get = NULL,
43         .func.del = NULL,
44 };
45
46 const Elm_Genlist_Item_Class itc_sep_line = {
47         .item_style = "dialogue/separator/1/with_line",
48         .func.text_get = _gl_Gendial_text_get,
49         .func.content_get = NULL,
50         .func.state_get = NULL,
51         .func.del = NULL,
52 };
53
54 #define DEFINE_ITC1(style, name) \
55 const Elm_Genlist_Item_Class name = {\
56         .item_style = style,\
57         .func.text_get = _gl_Gendial_text_get,\
58         .func.content_get = _gl_Gendial_content_get,\
59         .func.state_get = NULL,\
60         .func.del = _gl_Gendial_del,\
61 };
62
63 DEFINE_ITC1("dialogue/1text", itc_1text);
64 DEFINE_ITC1("dialogue/1text.1icon.2", itc_1text_1icon_2);
65
66 DEFINE_ITC1("dialogue/1icon", itc_1icon);
67 DEFINE_ITC1("dialogue/1text.1icon/expandable2", itc_1icon_1text_sub);
68 DEFINE_ITC1("dialogue/1text.1icon", itc_1text_1icon);
69 DEFINE_ITC1("dialogue/1text.2icon", itc_1text_2icon);
70 DEFINE_ITC1("dialogue/1text.2icon.2", itc_1text_2icon_2);
71
72 DEFINE_ITC1("dialogue/2text.2", itc_2text_2);
73 DEFINE_ITC1("dialogue/2text", itc_2text);
74 DEFINE_ITC1("multiline/2text.1icon", itc_multiline_2text_1icon);
75 DEFINE_ITC1("dialogue/2text.1icon.3", itc_2text_1icon_3);
76 DEFINE_ITC1("dialogue/2text.1icon.6", itc_2text_1icon_6);
77 DEFINE_ITC1("dialogue/2text.1icon.7", itc_2text_1icon_7);
78
79 DEFINE_ITC1("dialogue/2text.3/expandable", itc_2text_3_parent);
80 DEFINE_ITC1("dialogue/2text.3", itc_2text_3);
81 DEFINE_ITC1("dialogue/2text.2icon.3", itc_2text_2icon_3);
82
83 DEFINE_ITC1("multiline/1text", itc_multiline_text);
84 DEFINE_ITC1("1text.1icon.2", itc_cm_1text_1icon_2);
85 DEFINE_ITC1("select_all", itc_sel_all);
86 DEFINE_ITC1("dialogue/bg/1icon", itc_bg_1icon);
87 DEFINE_ITC1("dialogue/title", itc_group_item);
88
89 /**
90  * Do process when clicking on a common genlist item
91  */
92 void setting_mouse_up_Gendial_list_radio_cb(void *data, Evas_Object *obj,
93                                             void *event_info)
94 {
95         /* error check */
96         retm_if(event_info == NULL, "Invalid argument: event info is NULL");
97         Elm_Object_Item *item = (Elm_Object_Item *) event_info;
98         elm_genlist_item_selected_set(item, 0);
99         Setting_GenGroupItem_Data *list_item =
100             (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
101
102         setting_retm_if(data == NULL, "Data parameter is NULL");
103         Evas_Object *radio = data;
104         elm_radio_value_set(radio, list_item->chk_status);
105 }
106
107 static void __radio_changed(void *data, Evas_Object *obj, void *event_info)
108 {
109         retm_if(data == NULL, "Data parameter is NULL");
110         Setting_GenGroupItem_Data *list_item =
111             (Setting_GenGroupItem_Data *) data;
112         list_item->chk_status = elm_radio_value_get(obj);       /*  for update */
113 }
114
115 static void __entry_changed(void *data, Evas_Object *obj, void *event_info)
116 {
117         retm_if(data == NULL, "Data parameter is NULL");
118         SETTING_TRACE_BEGIN;
119         Setting_GenGroupItem_Data *list_item =
120             (Setting_GenGroupItem_Data *) data;
121         list_item->sub_desc = (char *)g_strdup(elm_entry_entry_get(obj));
122         Evas_Object *entry_container = elm_object_parent_widget_get(obj);
123         if (entry_container)
124         {
125                 if (elm_entry_is_empty(obj))
126                 {
127                         elm_object_signal_emit(entry_container, "elm,state,guidetext,show", "elm");
128                         elm_object_signal_emit(entry_container, "elm,state,eraser,hide", "elm");
129                 }
130                 else
131                 {
132                         elm_object_signal_emit(entry_container, "elm,state,guidetext,hide", "elm");
133                         if (elm_object_focus_get(obj)) //only do when entry is focused
134                         {
135                                 elm_object_signal_emit(entry_container, "elm,state,eraser,show", "elm");
136                         }
137                 }
138         }
139 }
140
141 static void __entry_unfocused(void *data, Evas_Object *obj, void *event_info) // Unfocused callback will show guidetext and hide X marked button.
142 {
143         ret_if(!data);
144         SETTING_TRACE_BEGIN;
145         Evas_Object *entry_container = data;
146         //whe entry unfocused, its guidetext will becomes "Input here"
147         elm_object_part_text_set(entry_container, "elm.guidetext", _("IDS_ST_BODY_TAP_TO_INSERT"));
148         if (elm_entry_is_empty(obj))
149                 elm_object_signal_emit(entry_container, "elm,state,guidetext,show", "elm");
150         elm_object_signal_emit(entry_container, "elm,state,eraser,hide", "elm");
151 }
152 static void __entry_focused(void *data, Evas_Object *obj, void *event_info) // Focused callback will show X marked button and hide guidetext.
153 {
154         ret_if(!data);
155         SETTING_TRACE_BEGIN;
156         Evas_Object *entry_container = data;
157         //whe entry focused, its guidetext will becomes "Input here"
158         elm_object_part_text_set(entry_container, "elm.guidetext", _("IDS_ST_BODY_TAP_TO_INSERT"));
159         if (!elm_entry_is_empty(obj))
160                 elm_object_signal_emit(entry_container, "elm,state,eraser,show", "elm");
161         elm_object_signal_emit(entry_container, "elm,state,guidetext,hide", "elm");
162
163         Ecore_IMF_Context *imf_context = (Ecore_IMF_Context *)elm_entry_imf_context_get(obj);
164         if (imf_context) ecore_imf_context_input_panel_show(imf_context);
165 }
166 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.
167 {
168         ret_if(!data);
169         Evas_Object *entry = data;
170         elm_entry_entry_set(entry, "");
171         elm_object_focus_set(entry, EINA_TRUE);
172 }
173
174 static void __chk_changed(void *data, Evas_Object *obj, void *event_info)
175 {
176         retm_if(data == NULL, "Data parameter is NULL");
177         Setting_GenGroupItem_Data *list_item =
178             (Setting_GenGroupItem_Data *) data;
179         list_item->chk_status = elm_check_state_get(obj);       /*  for update */
180 }
181
182 static void __error_popup_response_cb(void *data, Evas_Object *obj,
183                                      void *event_info)
184 {
185         SETTING_TRACE_BEGIN;
186         retm_if(data == NULL, "Data parameter is NULL");
187         Setting_GenGroupItem_Data *list_item = data;
188         if (list_item->notify) {
189                 evas_object_del(list_item->notify);
190                 list_item->notify = NULL;
191         }
192 }
193
194 static void __max_len_reached(void *data, Evas_Object *obj, void *event_info)
195 {
196         SETTING_TRACE_BEGIN;
197         retm_if(data == NULL, "Data parameter is NULL");
198         retm_if(!elm_object_focus_get(obj), "Entry is not focused");//notify only when entry is being focused on.
199
200         Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
201         if (!list_item->notify)
202         {
203                 list_item->notify = setting_create_popup_without_btn(list_item, list_item->win_main,
204                                                          NULL, _(EXCEED_LIMITATION_STR),
205                                                          __error_popup_response_cb,
206                                                          POPUP_INTERVAL, FALSE, FALSE);
207                 elm_object_focus_set(list_item->eo_check, EINA_FALSE);
208         } else {
209                 //postpone 2 seconds again
210                 elm_popup_timeout_set(list_item->notify, POPUP_INTERVAL);
211         }
212
213 }
214
215 static void __entry_keydown(void *data, Evas *e, Evas_Object *obj, void *event_info)
216 {
217         retm_if(data == NULL, "Data parameter is NULL");
218         retm_if(event_info == NULL, "event_info is NULL");
219         Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
220         Evas_Event_Key_Down *ev = (Evas_Event_Key_Down *)event_info;
221         if(safeStrCmp(ev->key, "KP_Enter") == 0 //it is for Japanese keyboard to fix N_SE-10719
222            || safeStrCmp(ev->key, "Return") == 0) //to disable the 'Enter' orginal function
223         {
224                 SETTING_TRACE("ENTER %s ev->key:%s", __FUNCTION__, ev->key);
225                 list_item->enterKeyPressFlag = true;
226                 //hide the eraser button
227                 //format like:xx<br/>
228                 const char *entry_str = remove_first_substring(elm_entry_entry_get(obj), "<br/>");
229                 elm_entry_entry_set(obj, entry_str);
230                 FREE(entry_str);
231                 elm_entry_cursor_end_set(obj);
232                 setting_hide_input_pannel_cb(obj);
233         } else {
234                 list_item->enterKeyPressFlag = false;
235                 Evas_Object *entry_container = elm_object_parent_widget_get(obj);
236                 if(safeStrLen(elm_entry_entry_get(obj)) > 0) {
237                         elm_object_signal_emit(entry_container, "elm,state,guidetext,hide", "elm");
238                 } else {
239                         elm_object_signal_emit(entry_container, "elm,state,guidetext,show", "elm");
240                 }
241         }
242
243 }
244
245 /**
246  * Do process when clicking radio in subitem of expandable item
247  */
248 void setting_sub_list_rd_change(void *data, Evas_Object *obj, void *event_info)
249 {
250         SETTING_TRACE_BEGIN;
251         retm_if(data == NULL, "Data parameter is NULL");
252         Setting_GenGroupItem_Data *list_item =
253             (Setting_GenGroupItem_Data *) data;
254         list_item->chk_status = elm_radio_value_get(obj);       /*  for update */
255
256         Elm_Object_Item *subItem = list_item->item;
257         Elm_Object_Item *parentItem = elm_genlist_item_parent_get(subItem);
258
259         Setting_GenGroupItem_Data *data_subItem = elm_object_item_data_get(subItem);    /* subItem data */
260         Setting_GenGroupItem_Data *data_parentItem = elm_object_item_data_get(parentItem);      /* parent data */
261
262         ret_if(NULL == data_subItem || NULL == data_parentItem);
263         int err;
264         setting_set_int_slp_key(data_parentItem->int_slp_setting_binded,
265                                 list_item->chk_status, &err);
266         ret_if(0 != err);
267         data_parentItem->sub_desc = (char *)g_strdup(_(data_subItem->keyStr));
268         elm_object_item_data_set(data_parentItem->item, data_parentItem);
269         elm_genlist_item_update(data_parentItem->item);
270 }
271
272 /**
273  * Do process when clicking on subitem of expandable item
274  */
275 void setting_sub_list_sel_cb(void *data, Evas_Object *obj, void *event_info)
276 {
277         SETTING_TRACE_BEGIN;
278         /* error check */
279         retm_if(event_info == NULL, "Invalid argument: event info is NULL");
280         Elm_Object_Item *subitem = (Elm_Object_Item *) event_info;
281         Elm_Object_Item *parentItem = elm_genlist_item_parent_get(subitem);
282         elm_genlist_item_selected_set(subitem, 0);
283         Setting_GenGroupItem_Data *data_subItem =
284             elm_object_item_data_get(subitem);
285         Setting_GenGroupItem_Data *data_parentItem = elm_object_item_data_get(parentItem);      /* parent data */
286         ret_if(NULL == data_subItem || NULL == data_parentItem);
287
288         elm_radio_value_set(data_subItem->rgd, data_subItem->chk_status);
289         int err;
290         setting_set_int_slp_key(data_parentItem->int_slp_setting_binded,
291                                 data_subItem->chk_status, &err);
292         setting_retm_if(0 != err, "Set vconf error[%d]",data_parentItem->int_slp_setting_binded);
293
294         data_parentItem->sub_desc = (char *)g_strdup(_(data_subItem->keyStr));
295         elm_object_item_data_set(data_parentItem->item, data_parentItem);
296         elm_genlist_item_update(data_parentItem->item);
297 }
298
299 static void __exp_list_smart_cb(void *data, Evas_Object *obj, void *event_info)
300 {
301         ret_if(data == NULL || event_info == NULL);
302         Elm_Object_Item *item = (Elm_Object_Item *) event_info;
303         char *cb_type = data;
304
305         if (0 == safeStrCmp(cb_type, "drag")
306             || 0 == safeStrCmp(cb_type, "longpressed")) {
307                 //Evas_Object *base_view = (Evas_Object *) elm_genlist_item_object_get(item);
308                 //edje_object_signal_emit(base_view, "mouse,out", "touch_arrow");
309         } else if (0 == safeStrCmp(cb_type, "contracted")) {
310                 elm_genlist_item_subitems_clear(item);
311         }
312 }
313
314 static void _gl_Gendial_sel(void *data, Evas_Object *obj, void *event_info)
315 {
316         /* SETTING_TRACE_BEGIN; */
317         retm_if(event_info == NULL, "Invalid argument: event info is NULL");
318         Elm_Object_Item *item = (Elm_Object_Item *) event_info;
319         elm_genlist_item_selected_set(item, 0);
320 }
321
322 static void _gl_Gendial_sel_expand(void *data, Evas_Object *obj,
323                                    void *event_info)
324 {
325         /* SETTING_TRACE_BEGIN; */
326         retm_if(event_info == NULL, "Invalid argument: event info is NULL");
327         Elm_Object_Item *item = (Elm_Object_Item *) event_info;
328         elm_genlist_item_selected_set(item, 0);
329         bool status = !elm_genlist_item_expanded_get(item);
330         elm_genlist_item_expanded_set(item, status);
331 }
332
333 static char *_gl_Gendial_text_get(void *data, Evas_Object *obj,
334                                    const char *part)
335 {
336         /* SETTING_TRACE_BEGIN; */
337         Setting_GenGroupItem_Data *item_data =
338             (Setting_GenGroupItem_Data *) data;
339         /* SETTING_TRACE("part:%s", part); */
340         if (SWALLOW_Type_LAYOUT_ENTRY == item_data->swallow_type) {     /* no need to create 'text' part */
341                 return NULL;
342         }
343
344         /* for font size view */
345         if (SWALLOW_Type_1RADIO_1LABLE == item_data->swallow_type) {
346                 char speciliztion[MAX_SPECIALIZITION_LEN] = {0,};
347                 int font_size = -1;
348                 SETTING_TRACE("item_data->chk_status:%d", item_data->chk_status);
349                 if (SYSTEM_SETTINGS_FONT_SIZE_SMALL == item_data->chk_status) {
350                         font_size = LABEL_FONT_SIZE_SMALL;
351                 } else if (SYSTEM_SETTINGS_FONT_SIZE_LARGE == item_data->chk_status) {
352                         font_size = LABEL_FONT_SIZE_LARGE;
353                 } else if (SYSTEM_SETTINGS_FONT_SIZE_HUGE == item_data->chk_status) {
354                         font_size = LABEL_FONT_SIZE_HUGE;
355                 } else if (SYSTEM_SETTINGS_FONT_SIZE_GIANT == item_data->chk_status) {
356                         font_size = LABEL_FONT_SIZE_GIANT;
357                 } else {
358                         font_size = LABEL_FONT_SIZE_NORMAL;
359                 }
360                 SETTING_TRACE("font_size:%d", font_size);
361                 snprintf(speciliztion, sizeof(speciliztion), "<font_size=%d>%s</font_size>",
362                         font_size, _(item_data->keyStr));
363                 return (char *)g_strdup(speciliztion);
364         }
365
366         if (!safeStrCmp(part, "elm.text") || !safeStrCmp(part, "elm.text.1")) { /* title */
367                 if (item_data->keyStr) {
368                         return (char *)g_strdup(_(item_data->keyStr));  /* use item_data->keyStr */
369                 }
370
371         } else if (!safeStrCmp(part, "elm.text.2")) {   /* bottom or right */
372                 if (item_data->sub_desc) {
373                         return (char *)g_strdup(item_data->sub_desc);
374                 }
375         }
376
377         return NULL;
378 }
379
380 static Evas_Object *__add_check(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
381 {
382         retv_if(!item_data || !parent, NULL);
383         Evas_Object *check = elm_check_add(parent);
384         elm_check_state_set(check, item_data->chk_status);
385         evas_object_show(check);
386         evas_object_pass_events_set(check, 1);
387         evas_object_propagate_events_set(check, 0);
388
389         item_data->eo_check = check;
390
391         if (item_data->chk_change_cb) {
392                 evas_object_smart_callback_add(check,"changed",item_data->chk_change_cb,item_data);
393         } else {
394                 evas_object_smart_callback_add(check,"changed", __chk_changed, item_data);
395         }
396         return check;
397 }
398 static Evas_Object *__add_check_icon(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
399 {
400         retv_if(!item_data || !parent, NULL);
401         Evas_Object *check = __add_check(item_data, parent);
402
403         Evas_Object *thumb = NULL;
404         if (item_data->r_swallow_path) {
405                 thumb = elm_icon_add(parent);
406                 elm_icon_file_set(thumb,
407                                   item_data->r_swallow_path,
408                                   NULL);
409                 evas_object_size_hint_aspect_set(thumb,
410                                                  EVAS_ASPECT_CONTROL_VERTICAL,
411                                                  1, 1);
412         }
413
414         Evas_Object *layout = elm_layout_add(parent);
415         elm_layout_file_set(layout, SETTING_THEME_EDJ_NAME,
416                             "thumbnail_icon2");
417         evas_object_size_hint_weight_set(layout,
418                                          EVAS_HINT_EXPAND,
419                                          EVAS_HINT_EXPAND);
420         elm_object_part_content_set(layout, "checkbox", check);
421         elm_object_part_content_set(layout, "thumbnail", thumb);
422         evas_object_show(layout);
423         return layout;
424 }
425 static Evas_Object *__add_toggle(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
426 {
427         retv_if(!item_data || !parent, NULL);
428         Evas_Object *check = __add_check(item_data, parent);
429         elm_object_style_set(check, "on&off");
430         return check;
431 }
432 static Evas_Object *__add_multiline_toggle(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
433 {
434         retv_if(!item_data || !parent, NULL);
435         Evas_Object *chk = __add_toggle(item_data, parent);
436         elm_object_style_set(chk, "on&off");
437         return chk;
438 }
439
440 static Evas_Object *__add_radio(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
441 {
442         retv_if(!item_data || !parent, NULL);
443         if (!item_data->rgd) {  /* exceptional handling */
444                 item_data->rgd = elm_radio_add(parent);
445                 elm_radio_state_value_set(item_data->rgd, -1);
446         }
447         Evas_Object *radio = elm_radio_add(parent);
448         elm_radio_state_value_set(radio,
449                                   item_data->chk_status);
450         elm_radio_group_add(radio, item_data->rgd);
451         evas_object_show(radio);
452         item_data->eo_check = radio;
453         if (item_data->chk_change_cb) {
454                 evas_object_smart_callback_add(radio,
455                                                "changed",
456                                                item_data->chk_change_cb,
457                                                item_data);
458         } else {
459                 evas_object_smart_callback_add(radio,
460                                                "changed",
461                                                __radio_changed,
462                                                item_data);
463         }
464         return radio;
465 }
466 static Evas_Object *__add_button(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
467 {
468         retv_if(!item_data || !parent, NULL);
469         Evas_Object *btn = elm_button_add(parent);
470         evas_object_show(btn);
471         if (item_data->r_swallow_path)
472         {
473                 elm_object_style_set(btn, item_data->r_swallow_path);
474         }
475         if (item_data->keyStr)
476         {
477                 elm_object_text_set(btn, _(item_data->keyStr));
478         }
479         evas_object_propagate_events_set(btn, EINA_FALSE);
480         if (item_data->chk_change_cb)
481                 evas_object_smart_callback_add(btn,
482                                                "clicked",
483                                                item_data->chk_change_cb,
484                                                item_data);
485         return btn;
486 }
487 static Evas_Object *__add_entry(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
488 {
489         retv_if(!item_data || !parent, NULL);
490         elm_genlist_mode_set(parent, ELM_LIST_COMPRESS);        /* resolve abnormal height issue */
491         Evas_Object *ed_name =
492             setting_create_editfiled(parent, _(item_data->keyStr),
493                                      item_data->sub_desc);
494         Evas_Object *entry = elm_object_part_content_get(ed_name, "elm.swallow.content");
495         item_data->eo_check = entry;
496         elm_entry_input_panel_layout_set(entry,
497                                          item_data->input_type);
498
499         if (item_data->isSinglelineFlag) {
500                 elm_entry_single_line_set(entry, EINA_TRUE);
501         }
502
503         if (item_data->isPasswordFlag) {
504                 elm_entry_single_line_set(entry, EINA_TRUE);
505                 elm_entry_password_set(entry, EINA_TRUE);
506         }
507
508         if (item_data->limit_filter_data) {
509                 elm_entry_markup_filter_append
510                     (entry,
511                      elm_entry_filter_limit_size,
512                      item_data->limit_filter_data);
513
514                 if (item_data->maxlength_reached_cb) {
515                         evas_object_smart_callback_add(entry,
516                                                       "maxlength,reached",
517                                                       item_data->maxlength_reached_cb,
518                                                       item_data);
519                 } else {
520                         evas_object_smart_callback_add(entry,
521                                                       "maxlength,reached",
522                                                       __max_len_reached,
523                                                       item_data);
524                 }
525         }
526         if (item_data->stop_change_cb) {//invoked when stop focusing on
527                 evas_object_smart_callback_add(entry,
528                                                       "unfocused",
529                                                       item_data->stop_change_cb,
530                                                       item_data);
531         }
532         else
533         {
534                 evas_object_smart_callback_add(entry,
535                                               "unfocused",
536                                               __entry_unfocused,
537                                               ed_name);
538         }
539         if (item_data->digits_filter_data) {
540                 elm_entry_markup_filter_append
541                     (entry,
542                      elm_entry_filter_accept_set,
543                      item_data->digits_filter_data);
544         }
545
546         /* for Setting App, All the entrys's context popup shouldn't be able */
547         /* to insert images, text is the only one can be inserted. */
548         elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT);
549
550         if (item_data->chk_change_cb) {
551                 evas_object_smart_callback_add
552                     (entry,
553                      "changed", item_data->chk_change_cb,
554                      item_data);
555         }
556         //default handle
557         evas_object_smart_callback_add(entry, "changed", __entry_changed, item_data);
558         evas_object_smart_callback_add(entry, "focused", __entry_focused, ed_name);
559         elm_object_signal_callback_add(ed_name, "elm,eraser,clicked", "elm", __eraser_clicked, entry);
560
561         if (item_data->start_change_cb) {
562                 evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN, (Evas_Object_Event_Cb)(item_data->start_change_cb), item_data->userdata);
563         }
564         evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN, __entry_keydown, item_data);
565
566         if (item_data->input_panel_disable_flag) {
567                 elm_entry_input_panel_enabled_set(entry, EINA_FALSE);
568         }
569         return ed_name;
570 }
571 static Evas_Object *__add_slider(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
572 {
573         retv_if(!item_data || !parent, NULL);
574         Evas_Object *li_slider =
575             setting_create_slider(parent, item_data->evas,
576                                   item_data->l_swallow_path,
577                                   item_data->r_swallow_path,
578                                   item_data->chk_status,
579                                   item_data->isIndicatorVisible,
580                                   item_data->slider_min,
581                                   item_data->slider_max,
582                                   item_data->chk_change_cb,
583                                   item_data->start_change_cb,
584                                   item_data->stop_change_cb,
585                                   item_data);
586         evas_object_pass_events_set(li_slider, 1);
587         evas_object_propagate_events_set(li_slider, 0);
588         item_data->eo_check = li_slider;
589         return li_slider;
590 }
591
592 static Evas_Object *__add_datefield(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
593 {
594         retv_if(!item_data || !parent, NULL);
595         /* **********create time/date field */
596         Evas_Object *datetimefield = item_data->eo_check = elm_datetime_add(parent);
597         evas_object_size_hint_weight_set(datetimefield, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
598         evas_object_size_hint_align_set(datetimefield, EVAS_HINT_FILL, 0.5);
599         evas_object_show(datetimefield);
600
601         char date_format[MAX_DATETIME_FORMAT_LEN + 1] = {0, };
602         const char *time_format = NULL;
603         if (item_data->chk_status)//12 hours
604         {
605                 time_format = "%I : %M %p";
606         } else { //24 hours
607                 time_format = "%H : %M";
608         }
609
610 #if SUPPORT_DATEFIELD_DATE_FORMAT_AUTOSET //Get date-format from datefiled itself, if elm_datetime_add() supports set date-format via ICU.
611         char *old_format = elm_datetime_format_get(datetimefield);
612         snprintf(date_format, MAX_DATE_FORMAT_LEN + 1, //add one space " "
613                  "%s", old_format);
614         safeStrNCat(date_format, time_format, MAX_DATETIME_FORMAT_LEN);
615         FREE(old_format);
616         SETTING_TRACE("datefield_format:%s", date_format);
617 #else
618         snprintf(date_format, MAX_DATETIME_FORMAT_LEN,
619                  "%s %s", item_data->sub_desc, time_format);
620 #endif
621         elm_datetime_format_set(datetimefield, date_format);
622
623         // min : 1970 1, 01, Thursday 00:00:00
624         // max : 2038 1, 19, Thursday 03:14:07
625         struct tm ts_ret;
626         memset(&ts_ret, 0, sizeof(struct tm));
627         ts_ret.tm_year = 138;
628         ts_ret.tm_mon = 1;
629         ts_ret.tm_mday = 19;
630         elm_datetime_value_max_set(datetimefield, &ts_ret);
631
632         ts_ret.tm_year = 70;
633         ts_ret.tm_mon = 0;
634         ts_ret.tm_mday = 1;
635         elm_datetime_value_min_set(datetimefield, &ts_ret);
636
637
638         time_t ctime = time(NULL);
639         //struct tm ts_ret;
640         struct tm *ts = localtime_r(&ctime, &ts_ret);
641         retv_if(!ts, NULL);
642
643         elm_datetime_value_set(datetimefield, &ts_ret);
644
645         if (item_data->chk_change_cb) {
646                 evas_object_smart_callback_add(datetimefield,
647                                                "changed",
648                                                item_data->chk_change_cb,
649                                                item_data);
650         }
651
652         if (item_data->isItemDisableFlag) {
653                 setting_disable_evas_object(datetimefield);
654         }
655         return datetimefield;
656 }
657 static Evas_Object *__add_radio_search(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
658 {
659         retv_if(!item_data || !parent, NULL);
660         Evas_Object *box = elm_box_add(parent);
661         elm_box_horizontal_set(box, 1);
662
663         //a.radio..
664         Evas_Object *radio = __add_radio(item_data, parent);
665         setting_disable_evas_object(radio);
666         elm_box_pack_end(box, radio);
667
668         //b.separator..
669         Evas_Object *separator =
670                 setting_create_blank_rect_customize(box,
671                                 SETTING_HALF_SCREEN_WIDTH,
672                                 SETTING_PADDING_HEIGHT);
673         elm_box_pack_end(box, separator);
674
675         //c.progressbar..
676         Evas_Object *progressbar = elm_progressbar_add(parent);
677         elm_object_style_set(progressbar, "list_process");
678         evas_object_size_hint_align_set(progressbar,
679                                         EVAS_HINT_FILL, 0.5);
680         evas_object_size_hint_weight_set(progressbar,
681                                          EVAS_HINT_EXPAND,
682                                          EVAS_HINT_EXPAND);
683         elm_progressbar_pulse(progressbar, EINA_TRUE);
684         evas_object_show(progressbar);
685         elm_box_pack_end(box, progressbar);
686
687         evas_object_show(box);
688         return box;
689 }
690 static Evas_Object *__add_search(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
691 {
692         retv_if(!item_data || !parent, NULL);
693         // added by JTS: CQ H0100135171
694         Evas_Object *box = elm_box_add(parent);
695         elm_box_horizontal_set(box, 1);
696
697         //b.separator..
698         Evas_Object *separator =
699                 setting_create_blank_rect_customize(box,
700                 SETTING_HALF_SCREEN_WIDTH, SETTING_PADDING_HEIGHT);
701         elm_box_pack_end(box, separator);
702
703         //c.progressbar..
704         Evas_Object *progressbar = elm_progressbar_add(parent);
705         elm_object_style_set(progressbar, "list_process");
706         evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.5);
707         evas_object_size_hint_weight_set(progressbar,
708                                         EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
709         elm_progressbar_pulse(progressbar, EINA_TRUE);
710         evas_object_show(progressbar);
711         elm_box_pack_end(box, progressbar);
712
713         evas_object_show(box);
714         return box;
715
716 }
717 static Evas_Object *__add_process(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
718 {
719         retv_if(!item_data || !parent, NULL);
720         Evas_Object *progressbar = elm_progressbar_add(parent);
721         elm_object_style_set(progressbar, "list_process");
722         evas_object_size_hint_align_set(progressbar,
723                                         EVAS_HINT_FILL, 0.5);
724         evas_object_size_hint_weight_set(progressbar,
725                                          EVAS_HINT_EXPAND,
726                                          EVAS_HINT_EXPAND);
727         elm_progressbar_pulse(progressbar, EINA_TRUE);
728         evas_object_show(progressbar);
729         return progressbar;
730 }
731
732 static Evas_Object *__add_radio_lable(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
733 {
734         retv_if(!item_data || !parent, NULL);
735
736         //a.radio..
737         Evas_Object *radio = __add_radio(item_data, parent);
738
739         return radio;
740 }
741
742 static Evas_Object *__add_left_default(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
743 {
744         retv_if(!item_data || !parent || !item_data->l_swallow_path, NULL);
745         Evas_Object *icon = elm_icon_add(parent);
746         elm_icon_file_set(icon, item_data->l_swallow_path,NULL);
747         evas_object_size_hint_aspect_set(icon,EVAS_ASPECT_CONTROL_VERTICAL,1, 1);
748         return icon;
749 }
750 static Evas_Object *__add_right_default(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
751 {
752         retv_if(!item_data || !parent || !item_data->r_swallow_path, NULL);
753         Evas_Object *icon = elm_icon_add(parent);
754         elm_icon_file_set(icon, item_data->r_swallow_path,NULL);
755         evas_object_size_hint_aspect_set(icon,EVAS_ASPECT_CONTROL_VERTICAL,1, 1);
756         return icon;
757 }
758
759 // draw handler
760 typedef Evas_Object * (*__drawer_fp)(Setting_GenGroupItem_Data *item_data, Evas_Object *parent);
761 typedef struct
762 {
763         SWALLOW_Type type;                      // ui type
764         __drawer_fp draw;
765 } __Content_Drawer;
766 static __Content_Drawer __cd_left[SWALLOW_Type_MAX] = {
767         //base objects
768         {SWALLOW_Type_1CHECK, __add_check},
769         {SWALLOW_Type_1TOGGLE, __add_toggle},
770         {SWALLOW_Type_1RADIO, __add_radio},
771         {SWALLOW_Type_1BUTTON, __add_button},
772
773         //base objects in an layout
774         {SWALLOW_Type_LAYOUT_ENTRY, __add_entry},
775         {SWALLOW_Type_LAYOUT_SLIDER, __add_slider},
776         {SWALLOW_Type_LAYOUT_DATEFIELD, __add_datefield},
777
778         //other compelx objects
779         {SWALLOW_Type_1SEARCH, __add_search},
780         {SWALLOW_Type_1PROCESS, __add_process},
781         {SWALLOW_Type_MULTILINE_1TOGGLE, __add_multiline_toggle},
782         {SWALLOW_Type_1CHECKICON, __add_check_icon},
783         {SWALLOW_Type_1RADIO_1SEARCH, __add_radio_search},
784         {SWALLOW_Type_1RADIO_1LABLE, __add_radio_lable},
785
786         //left part object of the type
787         {SWALLOW_Type_1ICON_1RADIO, __add_left_default},
788         {SWALLOW_Type_1RADIO_1PROCESS, __add_radio},
789 };
790 static __Content_Drawer __cd_right[SWALLOW_Type_MAX] = {
791         //right part object of the type
792         {SWALLOW_Type_1ICON_1RADIO, __add_toggle},
793         {SWALLOW_Type_1RADIO_1PROCESS, __add_process},
794 };
795
796 static __Content_Drawer __cd_end[SWALLOW_Type_MAX] = {
797         //end part object of the type
798         {SWALLOW_Type_1RADIO, __add_radio},
799 };
800 /*static __Part_Drawer __pd[__MAX_PART_NUM] = {
801         {"elm.icon", __cd_left},
802         {"elm.icon.1", __cd_left},
803         {"elm.icon.2", __cd_right},
804         {"elm.swallow.end", __cd_end},
805 };*/
806
807 static Evas_Object *_gl_Gendial_content_get(void *data, Evas_Object *obj,
808                                          const char *part)
809 {
810         retv_if(!data, NULL);
811         Setting_GenGroupItem_Data *item_data = data;
812         retv_if(!data, NULL);
813         __Content_Drawer *cd_list = NULL;
814         __drawer_fp fp = NULL;
815         if (!safeStrCmp(part, "elm.icon") || !safeStrCmp(part, "elm.icon.1"))
816         {
817                 fp = __add_left_default; //hold default drawer
818                 cd_list = __cd_left;
819         }
820         else if (!safeStrCmp(part, "elm.icon.2"))
821         {
822                 fp = __add_right_default; //hold default drawer
823                 cd_list = __cd_right;
824         }
825         else if (!safeStrCmp(part, "elm.swallow.end"))
826         {
827                 //the default value of fp is NULL here
828                 cd_list = __cd_end;
829         }
830         if (!cd_list) return NULL;//invalid part
831
832         int idx = 0;
833         for (; idx < SWALLOW_Type_MAX; idx++)
834         {
835                 if (item_data->swallow_type == cd_list[idx].type)//match using swallow type
836                 {
837                         fp = cd_list[idx].draw;
838                         break;
839                 }
840         }
841         return fp ? fp(item_data, obj) : NULL;
842 }
843
844 static void _gl_Gendial_del(void *data, Evas_Object *obj)
845 {
846         /* SETTING_TRACE_BEGIN; */
847         Setting_GenGroupItem_Data *item_data =
848             (Setting_GenGroupItem_Data *) data;
849         if (item_data) {
850                 G_FREE(item_data->keyStr);
851                 G_FREE(item_data->sub_desc);
852                 G_FREE((item_data->l_swallow_path));
853                 G_FREE((item_data->r_swallow_path));
854                 G_FREE(item_data->item_style);
855
856
857                 if (item_data->digits_filter_data)
858                 {
859                         G_FREE(item_data->digits_filter_data->accepted);
860                         G_FREE(item_data->digits_filter_data->rejected);
861                         FREE(item_data->digits_filter_data);
862
863                 }
864
865                 if (item_data->notify) {
866                         evas_object_del(item_data->notify);
867                         item_data->notify = NULL;
868                 }
869
870                 FREE(item_data->limit_filter_data);
871                 __BACK_POINTER_UNSET(item_data);
872                 FREE(item_data);
873         }
874         /* SETTING_TRACE_END; */
875 }
876
877 /**
878  * To intialize an Elm_Genlist_Item_Class, according to item style
879  *
880  * @param[in] item_style
881  * @param[in/out] itc
882  */
883 bool setting_create_Gendial_itc(const char *item_style,
884                                 Elm_Genlist_Item_Class *itc)
885 {
886         itc->item_style = item_style;
887         itc->func.text_get = _gl_Gendial_text_get;
888         itc->func.content_get = _gl_Gendial_content_get;
889         itc->func.state_get = NULL;
890         itc->func.del = _gl_Gendial_del;        /* _gl_Gendial_del; */
891         return TRUE;
892 }
893
894 /**
895  * Create group style item
896  *
897  * @return a pointer to Setting_GenGroupItem_Data
898  */
899 Setting_GenGroupItem_Data *setting_create_Gendial_field_group_titleItem(Evas_Object *genlist,
900                                                 const Elm_Genlist_Item_Class *itc,
901                                                 Elm_Object_Item *parent,
902                                                 Elm_Genlist_Item_Type flag,     /* ELM_GENLIST_ITEM_GROUP or ELM_GENLIST_ITEM_NONE */
903                                                 const char *keyStr,
904                                                 setting_call_back_func gl_sel)
905 {
906         /* SETTING_TRACE_BEGIN; */
907         Setting_GenGroupItem_Data *item_data =
908             (Setting_GenGroupItem_Data *) calloc(1,
909                                                  sizeof
910                                                  (Setting_GenGroupItem_Data));
911         setting_retvm_if(!item_data, NULL, "calloc failed");
912         item_data->keyStr = (char *)g_strdup(keyStr);
913         if (gl_sel) {
914                 item_data->item =
915                     elm_genlist_item_append(genlist, itc, item_data, parent,
916                                             flag, gl_sel, NULL);
917         } else {
918                 item_data->item =
919                     elm_genlist_item_append(genlist, itc, item_data, parent,
920                                             flag, _gl_Gendial_sel, NULL);
921         }
922         return item_data;
923 }
924
925 /**
926  * Create separator style item with title
927  *
928  * @return a pointer to Setting_GenGroupItem_Data
929  */
930 Setting_GenGroupItem_Data *setting_create_Gendial_field_titleItem(
931                                                 Evas_Object *genlist,
932                                                 const Elm_Genlist_Item_Class *itc,
933                                                 const char *keyStr,
934                                                 setting_call_back_func gl_sel)
935 {
936         /* SETTING_TRACE_BEGIN; */
937         Setting_GenGroupItem_Data *item_data =
938             (Setting_GenGroupItem_Data *) calloc(1,
939                                                  sizeof
940                                                  (Setting_GenGroupItem_Data));
941         setting_retvm_if(!item_data, NULL, "calloc failed");
942         item_data->keyStr = (char *)g_strdup(keyStr);
943         if (gl_sel) {
944                 item_data->item =
945                     elm_genlist_item_append(genlist, itc, item_data, NULL,
946                                             ELM_GENLIST_ITEM_NONE, gl_sel,
947                                             NULL);
948         } else {
949                 item_data->item =
950                     elm_genlist_item_append(genlist, itc, item_data, NULL,
951                                             ELM_GENLIST_ITEM_NONE,
952                                             _gl_Gendial_sel, NULL);
953         }
954         return item_data;
955 }
956
957 /**
958  * Create 1radio-1text style item
959  *
960  * @return a pointer to Setting_GenGroupItem_Data
961  */
962
963 Setting_GenGroupItem_Data *setting_create_Gendial_field_1radio(
964                                         Evas_Object *genlist,
965                                         const Elm_Genlist_Item_Class *itc,
966                                         setting_call_back_func gl_sel,
967                                         void *sel_data,
968                                         SWALLOW_Type swallow_type,
969                                         Evas_Object *rgd, int chk_status,
970                                         const char *keyStr,
971                                         setting_call_back_func chk_change_cb)
972 {
973         /* SETTING_TRACE_BEGIN; */
974         Setting_GenGroupItem_Data *item_data =
975             (Setting_GenGroupItem_Data *) calloc(1,
976                                                  sizeof
977                                                  (Setting_GenGroupItem_Data));
978         setting_retvm_if(!item_data, NULL, "calloc failed");
979         item_data->keyStr = (char *)g_strdup(keyStr);
980         item_data->swallow_type = swallow_type;
981         item_data->chk_status = chk_status;
982         item_data->chk_change_cb = chk_change_cb;
983         item_data->rgd = rgd;
984
985         if (gl_sel) {
986                 item_data->item =
987                     elm_genlist_item_append(genlist, itc, item_data, NULL,
988                                             ELM_GENLIST_ITEM_NONE, gl_sel,
989                                             sel_data);
990         } else {
991                 item_data->item =
992                     elm_genlist_item_append(genlist, itc, item_data, NULL,
993                                             ELM_GENLIST_ITEM_NONE,
994                                             _gl_Gendial_sel, sel_data);
995         }
996         return item_data;
997 }
998
999 Setting_GenGroupItem_Data *setting_create_Gendial_field_2radio(
1000                                         Evas_Object *genlist,
1001                                         const Elm_Genlist_Item_Class *itc,
1002                                         setting_call_back_func gl_sel,
1003                                         void *sel_data,
1004                                         SWALLOW_Type swallow_type,
1005                                         Evas_Object *rgd, int chk_status,
1006                                         const char *keyStr,
1007                                         const char *sub_desc,
1008                                         setting_call_back_func chk_change_cb)
1009 {
1010         /* SETTING_TRACE_BEGIN; */
1011         Setting_GenGroupItem_Data *item_data =
1012             (Setting_GenGroupItem_Data *) calloc(1,
1013                                                  sizeof
1014                                                  (Setting_GenGroupItem_Data));
1015         setting_retvm_if(!item_data, NULL, "calloc failed");
1016         item_data->keyStr = (char *)g_strdup(keyStr);
1017         item_data->sub_desc = (char *)g_strdup(sub_desc);
1018         item_data->swallow_type = swallow_type;
1019         item_data->chk_status = chk_status;
1020         item_data->chk_change_cb = chk_change_cb;
1021         item_data->rgd = rgd;
1022
1023         if (gl_sel) {
1024                 item_data->item =
1025                     elm_genlist_item_append(genlist, itc, item_data, NULL,
1026                                             ELM_GENLIST_ITEM_NONE, gl_sel,
1027                                             sel_data);
1028         } else {
1029                 item_data->item =
1030                     elm_genlist_item_append(genlist, itc, item_data, NULL,
1031                                             ELM_GENLIST_ITEM_NONE,
1032                                             _gl_Gendial_sel, sel_data);
1033         }
1034         return item_data;
1035 }
1036
1037 /**
1038  * Create common style item with menu icon
1039  *
1040  * @return a pointer to Setting_GenGroupItem_Data
1041  */
1042 Setting_GenGroupItem_Data *setting_create_Gendial_field_groupitem(
1043                                         Evas_Object *genlist,
1044                                         const Elm_Genlist_Item_Class *itc,
1045                                         Elm_Object_Item *parent,
1046                                         setting_call_back_func gl_sel,
1047                                         void *sel_data,
1048                                         SWALLOW_Type swallow_type,
1049                                         char *l_icon_path,
1050                                         char *r_icon_path, int chk_status,
1051                                         const char *keyStr, char *sub_desc,
1052                                         setting_call_back_func
1053                                         chk_change_cb)
1054 {
1055 //      SETTING_TRACE_BEGIN;
1056         Setting_GenGroupItem_Data *item_data = (
1057                 Setting_GenGroupItem_Data *) calloc(1, sizeof(Setting_GenGroupItem_Data));
1058         setting_retvm_if(!item_data, NULL, "calloc failed");
1059
1060         /* to do formatting customizition in one place */
1061         if (SWALLOW_Type_LAYOUT_SPECIALIZTION == swallow_type
1062             || SWALLOW_Type_LAYOUT_SPECIALIZTION_X == swallow_type) {
1063                 elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
1064
1065                 char speciliztion[MAX_SPECIALIZITION_LEN] = { 0, };
1066                 char* temp1 = (char *)keyStr;
1067                 char*temp2 = strchr(temp1, '&');
1068                 char* temp = NULL;
1069
1070                 while (NULL != temp2) {
1071                         if (0 == safeStrNCmp(temp2, "&amp;", strlen("&amp;")) ||//'&'
1072                             0 == safeStrNCmp(temp2, "&lt;", strlen("&lt;")) ||//'<'
1073                             0 == safeStrNCmp(temp2, "&gt;", strlen("&gt;")) ||//'>'
1074                             0 == safeStrNCmp(temp2, "&quot;", strlen("&quot;")) ||//double quotes
1075                             0 == safeStrNCmp(temp2, "&apos;", strlen("&apos;")) ||//single quotes
1076                             0 == safeStrNCmp(temp2, "&nbsp;", strlen("&nbsp;")) ||//space character
1077                             0 == safeStrNCmp(temp2, "&copy;", strlen("&copy;")) ||//copyright character
1078                             0 == safeStrNCmp(temp2, "&reg;", strlen("&reg;"))//registeration character
1079                            ) {//escape character,do nothing
1080                            temp = temp2 + 1;
1081                            if ('\0' == temp[0]) break;
1082                            temp2 = strchr(temp, '&');
1083                         }
1084                         else
1085                         {
1086                                 g_strlcat(speciliztion, temp1, temp2 - temp1 +1);
1087                                 g_strlcat(speciliztion, "&amp;", MAX_SPECIALIZITION_LEN);
1088                                 temp1 = temp2 + 1;
1089                                 if ('\0' == temp1[0]) break;
1090                                 temp2 = strchr(temp1, '&');
1091                         }
1092                 }
1093                 if ('\0' != temp1[0]) {
1094                         g_strlcat(speciliztion, temp1, MAX_SPECIALIZITION_LEN);
1095                 }
1096
1097
1098                 item_data->keyStr = (char *)g_strdup(speciliztion);
1099         } else {
1100                 item_data->keyStr = (char *)g_strdup(keyStr);
1101         }
1102
1103         item_data->sub_desc = (char *)g_strdup(sub_desc);
1104         item_data->swallow_type = swallow_type;
1105         item_data->l_swallow_path = (char *)g_strdup(l_icon_path);
1106         item_data->r_swallow_path = (char *)g_strdup(r_icon_path);
1107         item_data->chk_status = chk_status;
1108         item_data->chk_change_cb = chk_change_cb;
1109
1110         if (gl_sel) {
1111                 item_data->item =
1112                     elm_genlist_item_append(genlist, itc, item_data, parent,
1113                                             ELM_GENLIST_ITEM_NONE, gl_sel,
1114                                             sel_data);
1115         } else {
1116                 item_data->item =
1117                     elm_genlist_item_append(genlist, itc, item_data, parent,
1118                                             ELM_GENLIST_ITEM_NONE,
1119                                             _gl_Gendial_sel, sel_data);
1120         }
1121         if (SWALLOW_Type_LAYOUT_SPECIALIZTION == swallow_type) {
1122                 Elm_Object_Item *item = elm_genlist_item_append(genlist,
1123                                                                 &(itc_sep_line),
1124                                                                 NULL, NULL,
1125                                                                 ELM_GENLIST_ITEM_NONE,
1126                                                                 NULL, NULL);
1127                 elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1128                 //Fix the separator line disappear issue when clicking "SPECIALIZTION" words in new HD theme
1129                 elm_genlist_item_select_mode_set(item_data->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1130         }
1131
1132         return item_data;
1133 }
1134
1135 /**
1136  * Common function to create a genlist item
1137  * @return a pointer to Setting_GenGroupItem_Data
1138  */
1139 Setting_GenGroupItem_Data *setting_create_Gendial_field_def(Evas_Object *
1140                                                             genlist,
1141                                                             const Elm_Genlist_Item_Class *itc,
1142                                                             setting_call_back_func
1143                                                             gl_sel,
1144                                                             void *sel_data,
1145                                                             SWALLOW_Type
1146                                                             swallow_type,
1147                                                             char *l_icon_path,
1148                                                             char *r_icon_path,
1149                                                             int chk_status,
1150                                                             const char *keyStr,
1151                                                             char *sub_desc,
1152                                                             setting_call_back_func chk_change_cb)
1153 {
1154         return setting_create_Gendial_field_groupitem(genlist, itc, NULL,
1155                                                       gl_sel, sel_data,
1156                                                       swallow_type, l_icon_path,
1157                                                       r_icon_path, chk_status,
1158                                                       keyStr, sub_desc,
1159                                                       chk_change_cb);
1160 }
1161
1162 /**
1163  * Create 1entry style item
1164  * @return a pointer to Setting_GenGroupItem_Data
1165  */
1166 Setting_GenGroupItem_Data *setting_create_Gendial_field_entry(Evas_Object *
1167                                                               genlist,
1168                                                               const Elm_Genlist_Item_Class *itc,
1169                                                               setting_call_back_func gl_sel,
1170                                                               void *sel_data,
1171                                                               SWALLOW_Type
1172                                                               swallow_type,
1173                                                               char *l_icon_path,
1174                                                               char *r_icon_path,
1175                                                               int chk_status,
1176                                                               const char *keyStr,
1177                                                               char *sub_desc,
1178                                                               setting_call_back_func
1179                                                               chk_change_cb,
1180                                                               Elm_Input_Panel_Layout
1181                                                               input_type,
1182                                                               bool isPasswordFlag,
1183                                                               bool isFocusFlag,
1184                                                               int max_char_count,
1185                                                               int max_byte_count,
1186                                                               char *accepted,
1187                                                               char *rejected)
1188 {
1189         /* SETTING_TRACE_BEGIN; */
1190         Setting_GenGroupItem_Data *item_data = (Setting_GenGroupItem_Data *) calloc(1,
1191                                                  sizeof (Setting_GenGroupItem_Data));
1192         setting_retvm_if(!item_data, NULL, "calloc failed");
1193         item_data->keyStr = (char *)g_strdup(keyStr);
1194         item_data->sub_desc = (char *)g_strdup(sub_desc);
1195         item_data->swallow_type = swallow_type;
1196         item_data->l_swallow_path = (char *)g_strdup(l_icon_path);
1197         item_data->r_swallow_path = (char *)g_strdup(r_icon_path);
1198         item_data->chk_status = chk_status;
1199         item_data->chk_change_cb = chk_change_cb;
1200
1201         item_data->input_type = input_type;
1202         item_data->isPasswordFlag = isPasswordFlag;
1203         item_data->isFocusFlag = isFocusFlag;
1204
1205         Elm_Entry_Filter_Accept_Set *digits_filter_data =
1206             (Elm_Entry_Filter_Accept_Set *) calloc(1, sizeof (Elm_Entry_Filter_Accept_Set));
1207         if(!digits_filter_data) {
1208                 SETTING_TRACE_ERROR("calloc Elm_Entry_Filter_Accept_Set failed");
1209                 // free allocated data
1210                 G_FREE(item_data->keyStr);
1211                 G_FREE(item_data->sub_desc);
1212                 G_FREE(item_data->l_swallow_path);
1213                 G_FREE(item_data->r_swallow_path);
1214                 FREE(item_data);
1215                 return NULL;
1216         }
1217
1218
1219         Elm_Entry_Filter_Limit_Size *limit_filter_data =
1220             (Elm_Entry_Filter_Limit_Size *) calloc(1, sizeof (Elm_Entry_Filter_Limit_Size));
1221         if(!limit_filter_data) {
1222                 SETTING_TRACE_ERROR("calloc Elm_Entry_Filter_Limit_Size failed");
1223
1224                 // free allocated data
1225                 G_FREE(item_data->keyStr);
1226                 G_FREE(item_data->sub_desc);
1227                 G_FREE(item_data->l_swallow_path);
1228                 G_FREE(item_data->r_swallow_path);
1229                 FREE(item_data);
1230                 FREE(digits_filter_data);
1231                 return NULL;
1232         }
1233
1234         limit_filter_data->max_char_count = max_char_count;
1235         limit_filter_data->max_byte_count = max_byte_count;
1236         digits_filter_data->accepted = (char *)g_strdup(accepted);
1237         digits_filter_data->rejected = (char *)g_strdup(rejected);
1238
1239         item_data->digits_filter_data = digits_filter_data;
1240         item_data->limit_filter_data = limit_filter_data;
1241         item_data->userdata = sel_data;
1242
1243         if (gl_sel) {
1244                 item_data->item =
1245                     elm_genlist_item_append(genlist, itc, item_data, NULL,
1246                                             ELM_GENLIST_ITEM_NONE, gl_sel,
1247                                             sel_data);
1248         } else {
1249                 item_data->item =
1250                     elm_genlist_item_append(genlist, itc, item_data, NULL,
1251                                             ELM_GENLIST_ITEM_NONE,
1252                                             _gl_Gendial_sel, sel_data);
1253         }
1254         return item_data;
1255 }
1256
1257 /**
1258  * General function to create a parent item of expandable item
1259  *
1260  * @return a pointer to Setting_GenGroupItem_Data
1261  */
1262 Setting_GenGroupItem_Data *setting_create_Gendial_exp_parent_field(
1263                                                 Evas_Object *genlist,
1264                                                 const Elm_Genlist_Item_Class *itc,
1265                                                 setting_call_back_func gl_sel,
1266                                                 void *sel_data,
1267                                                 SWALLOW_Type swallow_type,
1268                                                 const char *keyStr,
1269                                                 char *sub_desc)
1270 {
1271         /* SETTING_TRACE_BEGIN; */
1272         Setting_GenGroupItem_Data *item_data =
1273             (Setting_GenGroupItem_Data *) calloc(1,
1274                                                  sizeof
1275                                                  (Setting_GenGroupItem_Data));
1276         setting_retvm_if(!item_data, NULL, "calloc failed");
1277         item_data->keyStr = (char *)g_strdup(keyStr);
1278         item_data->sub_desc = (char *)g_strdup(sub_desc);
1279         item_data->swallow_type = swallow_type;
1280         item_data->childs = NULL;
1281
1282         if (gl_sel) {
1283                 item_data->item =
1284                     elm_genlist_item_append(genlist, itc, item_data, NULL,
1285                                             ELM_GENLIST_ITEM_TREE, gl_sel,
1286                                             sel_data);
1287         } else {
1288                 item_data->item =
1289                     elm_genlist_item_append(genlist, itc, item_data, NULL,
1290                                             ELM_GENLIST_ITEM_TREE,
1291                                             _gl_Gendial_sel_expand, sel_data);
1292         }
1293         return item_data;
1294 }
1295
1296 /**
1297  * General function to create a subitem of expandable item
1298  *
1299  * @return a pointer to Setting_GenGroupItem_Data
1300  */
1301 Setting_GenGroupItem_Data *setting_create_Gendial_exp_sub_field(
1302                                         Evas_Object *genlist,
1303                                         const Elm_Genlist_Item_Class *itc,
1304                                         setting_call_back_func gl_sel,
1305                                         void *sel_data,
1306                                         Elm_Object_Item *parent,
1307                                         SWALLOW_Type swallow_type,
1308                                         Evas_Object *rgd, int chk_status,
1309                                         const char *keyStr,
1310                                         setting_call_back_func
1311                                         chk_change_cb)
1312 {
1313         /* SETTING_TRACE_BEGIN; */
1314         Setting_GenGroupItem_Data *item_data =
1315             (Setting_GenGroupItem_Data *) calloc(1,
1316                                                  sizeof
1317                                                  (Setting_GenGroupItem_Data));
1318         setting_retvm_if(!item_data, NULL, "calloc failed");
1319         item_data->keyStr = (char *)g_strdup(keyStr);
1320         item_data->swallow_type = swallow_type;
1321         item_data->chk_status = chk_status;
1322         item_data->rgd = rgd;
1323
1324         if (!gl_sel) {
1325                 gl_sel = setting_sub_list_sel_cb;
1326         }
1327         if (!chk_change_cb) {
1328                 chk_change_cb = setting_sub_list_rd_change;
1329         }
1330
1331         item_data->chk_change_cb = chk_change_cb;
1332         item_data->item =
1333             elm_genlist_item_append(genlist, itc, item_data, parent,
1334                                     ELM_GENLIST_ITEM_NONE, gl_sel, sel_data);
1335         return item_data;
1336 }
1337
1338 /**
1339  * To make genlist support expandable style item
1340  */
1341 void setting_enable_expandable_genlist(Evas_Object *genlist, void *data,
1342                                        setting_call_back_func gl_exp_cb,
1343                                        setting_call_back_func gl_smart_cb)
1344 {
1345         ret_if(NULL == genlist);
1346         elm_genlist_tree_effect_enabled_set(genlist, TRUE);
1347         if (!gl_smart_cb) {
1348                 gl_smart_cb = __exp_list_smart_cb;
1349         }
1350
1351         if (gl_exp_cb)
1352                 evas_object_smart_callback_add(genlist, "expanded", gl_exp_cb, data);
1353         evas_object_smart_callback_add(genlist, "contracted", gl_smart_cb, "contracted");
1354
1355         evas_object_smart_callback_add(genlist, "drag", gl_smart_cb, "drag");
1356         evas_object_smart_callback_add(genlist, "longpressed", gl_smart_cb, "longpressed");
1357 }
1358
1359 /*
1360 example:
1361
1362 setting_create_Gendial_itc("dialogue/1text.2icon.2",
1363                                                         &(networkUG->itc_1text_2icon));
1364
1365 1. create a process genlist item : [intial state is 'PROCESS']
1366 ad->data_searching_net = setting_create_Gendial_field_1radio(scroller, &(ad->itc_1text_2icon),
1367                                                 setting_network_select_network_mouse_up_Gendial_list_radio_cb, ad,
1368                                                 SWALLOW_Type_1RADIO_1PROCESS,
1369                                                 ad->chk_sel, TAPI_NETWORK_SELECTIONMODE_MANUAL,
1370                                                 "Searching..", NULL);
1371 or [intial state is 'UNPROCESS']
1372 ad->data_searching_net = setting_create_Gendial_field_1radio(scroller, &(ad->itc_1text_2icon),
1373                                                 setting_network_select_network_mouse_up_Gendial_list_radio_cb, ad,
1374                                                 SWALLOW_Type_1RADIO,
1375                                                 ad->chk_sel, TAPI_NETWORK_SELECTIONMODE_MANUAL,
1376                                                 "Searching..", NULL);
1377
1378 2. to set the PROCESS state at any place as you like:
1379 setting_begin_progress_genlist_item(ad->data_searching_net); -- change from UNPROCESS->PROCESS
1380 setting_finish_progress_genlist_item(ad->data_searching_net);--change from PROCESS->UNPROCESS
1381 */
1382 void setting_begin_progress_genlist_item(Setting_GenGroupItem_Data *data_item)
1383 {
1384         if (data_item) {
1385                 if (SWALLOW_Type_1RADIO != data_item->swallow_type) {
1386                         return;
1387                 }
1388
1389                 data_item->swallow_type = SWALLOW_Type_1RADIO_1PROCESS;
1390                 elm_object_item_data_set(data_item->item, data_item);
1391                 elm_genlist_item_update(data_item->item);
1392         }
1393 }
1394
1395 void setting_finish_progress_genlist_item(Setting_GenGroupItem_Data *data_item)
1396 {
1397         if (data_item) {
1398                 if (SWALLOW_Type_1RADIO_1PROCESS != data_item->swallow_type) {
1399                         return;
1400                 }
1401                 data_item->swallow_type = SWALLOW_Type_1RADIO;
1402                 elm_object_item_data_set(data_item->item, data_item);
1403                 elm_genlist_item_update(data_item->item);
1404         }
1405 }
1406
1407 /**
1408 * Check if some item is selected in done-list
1409 */
1410
1411 bool setting_done_list_is_some_item_selected(Setting_Done_List_Data *list_data)
1412 {
1413         SETTING_TRACE_BEGIN;
1414         bool isFound = FALSE;   /* wether can found some item checked */
1415         int idx = 0;
1416         int state = 0;
1417         for (; idx < list_data->cur_item_num; idx++) {
1418                 state =
1419                     elm_check_state_get(list_data->chk_items[idx].
1420                                         data_GenItem->eo_check);
1421                 if (state) {
1422                         isFound = TRUE;
1423                         break;
1424                 }
1425         }
1426         return isFound;
1427 }
1428
1429 static void __setting_done_list_item_sel(void *data)
1430 {
1431         SETTING_TRACE_BEGIN;
1432         retm_if(data == NULL, "data == NULL");
1433         Setting_Done_List_Data *list_data = (Setting_Done_List_Data *)data;
1434
1435         int sel_num = 0;
1436         int idx = 0;
1437
1438         setting_create_sel_info_popup(list_data->ly_parent,
1439                                       &(list_data->selInfoPop_layout),
1440                                       &(list_data->selInfoPop));
1441
1442         /* else for other checks, do rotinue checking */
1443         bool isFound = FALSE;   /* wether found the item not checked */
1444         for (idx = 0; idx < list_data->cur_item_num; idx++) {
1445                 if (!list_data->chk_items[idx].data_GenItem->chk_status) {
1446                         /* SETTING_TRACE("%s not select", _(list_data->chk_items[idx].item_name)); */
1447                         isFound = TRUE;
1448                         /* break; */
1449                 } else {
1450                         /* SETTING_TRACE("%s select", _(list_data->chk_items[idx].item_name)); */
1451                         sel_num++;
1452                 }
1453         }
1454
1455         if (isFound) {  /* reset state of chk_sel_all */
1456                 list_data->select_all_checked = 0;
1457                 elm_check_state_pointer_set(list_data->select_all_checkbox, &list_data->select_all_checked);
1458         } else {
1459                 list_data->select_all_checked = 1;
1460                 elm_check_state_pointer_set(list_data->select_all_checkbox, &list_data->select_all_checked);
1461         }
1462
1463         /* SETTING_TRACE("sel_num:%d", sel_num); */
1464         if (!sel_num) {
1465                 Elm_Object_Item *button = elm_toolbar_first_item_get(list_data->controllbar);
1466                 elm_object_item_disabled_set(button, EINA_TRUE);
1467                 evas_object_hide(list_data->selInfoPop);
1468                 return;
1469         }
1470         char text[MAX_DISPLAY_NAME_LEN_ON_UI +1] = {0, };
1471         snprintf(text, MAX_DISPLAY_NAME_LEN_ON_UI, "%s(%d)", _("IDS_ST_OPT_SELECTED"), sel_num);
1472
1473         /*  text set and timeout set */
1474         edje_object_part_text_set(_EDJ(list_data->selInfoPop_layout), "elm.text", text);
1475
1476         Elm_Object_Item *button = elm_toolbar_first_item_get(list_data->controllbar);
1477         elm_object_item_disabled_set(button, EINA_FALSE);
1478 }
1479
1480 /**
1481 * Do process when clicking the check object in the done-list item
1482 */
1483 void setting_done_list_Gendial_chk_btn_cb(void *data, Evas_Object *obj,
1484                                           void *event_info)
1485 {
1486         SETTING_TRACE_BEGIN;
1487         /* error check */
1488         retm_if(data == NULL, "Data parameter is NULL");
1489         Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
1490
1491         /* new status */
1492         list_item->chk_status = elm_check_state_get(list_item->eo_check);
1493
1494         Setting_Done_List_Data *list_data = list_item->userdata;
1495         __setting_done_list_item_sel(list_data);
1496 }
1497
1498 static void setting_done_list_Gendial_mouse_up_cb(void *data, Evas_Object *obj,
1499                                                   void *event_info)
1500 {
1501         /* error check */
1502         retm_if(event_info == NULL, "Invalid argument: event info is NULL");
1503         Elm_Object_Item *item = (Elm_Object_Item *) event_info;
1504         elm_genlist_item_selected_set(item, 0);
1505         Setting_GenGroupItem_Data *list_item =
1506             (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
1507
1508         int old_status = elm_check_state_get(list_item->eo_check);
1509         /* new status */
1510         list_item->chk_status = !old_status;
1511         elm_check_state_set(list_item->eo_check, list_item->chk_status);
1512
1513         /* other process.. */
1514         Setting_Done_List_Data *list_data = list_item->userdata;
1515         __setting_done_list_item_sel(list_data);
1516 }
1517
1518 static void __setting_select_all_done(void *data)
1519 {
1520         SETTING_TRACE_BEGIN;
1521         retm_if(data == NULL, "data == NULL");
1522         Setting_Done_List_Data *list_data = (Setting_Done_List_Data *)data;
1523
1524         int sel_num = 0;
1525         int idx = 0;
1526
1527         setting_create_sel_info_popup(list_data->ly_parent,
1528                                       &(list_data->selInfoPop_layout),
1529                                       &(list_data->selInfoPop));
1530
1531         if (list_data->select_all_checked) {
1532                 /* set all other checks state to be 1 */
1533                 SETTING_TRACE_DEBUG("Select All checked");
1534                 for (idx = 0; idx < list_data->cur_item_num; idx++) {
1535                         list_data->chk_items[idx].data_GenItem->chk_status = 1;
1536                         elm_object_item_data_set(list_data->chk_items[idx].data_GenItem->item, list_data->chk_items [idx].data_GenItem);
1537                         elm_genlist_item_update(list_data->chk_items [idx].data_GenItem->item);
1538                 }
1539                 sel_num = list_data->cur_item_num;
1540         } else {
1541                 SETTING_TRACE_DEBUG("Select All unchecked");
1542                 /* set all other checks state to be 0 */
1543                 for (idx = 0; idx < list_data->cur_item_num; idx++) {
1544                         list_data->chk_items[idx].data_GenItem->chk_status = 0;
1545                         elm_object_item_data_set(list_data->chk_items[idx].data_GenItem->item, list_data->chk_items[idx].data_GenItem);
1546                         elm_genlist_item_update(list_data->chk_items[idx].data_GenItem->item);
1547                 }
1548                 sel_num = 0;
1549         }
1550
1551         /* SETTING_TRACE("sel_num:%d", sel_num); */
1552         if (!sel_num) {
1553                 Elm_Object_Item *button = elm_toolbar_first_item_get(list_data->controllbar);
1554                 elm_object_item_disabled_set(button, EINA_TRUE);
1555                 evas_object_hide(list_data->selInfoPop);
1556                 return;
1557         }
1558         char text[MAX_DISPLAY_NAME_LEN_ON_UI +1] = {0, };
1559         snprintf(text, MAX_DISPLAY_NAME_LEN_ON_UI, "%s(%d)", _("IDS_ST_OPT_SELECTED"), sel_num);
1560
1561         /*  text set and timeout set */
1562         edje_object_part_text_set(_EDJ(list_data->selInfoPop_layout), "elm.text", text);
1563         Elm_Object_Item *button = elm_toolbar_first_item_get(list_data->controllbar);
1564         elm_object_item_disabled_set(button, EINA_FALSE);
1565 }
1566
1567 static void __setting_select_all_layout_mouse_down_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
1568 {
1569         SETTING_TRACE_BEGIN;
1570         retm_if(data == NULL, "data == NULL");
1571         Setting_Done_List_Data *list_data = (Setting_Done_List_Data *)data;
1572
1573         list_data->select_all_checked = !list_data->select_all_checked;
1574         elm_check_state_pointer_set(list_data->select_all_checkbox, &list_data->select_all_checked);
1575
1576         __setting_select_all_done(list_data);
1577 }
1578
1579 static void __setting_select_all_check_changed_cb(void *data, Evas_Object *obj, void *event_info)
1580 {
1581         SETTING_TRACE_BEGIN;
1582         retm_if(data == NULL, "data == NULL");
1583         Setting_Done_List_Data *list_data = (Setting_Done_List_Data *)data;
1584
1585         list_data->select_all_checked = elm_check_state_get(list_data->select_all_checkbox);
1586         elm_check_state_pointer_set(list_data->select_all_checkbox, &list_data->select_all_checked);
1587         __setting_select_all_done(data);
1588 }
1589
1590 /**
1591 * The API to create done-list.
1592 *
1593 * @param[in] list_data
1594 * @return a done-list
1595 */
1596 Evas_Object *setting_create_done_list(Setting_Done_List_Data *list_data)
1597 {
1598         SETTING_TRACE_BEGIN;
1599         retvm_if(list_data == NULL, NULL, "list_data == NULL");
1600         Evas_Object *sub_layout = elm_layout_add(list_data->win_main);
1601         elm_layout_file_set(sub_layout, SETTING_THEME_EDJ_NAME, "search_layout");
1602         evas_object_size_hint_weight_set(sub_layout, EVAS_HINT_EXPAND, 0.0);
1603         evas_object_show(sub_layout);
1604
1605         setting_create_Gendial_itc("1text.1icon.2", &(list_data->itc_1text_1icon));
1606
1607         Evas_Object *select_all_layout = elm_layout_add(sub_layout);
1608         retvm_if(select_all_layout == NULL, NULL, "select_all_layout == NULL");
1609         elm_layout_theme_set(select_all_layout, "genlist", "item", "select_all/default");
1610         evas_object_size_hint_weight_set(select_all_layout, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
1611         evas_object_size_hint_align_set(select_all_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
1612         evas_object_event_callback_add(select_all_layout, EVAS_CALLBACK_MOUSE_DOWN, __setting_select_all_layout_mouse_down_cb, list_data);
1613
1614         Eina_Bool select_all_checked = list_data->select_all_checked;
1615         Evas_Object *select_all_checkbox = elm_check_add(select_all_layout);
1616         elm_check_state_pointer_set(select_all_checkbox, &select_all_checked);
1617         evas_object_smart_callback_add(select_all_checkbox, "changed", __setting_select_all_check_changed_cb, list_data);
1618         evas_object_propagate_events_set(select_all_checkbox, EINA_FALSE);
1619         elm_object_part_content_set(select_all_layout, "elm.icon", select_all_checkbox);
1620
1621         list_data->select_all_checkbox = select_all_checkbox;
1622         elm_object_part_text_set(select_all_layout, "elm.text", _(KeyStr_Select_All));
1623
1624         Evas_Object *scroller = elm_genlist_add(list_data->win_main);
1625         retvm_if(scroller == NULL, NULL, "scroller == NULL");
1626         elm_genlist_clear(scroller);    /* first to clear list */
1627
1628         elm_object_part_content_set(sub_layout, "search_list", scroller);
1629         elm_object_part_content_set(sub_layout, "search_bar", select_all_layout);
1630
1631         int index = 0;
1632         for (; index < list_data->cur_item_num; index++) {
1633                 list_data->chk_items[index].data_GenItem =
1634                     setting_create_Gendial_field_def(scroller,
1635                                                      &(list_data->itc_1text_1icon),
1636                                                      setting_done_list_Gendial_mouse_up_cb,
1637                                                      list_data,
1638                                                      SWALLOW_Type_1CHECK, NULL,
1639                                                      NULL, 0,
1640                                                      list_data->chk_items
1641                                                      [index].item_name, NULL,
1642                                                      setting_done_list_Gendial_chk_btn_cb);
1643                 if (list_data->chk_items[index].data_GenItem) {
1644                         list_data->chk_items[index].data_GenItem->userdata = list_data;
1645                 } else {
1646                         SETTING_TRACE_ERROR("list_data->chk_items[index].data_GenItem is NULL");
1647                 }
1648
1649         }
1650
1651         return sub_layout;
1652 }
1653
1654 /**
1655 * To disable a specialized genlist item
1656 *
1657 * @param[in] item
1658 */
1659 void setting_disable_genlist_item(Elm_Object_Item *item)
1660 {
1661         if (item) {
1662                 elm_object_item_disabled_set(item, EINA_TRUE); /* make it be dim displayed */
1663         }
1664 }
1665
1666 /**
1667 * To enable a specialized genlist item
1668 *
1669 * @param[in] item
1670 */
1671 void setting_enable_genlist_item(Elm_Object_Item *item)
1672 {
1673         if (item) {
1674                 elm_object_item_disabled_set(item, EINA_FALSE); /* make it be normally displayed */
1675         }
1676 }
1677