2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <appcore-efl.h>
19 #include <Elementary.h>
23 #include "cst-common.h"
24 #include "cst-widget.h"
25 #include "cst-common-string.h"
26 #include "cst-debug.h"
27 #include "cst-reject-msg.h"
28 #include "cst-autoreject.h"
29 #include "cst-prefix-dial.h"
30 #include "cst-forwarding.h"
32 #include "cst-widget.h"
34 static Elm_Genlist_Item_Class *itc_seperator = NULL;
35 static Elm_Genlist_Item_Class *itc_seperator_no_line = NULL;
36 static Elm_Genlist_Item_Class *itc_underline = NULL;
38 /* This callback is for showing(hiding) X marked button. */
39 static void _changed_cb(void *data, Evas_Object *obj, void *event_info)
41 if (elm_object_focus_get(data)) {
42 if (elm_entry_is_empty(obj))
43 elm_object_signal_emit(data, "elm,state,eraser,hide", "elm");
45 elm_object_signal_emit(data, "elm,state,eraser,show", "elm");
49 /* Focused callback will show X marked button and hide guidetext. */
50 static void _focused_cb(void *data, Evas_Object *obj, void *event_info)
52 if (!elm_entry_is_empty(obj))
53 elm_object_signal_emit(data, "elm,state,eraser,show", "elm");
54 elm_object_signal_emit(data, "elm,state,guidetext,hide", "elm");
57 /* Unfocused callback will show guidetext and hide X marked button. */
58 static void _unfocused_cb(void *data, Evas_Object *obj, void *event_info)
60 if (elm_entry_is_empty(obj))
61 elm_object_signal_emit(data, "elm,state,guidetext,show", "elm");
62 elm_object_signal_emit(data, "elm,state,eraser,hide", "elm");
65 /* When X marked button clicked, make string as empty. */
66 static void _eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
68 elm_entry_entry_set(data, "");
71 Evas_Object *_cst_create_progressbar(Evas_Object *parent)
73 ENTER(_cst_create_progressbar);
74 retv_if(NULL == parent, NULL);
75 Evas_Object *progressbar;
76 progressbar = elm_progressbar_add(parent);
77 elm_object_style_set(progressbar, "list_process");
78 evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.5);
79 evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
80 evas_object_show(progressbar);
81 elm_progressbar_pulse(progressbar, EINA_TRUE);
86 static void __cst_get_error_string(int error, char *msg)
89 case CST_ERROR_INCORRECT_OPERATION:
90 snprintf(msg, 100, "%s", T_(CST_STR_INCORRECT_OPERATION));
92 case CST_ERROR_INVALID_PASSWORD:
93 snprintf(msg, 100, "%s", T_(CST_STR_INVALID_PASSWORD));
95 case CST_ERROR_PASSWORD_BLOCKED:
96 snprintf(msg, 100, "%s", T_(CST_STR_PASSWORD_BLOCKED));
98 case CST_ERROR_SERVICE_UNAVAILABLE:
99 snprintf(msg, 100, "%s", T_(CST_STR_SERVICE_UNAVAILABLE));
101 case CST_ERROR_UNKNOWN:
102 snprintf(msg, 100, "%s", T_(CST_STR_REJECTED_BY_NETWORK));
104 case CST_ERROR_ENTER_NUMBER:
105 snprintf(msg, 100, "%s", T_(CST_STR_ENTER_NUMBER));
107 case CST_ERROR_ENTER_MESSAGE:
108 snprintf(msg, 100, "%s", T_(CST_STR_ENTER_MESSAGE));
110 case CST_ERROR_SELECT_VALID_ENTRY:
111 snprintf(msg, 100, "%s", T_(CST_STR_SELECT_VALID_ENTRY));
113 case CST_ERROR_REJECTED_BY_NETWORK:
114 snprintf(msg, 100, "%s", T_(CST_STR_REJECTED_BY_NETWORK));
116 case CST_ERROR_DUPLICATE_MESSAGE:
117 snprintf(msg, 100, "%s", T_(CST_STR_ENTER_DUPLICATE_MESSAGE));
119 case CST_ERROR_INSERT_SIM_CARD:
120 snprintf(msg, 100, "%s", T_(CST_STR_INSERT_SIM_CARD));
122 case CST_ERROR_CHANGE_FLIGHT_MODE:
123 snprintf(msg, 100, "%s", T_(CST_STR_CHNAGE_FLIGHT_MODE_MESSAGE));
125 case CST_ERROR_AUL_LAUNCH_ERROR:
126 snprintf(msg, 100, "%s", T_(CST_STR_APP_NOT_INSTALLED));
129 snprintf(msg, 100, "%s", T_(CST_STR_UNKNOWN_OPERATION));
134 Evas_Object *_cst_create_error_popup(Evas_Object *parent, int error)
136 retv_if(error < 0, NULL);
139 __cst_get_error_string(error, error_msg);
140 DBG("Error message=%s", error_msg);
143 popup = elm_popup_add(parent);
144 elm_popup_timeout_set(popup, 1.5);
145 elm_object_text_set(popup, error_msg);
146 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
151 static void __cst_2btn_popup_ok_cb(void *data, Evas_Object *obj, void *event_info)
153 ret_if(data == NULL);
154 CstGlItemData_t *item_data = (CstGlItemData_t *)data;
155 CstUgData_t *ugd = (CstUgData_t *)item_data->ugd;
157 switch (item_data->str_id) {
158 case CST_STR_UNABLE_TO_TURN_OFF_PROXIMITY:
159 _cst_vconf_set_bool(VCONFKEY_CISSAPPL_PROXIMITY_SENSOR_BOOL, EINA_FALSE);
160 _cst_vconf_set_bool(VCONFKEY_CISSAPPL_POWER_KEY_ENDS_CALL_BOOL, EINA_FALSE);
162 case CST_STR_UNABLE_TO_SET_POWER_KEY_END_CALL:
163 _cst_vconf_set_bool(VCONFKEY_CISSAPPL_POWER_KEY_ENDS_CALL_BOOL, EINA_TRUE);
164 _cst_vconf_set_bool(VCONFKEY_CISSAPPL_PROXIMITY_SENSOR_BOOL, EINA_TRUE);
167 DBG("__cst_2btn_popup_response_cb() error");
170 elm_genlist_item_update(item_data->gl_item);
171 evas_object_del(ugd->popup);
175 static void __cst_2btn_popup_cancel_cb(void *data, Evas_Object *obj, void *event_info)
177 ret_if(data == NULL);
178 CstGlItemData_t *item_data = (CstGlItemData_t *)data;
179 CstUgData_t *ugd = (CstUgData_t *)item_data->ugd;
181 evas_object_del(ugd->popup);
185 Evas_Object *_cst_create_2btn_popup(Evas_Object *parent, CstGlItemData_t *item_data)
187 retv_if((parent == NULL) || (item_data == NULL), NULL);
189 Evas_Object *popup, *btn1, *btn2;
190 popup = elm_popup_add(parent);
191 elm_object_text_set(popup, T_(item_data->str_id));
192 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
194 btn1 = elm_button_add(popup);
195 elm_object_text_set(btn1, T_(CST_STR_OK));
196 elm_object_part_content_set(popup, "button1", btn1);
197 evas_object_smart_callback_add(btn1, "clicked", __cst_2btn_popup_ok_cb, (void *)item_data);
199 btn2 = elm_button_add(popup);
200 elm_object_text_set(btn2, T_(CST_STR_POP_CANCEL));
201 elm_object_part_content_set(popup, "button2", btn2);
202 evas_object_smart_callback_add(btn2, "clicked", __cst_2btn_popup_cancel_cb, (void *)item_data);
207 Evas_Object *_cst_get_navifr_prev_btn(Evas_Object *nf)
209 ENTER(_cst_get_navifr_prev_btn);
210 Elm_Object_Item *top_it = elm_naviframe_top_item_get(nf);
211 retv_if(top_it == NULL, NULL);
212 Evas_Object *btn = elm_object_item_part_content_get(top_it, "prev_btn");
213 retv_if(btn == NULL, NULL);
218 Evas_Object *_cst_create_navi_control_bar(Evas_Object *parent,
219 char *label1, const char *icon1, Evas_Smart_Cb cb1,
220 char *label2, const char *icon2, Evas_Smart_Cb cb2,
221 void *data, Elm_Object_Item *navi_it,
222 Elm_Object_Item ** c_item)
224 ENTER(_cst_create_navi_control_bar);
225 retv_if(NULL == parent, NULL);
226 Elm_Object_Item *item;
227 Evas_Object *cbar = elm_toolbar_add(parent);
228 elm_toolbar_shrink_mode_set(cbar, ELM_TOOLBAR_SHRINK_EXPAND);
231 retv_if(cbar == NULL, NULL);
232 retv_if(label1 == NULL, NULL);
235 c_item[0] = elm_toolbar_item_append(cbar,
236 icon1, label1, cb1, data);
239 item = elm_toolbar_item_append(cbar, NULL, NULL, NULL, NULL);
240 elm_object_item_part_content_set(item, "object", NULL);
241 elm_object_item_disabled_set(item, EINA_TRUE);
243 Evas_Object *btn = elm_object_item_part_content_get(navi_it,
248 c_item[1] = elm_toolbar_item_append(cbar,
249 icon2, label2, cb2, data);
250 item = elm_toolbar_item_append(cbar, NULL, NULL, NULL, NULL);
251 elm_object_item_part_content_set(item, "object", NULL);
252 elm_object_item_disabled_set(item, EINA_TRUE);
255 item = elm_toolbar_item_append(cbar, NULL, NULL, NULL, NULL);
256 elm_object_item_part_content_set(item, "object", NULL);
257 elm_object_item_disabled_set(item, EINA_TRUE);
263 item = elm_toolbar_item_append(cbar, NULL, NULL, NULL, NULL);
264 elm_object_item_part_content_set(item, "object", NULL);
265 elm_object_item_disabled_set(item, EINA_TRUE);
267 c_item[1] = elm_toolbar_item_append(cbar,
268 icon2, label2, cb2, data);
272 elm_object_item_part_content_set(navi_it, "controlbar", cbar);
276 static void __cst_gl_del_seperator(void *data, Evas_Object *obj)
278 ret_if(data == NULL);
279 CstGlItemData_t *item_data = (CstGlItemData_t *)data;
285 void _cst_create_genlist_separator(Evas_Object *genlist, Eina_Bool need_item_data)
287 Elm_Object_Item *item = NULL;
290 itc_seperator = elm_genlist_item_class_new();
292 itc_seperator->item_style = "dialogue/separator/21/with_line";
293 itc_seperator->func.text_get = NULL;
294 itc_seperator->func.content_get = NULL;
295 itc_seperator->func.state_get = NULL;
297 if (need_item_data) {
298 CstGlItemData_t *item_data;
299 itc_seperator->func.del = __cst_gl_del_seperator;
300 item_data = calloc(1, sizeof(CstGlItemData_t));
301 ret_if(NULL == item_data);
302 item_data->index = -1;
303 item = elm_genlist_item_append(genlist, itc_seperator, item_data, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
304 item_data->gl_item = item;
306 itc_seperator->func.del = NULL;
307 item = elm_genlist_item_append(genlist, itc_seperator, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
309 elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
312 void _cst_create_genlist_separator_no_line(Evas_Object *genlist)
314 ret_if(NULL == genlist);
315 Elm_Object_Item *item = NULL;
317 if (!itc_seperator_no_line)
318 itc_seperator_no_line = elm_genlist_item_class_new();
320 itc_seperator_no_line->item_style = "dialogue/separator/20";
321 itc_seperator_no_line->func.text_get = NULL;
322 itc_seperator_no_line->func.content_get = NULL;
323 itc_seperator_no_line->func.state_get = NULL;
325 itc_seperator_no_line->func.del = NULL;
326 item = elm_genlist_item_append(genlist, itc_seperator_no_line, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
327 elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
330 void _cst_create_genlist_underline(Evas_Object *genlist)
332 ret_if(NULL == genlist);
333 Elm_Object_Item *item = NULL;
336 itc_underline = elm_genlist_item_class_new();
338 itc_underline->item_style = "dialogue/separator/1/with_line";
339 itc_underline->func.text_get = NULL;
340 itc_underline->func.content_get = NULL;
341 itc_underline->func.state_get = NULL;
342 itc_underline->func.del = NULL;
344 item = elm_genlist_item_append(genlist, itc_underline, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
345 elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
348 Elm_Object_Item *_cst_create_genlist_update_underline(Evas_Object *genlist)
350 retv_if(NULL == genlist, NULL);
351 Elm_Object_Item *item = NULL;
354 itc_underline = elm_genlist_item_class_new();
356 itc_underline->item_style = "dialogue/separator/1/with_line";
357 itc_underline->func.text_get = NULL;
358 itc_underline->func.content_get = NULL;
359 itc_underline->func.state_get = NULL;
360 itc_underline->func.del = NULL;
362 item = elm_genlist_item_append(genlist, itc_underline, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
363 elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
367 static void __cst_hide_selectinfo_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
369 ENTER(__cst_hide_selectinfo_cb);
370 ret_if(data == NULL || obj == NULL);
372 CstUgData_t *ugd = (CstUgData_t *)data;
373 ret_if(obj != ugd->selectinfo);
375 if (ugd->selectinfo && ugd->select_backup)
376 edje_object_signal_emit(_EDJ(ugd->select_backup),
377 DEFAULT_CONTENT_SIGNAL, BOTTOM_PADDING_CONTENT_SOURCE);
378 ugd->select_backup = NULL;
379 ugd->selectinfo = NULL;
382 void _cst_create_selectinfo(CstUgData_t *ugd, Evas_Object *layout, const char *label)
384 ENTER(_cst_create_selectinfo);
386 if (!ugd->selectinfo) {
387 ugd->select_backup = layout;
388 ugd->selectinfo = elm_notify_add(ugd->select_backup);
389 elm_notify_orient_set(ugd->selectinfo, ELM_NOTIFY_ORIENT_BOTTOM);
391 evas_object_event_callback_add(ugd->selectinfo,
392 EVAS_CALLBACK_HIDE, __cst_hide_selectinfo_cb, ugd);
394 ugd->selectinfo_layout = elm_layout_add(ugd->select_backup);
396 elm_layout_theme_set(ugd->selectinfo_layout,
397 "standard", "selectioninfo", "vertical/bottom_12");
399 elm_object_content_set(ugd->selectinfo, ugd->selectinfo_layout);
403 evas_object_hide(ugd->selectinfo);
407 DBG("Input label : %s", label);
408 edje_object_part_text_set(_EDJ(ugd->selectinfo_layout), "elm.text", label);
409 elm_notify_timeout_set(ugd->selectinfo, 2);
410 evas_object_show(ugd->selectinfo);
413 void _cst_del_selectinfo(CstUgData_t *ugd)
417 if (ugd->selectinfo_layout)
418 evas_object_del(ugd->selectinfo_layout);
420 evas_object_del(ugd->selectinfo);
422 ugd->selectinfo_layout = NULL;
423 ugd->selectinfo = NULL;
426 Evas_Object *_cst_create_onoff_button(Evas_Object *obj,
427 int state_value, Evas_Smart_Cb cb_func, void *cb_data)
429 retv_if(NULL == obj, NULL);
431 Evas_Object *icon = elm_check_add(obj);
432 elm_object_style_set(icon, "on&off");
433 elm_check_state_set(icon, state_value);
435 evas_object_smart_callback_add(icon, "changed",
438 evas_object_propagate_events_set(icon, EINA_FALSE);
443 Evas_Object *_cst_create_radio_icon(Evas_Object *obj,
444 Evas_Object *rdg, int value, int offset, const char *vconf_key)
446 retv_if(NULL == obj, NULL);
449 Evas_Object *radio = elm_radio_add(obj);
450 elm_radio_state_value_set(radio, value);
451 elm_radio_group_add(radio, rdg);
452 if (vconf_key == NULL) {
453 elm_radio_value_set(rdg, offset);
456 _cst_vconf_get_int(vconf_key, &rd_value);
457 elm_radio_value_set(rdg, (rd_value + offset));
463 Evas_Object *_cst_create_title_btn(Evas_Object *parent,
464 const char *text, Evas_Smart_Cb func, void *data)
466 retv_if(NULL == parent, NULL);
468 Evas_Object *btn = elm_button_add(parent);
469 if (!btn) return NULL;
470 elm_object_style_set(btn, "naviframe/title/default");
471 elm_object_text_set(btn, text);
472 evas_object_smart_callback_add(btn, "clicked", func, data);
476 static void __cst_trans_finished(void *data, Evas_Object *obj, void *event_info)
479 elm_naviframe_prev_btn_auto_pushed_set(obj, EINA_TRUE);
480 evas_object_smart_callback_del(obj, "transition,finished", __cst_trans_finished);
483 void _cst_remove_naviframe(Evas_Object *nf)
486 elm_naviframe_prev_btn_auto_pushed_set(nf, EINA_FALSE);
487 evas_object_smart_callback_add(nf, "transition,finished",
488 __cst_trans_finished, NULL);
491 static void __cst_changed_editfield_cb(void *data, Evas_Object *obj, void *event_info)
493 ret_if(NULL == data);
494 CstUgData_t *ugd = (CstUgData_t *)data;
495 const char *entry_str = elm_entry_entry_get(obj);
497 Elm_Object_Item *navi_it = elm_naviframe_top_item_get(ugd->nf);
499 Evas_Object *btn = elm_object_item_part_content_get(navi_it,
503 if (NULL == entry_str || '\0' == entry_str[0])
504 elm_object_disabled_set(btn, EINA_TRUE);
506 elm_object_disabled_set(btn, EINA_FALSE);
510 Evas_Object *_cst_create_ime_editfield(CstUgData_t *ugd,
511 Evas_Object *parent, CstImeType_t ime_type, char *input_string)
513 retv_if((NULL == ugd || NULL == parent), NULL);
515 Ecore_IMF_Input_Panel_Layout panel_layout;
516 Evas_Object *layout = elm_layout_add(parent);
517 elm_layout_theme_set(layout, "layout", "editfield", "title");
518 Elm_Entry_Filter_Limit_Size limit_filter_data;
519 Elm_Entry_Filter_Accept_Set digits_filter_data;
520 Ecore_IMF_Context *imf_context;
521 void (*input_panel_cb)() = NULL;
524 ugd->dg_entry = elm_entry_add(parent);
525 elm_object_part_content_set(layout, "elm.swallow.content", ugd->dg_entry);
527 evas_object_smart_callback_add(ugd->dg_entry, "changed", _changed_cb, layout);
528 evas_object_smart_callback_add(ugd->dg_entry, "focused", _focused_cb, layout);
529 evas_object_smart_callback_add(ugd->dg_entry, "unfocused", _unfocused_cb, layout);
530 elm_object_signal_callback_add(layout, "elm,eraser,clicked", "elm", _eraser_clicked_cb, ugd->dg_entry);
533 case CST_IME_AUTO_REJECT:
534 elm_entry_single_line_set(ugd->dg_entry, EINA_TRUE);
535 elm_entry_scrollable_set(ugd->dg_entry, EINA_TRUE);
536 elm_object_part_text_set(layout, "elm.text", T_(CST_STR_ENTER_NUMBER));
537 panel_layout = ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER;
538 elm_entry_input_panel_layout_set(ugd->dg_entry, panel_layout);
539 limit_filter_data.max_char_count = 0;
540 limit_filter_data.max_byte_count = CST_MAX_PHONE_NUMBER_LEN;
541 digits_filter_data.accepted = "0123456789+*#";
542 digits_filter_data.rejected = NULL;
543 elm_entry_markup_filter_append(ugd->dg_entry,
544 elm_entry_filter_accept_set, &digits_filter_data);
545 input_panel_cb = _cst_auto_reject_input_panel_event_callback;
547 case CST_IME_PREFIX_DIAL:
548 elm_entry_single_line_set(ugd->dg_entry, EINA_TRUE);
549 elm_entry_scrollable_set(ugd->dg_entry, EINA_TRUE);
550 elm_object_part_text_set(layout, "elm.text", T_(CST_STR_ENTER_NUMBER));
551 panel_layout = ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER;
552 elm_entry_input_panel_layout_set(ugd->dg_entry, panel_layout);
553 limit_filter_data.max_char_count = 0;
554 limit_filter_data.max_byte_count = CST_MAX_PREFIX_NUMBER_LEN;
555 digits_filter_data.accepted = "0123456789+*#";
556 digits_filter_data.rejected = NULL;
557 elm_entry_markup_filter_append(ugd->dg_entry,
558 elm_entry_filter_accept_set, &digits_filter_data);
559 _cst_vconf_get_bool(VCONFKEY_CISSAPPL_PREFIX_DIAL_BOOL, &value);
560 input_panel_cb = _cst_prefix_dialling_input_panel_event_callback;
562 case CST_IME_REJECT_MSG:
563 panel_layout = ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL;
564 elm_entry_input_panel_layout_set(ugd->dg_entry, panel_layout);
565 limit_filter_data.max_char_count = 0;
566 limit_filter_data.max_byte_count = CST_MAX_ITEM_TEXT_BUFFER_LEN - 1;
567 input_panel_cb = _cst_reject_msg_input_panel_event_callback;
569 case CST_IME_CALL_FORWARD:
570 elm_entry_single_line_set(ugd->dg_entry, EINA_TRUE);
571 elm_entry_scrollable_set(ugd->dg_entry, EINA_TRUE);
572 elm_object_part_text_set(layout, "elm.text", T_(CST_STR_ENTER_NUMBER));
573 panel_layout = ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER;
574 elm_entry_input_panel_layout_set(ugd->dg_entry, panel_layout);
575 limit_filter_data.max_char_count = 0;
576 limit_filter_data.max_byte_count = CST_MAX_PHONE_NUMBER_LEN;
577 digits_filter_data.accepted = "0123456789+*#";
578 digits_filter_data.rejected = NULL;
579 elm_entry_markup_filter_append(ugd->dg_entry,
580 elm_entry_filter_accept_set, &digits_filter_data);
581 input_panel_cb = _cst_call_forwarding_input_panel_event_callback;
583 case CST_IME_CALL_BAR:
584 elm_entry_single_line_set(ugd->dg_entry, EINA_TRUE);
585 elm_entry_scrollable_set(ugd->dg_entry, EINA_TRUE);
586 elm_object_part_text_set(layout, "elm.text", T_(CST_STR_ENTER_PASSWORD));
587 panel_layout = ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY;
588 elm_entry_input_panel_layout_set(ugd->dg_entry, panel_layout);
589 elm_entry_password_set(ugd->dg_entry, EINA_TRUE);
590 limit_filter_data.max_char_count = 0;
591 limit_filter_data.max_byte_count = CST_MAX_PASSWORD_LEN;
594 ERR("Invalid ime type.");
598 elm_entry_markup_filter_append(ugd->dg_entry,
599 elm_entry_filter_limit_size, &limit_filter_data);
601 elm_entry_cnp_mode_set(ugd->dg_entry, ELM_CNP_MODE_PLAINTEXT);
603 if (input_string != NULL)
604 elm_entry_entry_set(ugd->dg_entry, input_string);
606 elm_entry_cursor_end_set(ugd->dg_entry);
608 imf_context = elm_entry_imf_context_get(ugd->dg_entry);
610 DBG("ugd->entry = 0x%x, imf_context = 0x%x", ugd->dg_entry, imf_context);
613 ecore_imf_context_input_panel_event_callback_add (imf_context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, input_panel_cb, ugd);
614 if (ime_type == CST_IME_PREFIX_DIAL && value == 0)
615 ecore_imf_context_input_panel_enabled_set(imf_context, EINA_FALSE);
618 evas_object_show(ugd->dg_entry);
619 elm_object_focus_set(ugd->dg_entry, EINA_TRUE);
621 evas_object_smart_callback_add(ugd->dg_entry, "changed",
622 __cst_changed_editfield_cb,
628 Evas_Object *_cst_create_ime_btn_layout(Evas_Object *parent,
629 Evas_Object *ef, Evas_Smart_Cb cb, void *cb_data)
631 retv_if((NULL == ef || NULL == parent), NULL);
633 Evas_Object *ly = NULL;
634 Evas_Object *btn = NULL;
635 Evas_Object *icon = NULL;
636 Eina_Bool ret = EINA_FALSE;
638 ly = elm_layout_add(parent);
639 retv_if(NULL == ly, NULL);
641 ret = elm_layout_file_set(ly, EDJ_NAME, "dialoguegroup/contact");
642 if (ret == EINA_FALSE) {
643 DBG("elm_layout_file_set() failed");
648 evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
649 evas_object_show(ly);
651 elm_object_part_content_set(ly, "editfield/sw", ef);
653 btn = elm_button_add(ly);
655 DBG("elm_button_add() failed");
660 icon = elm_icon_add(ly);
662 DBG("elm_icon_add() failed");
664 evas_object_del(btn);
668 elm_icon_file_set(icon, CST_CTRL_ICON_CONTACTS, NULL);
669 evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
670 elm_icon_resizable_set(icon, EINA_TRUE, EINA_TRUE);
671 elm_object_part_content_set(btn, "icon", icon);
672 elm_object_part_content_set(ly, "button/sw", btn);
673 elm_object_focus_set(ef, EINA_TRUE);
674 evas_object_smart_callback_add(btn, "clicked",