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