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