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.
17 #include <Elementary.h>
19 #include "cst-common.h"
20 #include "cst-common-string.h"
22 #include "cst-widget.h"
24 static Elm_Entry_Filter_Limit_Size limit_filter_data;
25 static Elm_Genlist_Item_Class *itc_ime = NULL;
27 int _cst_get_input_number(char *buffer, void *data)
29 ENTER(_cst_get_input_number);
30 CstUgData_t *ugd = (CstUgData_t *)data;
31 const char *entry_input;
33 Ecore_IMF_Context *imf_ctx;
35 entry_input = elm_entry_entry_get(ugd->dg_entry);
37 if (strlen(entry_input) == 0) {
38 imf_ctx = elm_entry_imf_context_get(ugd->dg_entry);
40 ecore_imf_context_input_panel_hide(imf_ctx);
42 error = _cst_create_error_popup(ugd->nf, CST_ERROR_ENTER_NUMBER);
44 evas_object_show(error);
48 DBG("IME input string = %s length=%d", entry_input, strlen(entry_input));
50 snprintf(buffer, CST_MAX_PHONE_NUMBER_LEN, "%s", entry_input);
51 return strlen(entry_input);
54 static Evas_Object *__cst_gl_icon_get_cf_ime(void *data, Evas_Object *obj, const char *part)
56 retv_if(data == NULL, NULL);
57 CstUgData_t *ugd = (CstUgData_t *)data;
59 if (!strcmp(part, "elm.icon")) {
60 return _cst_create_ime_editfield(ugd, obj, CST_IME_CALL_FORWARD, NULL);
66 static Evas_Object *__cst_create_cf_ime_genlist(CstUgData_t *ugd)
68 ENTER(__cst_create_cf_ime_genlist);
69 Elm_Object_Item *item = NULL;
72 genlist = elm_genlist_add(ugd->nf);
75 itc_ime = elm_genlist_item_class_new();
77 itc_ime->item_style = "1icon";
78 itc_ime->func.text_get = NULL;
79 itc_ime->func.content_get = __cst_gl_icon_get_cf_ime;
80 itc_ime->func.state_get = NULL;
81 itc_ime->func.del = NULL;
83 item = elm_genlist_item_append(genlist, itc_ime,
84 (void *)ugd, NULL, ELM_GENLIST_ITEM_NONE,
89 Evas_Object *_cst_create_cf_ime(Evas_Object *parent, char *edit_string, void *data)
91 ENTER(_cst_create_cf_ime);
93 CstUgData_t *ugd = (CstUgData_t *)data;
95 Evas_Object *genlist = __cst_create_cf_ime_genlist(ugd);