+static void __popup_eraser_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ __WFD_APP_FUNC_ENTER__;
+ elm_entry_entry_set(data, "");
+ __WFD_APP_FUNC_EXIT__;
+}
+
+static void _entry_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ __WFD_APP_FUNC_ENTER__;
+ if (elm_object_part_content_get(obj, "elm.swallow.clear")) {
+ if (elm_object_focus_get(obj)) {
+ if (elm_entry_is_empty(obj))
+ elm_object_signal_emit(obj, "elm,state,clear,hidden", "");
+ else
+ elm_object_signal_emit(obj, "elm,state,clear,visible", "");
+ }
+ }
+ __WFD_APP_FUNC_EXIT__;
+}
+
+static void _entry_focused_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ __WFD_APP_FUNC_ENTER__;
+
+ if (elm_object_part_content_get(obj, "elm.swallow.clear")) {
+ if (!elm_entry_is_empty(obj))
+ elm_object_signal_emit(obj, "elm,state,clear,visible", "");
+ else
+ elm_object_signal_emit(obj, "elm,state,clear,hidden", "");
+ }
+ elm_object_signal_emit(obj, "elm,state,focus,on", "");
+ __WFD_APP_FUNC_EXIT__;
+}
+
+static void _entry_keydown_cb(void *data, Evas *e, Evas_Object *obj,
+ void *event_info)
+{
+ __WFD_APP_FUNC_ENTER__;
+
+ Evas_Event_Key_Down *ev;
+ Evas_Object *entry = obj;
+
+ WFD_RET_IF(data == NULL, "Incorrect parameter data(NULL)\n");
+ WFD_RET_IF(event_info == NULL, "Incorrect parameter event_info(NULL)\n");
+ WFD_RET_IF(entry == NULL, "Incorrect parameter entry(NULL)\n");
+
+ ev = (Evas_Event_Key_Down *)event_info;
+
+ if (g_strcmp0(ev->key, "KP_Enter") == 0 || g_strcmp0(ev->key, "Return") == 0) {
+ Ecore_IMF_Context *imf_context;
+
+ imf_context = (Ecore_IMF_Context*)elm_entry_imf_context_get(entry);
+ if (imf_context) {
+ ecore_imf_context_input_panel_hide(imf_context);
+ }
+
+ elm_object_focus_set(entry, EINA_FALSE);
+ }
+}
+
+static char *__wfd_main_desc_label_get(void *data, Evas_Object *obj,
+ const char *part)
+{
+ __WFD_APP_FUNC_ENTER__;
+ if (obj == NULL || part == NULL) {
+ return NULL;
+ }
+ WFD_APP_LOG(WFD_APP_LOG_LOW, "wfd_rename desc\n");
+ char msg1[WFD_POP_STR_MAX_LEN] = {0, };
+ char msg2[WFD_POP_STR_MAX_LEN] = {0, };
+ wfd_appdata_t *ad = wfd_get_appdata();
+ WFD_RETV_IF(ad == NULL, NULL, "Incorrect parameter(NULL)\n");
+ wfd_connection_info_s *connection = ad->connection;
+ WFD_RETV_IF(connection == NULL, NULL, "Incorrect parameter(NULL)\n");
+
+ if (!g_strcmp0(part, "elm.text.multiline")) {
+ if (keypad_popup_timeout > 0) {
+ ad->timeout = keypad_popup_timeout;
+ }
+ _replace_1PS_2PD((char *)msg1, sizeof(msg1),
+ _("IDS_ST_BODY_CONNECT_WITH_PS_IN_PD_SECS_ABB"),
+ connection->peer_name, ad->timeout);
+
+ strcat(msg1, " ");
+ snprintf(msg2, sizeof(msg2),
+ _("IDS_WIFI_POP_ENTER_PIN_TO_CONNECT_TO_PS"),
+ connection->peer_name);
+ strcat(msg1, msg2);
+ WFD_APP_LOG(WFD_APP_LOG_LOW, "string %s", msg1);
+ __WFD_APP_FUNC_EXIT__;
+ return g_strdup(msg1);
+ }
+ __WFD_APP_FUNC_EXIT__;
+ return NULL;
+}
+
+static Evas_Object *__wfd_pin_entry_icon_get(void *data, Evas_Object *obj,
+ const char *part)
+{
+ __WFD_APP_FUNC_ENTER__;
+ if (obj == NULL || part == NULL) {
+ return NULL;
+ }
+ wfd_appdata_t *ad = wfd_get_appdata();
+ WFD_RETV_IF(ad == NULL, NULL, "Incorrect parameter(NULL)\n");
+ Evas_Object *entry = NULL;
+ Evas_Object *button = NULL;
+ Ecore_IMF_Context *imf_context;
+ if (g_strcmp0(part, "elm.icon.entry")) {
+ __WFD_APP_FUNC_EXIT__;
+ return NULL;
+ }
+ static Elm_Entry_Filter_Accept_Set accept_set = {"0123456789", NULL};
+ entry = elm_entry_add(obj);
+ elm_entry_single_line_set(entry, EINA_TRUE);
+ elm_object_style_set(entry, "editfield");
+ elm_entry_scrollable_set(entry, EINA_TRUE);
+
+ eext_entry_selection_back_event_allow_set(entry, EINA_TRUE);
+ evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT);
+ elm_entry_password_set(entry, EINA_TRUE);
+ elm_entry_prediction_allow_set(entry, EINA_FALSE);
+
+ elm_entry_markup_filter_append(entry,
+ elm_entry_filter_accept_set,&accept_set);
+ elm_entry_input_panel_layout_set(entry,
+ ELM_INPUT_PANEL_LAYOUT_DATETIME);
+ elm_object_signal_emit(entry, "elm,action,hide,search_icon", "");
+ elm_object_domain_translatable_part_text_set(entry, "elm.guide",
+ PACKAGE, _("IDS_WIFI_POP_PIN"));
+ elm_entry_input_panel_return_key_autoenabled_set(entry,EINA_TRUE);
+ elm_entry_input_panel_return_key_type_set(entry,
+ ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
+
+ ad->pin_entry = entry;
+ imf_context = (Ecore_IMF_Context*)elm_entry_imf_context_get(entry);
+ if (imf_context) {
+ ecore_imf_context_input_panel_return_key_type_set(imf_context,
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
+ }
+
+ button = elm_button_add(obj);
+ elm_object_style_set(button, "search_clear");
+ elm_object_focus_allow_set(button, EINA_FALSE);
+ elm_object_part_content_set(entry, "elm.swallow.clear", button);
+ evas_object_smart_callback_add(button, "clicked",
+ __popup_eraser_clicked_cb, entry);
+
+ elm_object_signal_emit (entry, "elm,action,hide,search_icon", "");
+ evas_object_smart_callback_add(entry, "changed",
+ _entry_changed_cb, NULL);
+ evas_object_smart_callback_add(entry, "preedit,changed",
+ _entry_changed_cb, NULL);
+ evas_object_smart_callback_add(entry, "focused",
+ _entry_focused_cb, NULL);
+ evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN,
+ _entry_keydown_cb, ad);
+
+ elm_object_content_set(obj,entry);
+ evas_object_show(entry);
+ evas_object_smart_callback_add(entry, "changed", _smart_ime_cb, NULL);
+ elm_object_focus_set(entry, EINA_TRUE);
+ __WFD_APP_FUNC_EXIT__;
+ return entry;
+}
+
+static void _chk_changed_cb(void *data, Evas_Object *obj, void *ei)
+{
+ __WFD_APP_FUNC_ENTER__;
+ if (obj == NULL || data == NULL) {
+ return;
+ }
+ Eina_Bool state = elm_check_state_get(obj);
+ if (state) {
+ elm_entry_password_set((Evas_Object *)data, EINA_FALSE);
+ } else {
+ elm_entry_password_set((Evas_Object *)data, EINA_TRUE);
+ }
+ __WFD_APP_FUNC_EXIT__;
+}
+
+static void _gl_pswd_check_box_sel(void *data, Evas_Object *obj, void *ei)
+{
+ __WFD_APP_FUNC_ENTER__;
+ Elm_Object_Item *item = NULL;
+ item = (Elm_Object_Item *)ei;
+ if (item == NULL) {
+ return;
+ }
+ wfd_appdata_t *ad = wfd_get_appdata();
+ if (ad == NULL) {
+ WFD_APP_LOG(WFD_APP_LOG_LOW, "Incorrect parameter(NULL)\n");
+ return;
+ }
+ Evas_Object *ck = elm_object_item_part_content_get(ei, "elm.icon.left");
+ elm_genlist_item_selected_set(item, EINA_FALSE);
+ Eina_Bool state = elm_check_state_get(ck);
+ elm_check_state_set(ck, !state);
+ if (ad) {
+ _chk_changed_cb(ad->pin_entry, ck, NULL);
+ }
+ __WFD_APP_FUNC_EXIT__;
+}
+
+static char *__wfd_password_label(void *data, Evas_Object *obj, const char *part)
+{
+ __WFD_APP_FUNC_ENTER__;
+
+ if (data == NULL || part == NULL) {
+ return NULL;
+ }
+ WFD_APP_LOG(WFD_APP_LOG_LOW, "Part %s", part);
+
+ if (!g_strcmp0(part, "elm.text.main.right")) {
+ __WFD_APP_FUNC_EXIT__;
+ return g_strdup(" Show password");
+ }
+ __WFD_APP_FUNC_EXIT__;
+ return NULL;
+}
+
+static Evas_Object *__wfd_password_check(void *data, Evas_Object *obj,
+ const char *part)
+{
+ __WFD_APP_FUNC_ENTER__;
+ if (obj == NULL || part == NULL) {
+ return NULL;
+ }
+ wfd_appdata_t *ad = wfd_get_appdata();
+ WFD_RETV_IF(ad == NULL, NULL, "Incorrect parameter(NULL)\n");
+ Evas_Object *check = NULL;
+
+ WFD_APP_LOG(WFD_APP_LOG_LOW, "Part %s", part);
+
+ if (!g_strcmp0(part, "elm.icon.left")) {
+ check = elm_check_add(obj);
+ evas_object_propagate_events_set(check, EINA_FALSE);
+ evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(check,
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_smart_callback_add(check, "changed",
+ _chk_changed_cb, ad->pin_entry);
+ elm_object_focus_allow_set(check, EINA_FALSE);
+ __WFD_APP_FUNC_EXIT__;
+ return check;
+ }
+ __WFD_APP_FUNC_EXIT__;
+ return check;
+}
+
+