void *event_info);
extern genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
+extern content_size_info_t g_content_size_info;
static void ctxpopup_dismissed_cb(void *data, Evas_Object *obj,
void *event_info)
Evas_Coord x, y, w , h;
evas_object_geometry_get(obj, &x, &y, &w, &h);
- evas_object_move(eap_data->sub_popup, x + (w / 2), y + h);
+ evas_object_move(eap_data->sub_popup, x + (w / 2), y);
}
static void _gl_editbox_sel_cb(void *data, Evas_Object *obj, void *event_info)
elm_object_item_disabled_set(it, EINA_TRUE);
}
-
i++;
}
move_dropdown(eap_data, btn);
evas_object_show(ctxpopup);
}
-static void _gl_eap_type_btn_cb(void *data, Evas_Object *obj, void *event_info)
+static void _gl_eap_type_item_sel_cb(void *data, Evas_Object *obj, void *event_info)
{
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- eap_connect_data_t *eap_data = (eap_connect_data_t *) data;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
- if (item)
- elm_genlist_item_selected_set(item, EINA_FALSE);
+ if (!item || !eap_data)
+ return;
- if (keypad_state == FALSE) {
- _create_eap_type_list(eap_data, obj);
+ elm_genlist_item_selected_set(item, EINA_FALSE);
- click.btn_click[EAP_TYPE_BTN] = FALSE;
- click.btn_obj[EAP_TYPE_BTN] = NULL;
- } else {
- click.btn_click[EAP_TYPE_BTN] = TRUE;
- click.btn_obj[EAP_TYPE_BTN] = obj;
- }
+ if (keypad_state == FALSE)
+ _create_eap_type_list(eap_data, obj);
}
static char *_gl_eap_type_text_get(void *data, Evas_Object *obj, const char *part)
{
eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
+ eap_type_t eap_type = __common_eap_connect_popup_get_eap_type(eap_data->ap);
- if (!g_strcmp0(part, g_genlist_info[WIFI_GENLIST_2LINE_STYLE].sub_text_part))
- return g_strdup(sc(eap_data->str_pkg_name, I18N_TYPE_EAP_method));
-
- return NULL;
-}
-
-static Evas_Object *_gl_eap_type_content_get(void *data,
- Evas_Object *obj, const char *part)
-{
- eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
- eap_type_t sel_sub_item_id = __common_eap_connect_popup_get_eap_type(eap_data->ap);
- Evas_Object *btn = NULL;
- Evas_Object *ly = NULL;
- char buf[100];
- int ug_type;
+ if (!eap_data)
+ return NULL;
- if (!strcmp(part, "elm.swallow.icon.0")) { // TODO
- ug_type = common_util_get_ug_type();
- if (ug_type != UG_VIEW_OOBE) {
- ly = elm_layout_add(obj);
- elm_layout_file_set(ly, CUSTOM_EDITFIELD_PATH,
- "eap_dropdown_button");
- }
- btn = elm_button_add(obj);
- g_snprintf(buf, sizeof(buf), "%s",
- list_eap_type[sel_sub_item_id].name);
+ if (!g_strcmp0(part, g_genlist_info[WIFI_GENLIST_2LINE_STYLE].text_part))
+ return g_strdup(sc(eap_data->str_pkg_name, I18N_TYPE_EAP_method));
- elm_object_text_set(btn, buf);
- elm_object_style_set(btn, ug_type == UG_VIEW_OOBE ?
- "cancel" : "dropdown/label");
- evas_object_propagate_events_set(btn, EINA_FALSE);
- evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(btn, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_smart_callback_add(btn, "clicked",
- _gl_eap_type_btn_cb, eap_data);
+ if (!g_strcmp0(part, g_genlist_info[WIFI_GENLIST_2LINE_STYLE].sub_text_part))
+ return g_strdup(list_eap_type[eap_type].name);
- if (ug_type != UG_VIEW_OOBE) {
- elm_layout_content_set(ly, "btn", btn);
- return ly;
- }
- return btn;
- }
return NULL;
}
evas_object_show(ctxpopup);
}
-static void _gl_eap_auth_btn_cb(void *data, Evas_Object *obj, void *event_info)
+static void _gl_eap_auth_item_sel_cb(void *data, Evas_Object *obj, void *event_info)
{
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- eap_connect_data_t *eap_data = (eap_connect_data_t *) data;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
- if (item)
- elm_genlist_item_selected_set(item, EINA_FALSE);
+ if (!item || !eap_data)
+ return;
- if (keypad_state == FALSE) {
- _create_eap_auth_list(eap_data, obj);
+ elm_genlist_item_selected_set(item, EINA_FALSE);
- click.btn_click[EAP_AUTH_BTN] = FALSE;
- click.btn_obj[EAP_AUTH_BTN] = NULL;
- } else {
- click.btn_click[EAP_AUTH_BTN] = TRUE;
- click.btn_obj[EAP_AUTH_BTN] = obj;
- }
+ if (keypad_state == FALSE)
+ _create_eap_auth_list(eap_data, obj);
}
static char *_gl_eap_auth_text_get(void *data, Evas_Object *obj, const char *part)
{
eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
+ eap_auth_t eap_auth = __common_eap_connect_popup_get_auth_type(eap_data->ap);
+
+ if (!g_strcmp0(part, g_genlist_info[WIFI_GENLIST_2LINE_STYLE].text_part))
+ return g_strdup(sc(eap_data->str_pkg_name, I18N_TYPE_Phase_2_authentication));
if (!g_strcmp0(part, g_genlist_info[WIFI_GENLIST_2LINE_STYLE].sub_text_part)) {
- return g_strdup(sc(eap_data->str_pkg_name,
- I18N_TYPE_Phase_2_authentication));
+ if (eap_auth == EAP_SEC_AUTH_NONE)
+ return g_strdup(sc(PACKAGE, I18N_TYPE_None));
+ else
+ return g_strdup(list_eap_auth[eap_auth].name);
}
return NULL;
}
-static Evas_Object *_gl_eap_auth_content_get(void *data,
- Evas_Object *obj, const char *part)
-{
- eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
- eap_auth_t sel_sub_item_id = __common_eap_connect_popup_get_auth_type(eap_data->ap);
- Evas_Object *btn = NULL;
- Evas_Object *ly = NULL;
- char buf[100];
- int ug_type;
-
- if (!strcmp(part, "elm.swallow.icon.0")) { //TODO
- ug_type = common_util_get_ug_type();
- if (ug_type != UG_VIEW_OOBE) {
- ly = elm_layout_add(obj);
- elm_layout_file_set(ly, CUSTOM_EDITFIELD_PATH, "eap_dropdown_button");
- }
-
- btn = elm_button_add(obj);
- if (sel_sub_item_id == EAP_SEC_AUTH_NONE) {
- g_snprintf(buf, sizeof(buf), "%s",
- sc(PACKAGE, I18N_TYPE_None));
- } else {
- g_snprintf(buf, sizeof(buf), "%s",
- list_eap_auth[sel_sub_item_id].name);
- }
-
- elm_object_domain_translatable_text_set(btn, PACKAGE, buf);
- elm_object_style_set(btn, ug_type == UG_VIEW_OOBE ? "cancel" : "dropdown/label");
- evas_object_propagate_events_set(btn, EINA_FALSE);
- evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(btn, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_smart_callback_add(btn, "clicked",
- _gl_eap_auth_btn_cb, eap_data);
-
- if (ug_type != UG_VIEW_OOBE) {
- elm_layout_content_set(ly, "btn", btn);
- return ly;
- }
- return btn;
- }
- return NULL;
-}
-
static void _gl_eap_entry_key_enter_cb(void *data, Evas_Object *obj, void *event_info)
{
common_utils_entry_info_t *entry_info = (common_utils_entry_info_t *)data;
return NULL;
}
+// iot common
+static Evas_Object *__get_eap_editfield_layout_common(Evas_Object *parent, const char *title_txt)
+{
+ Evas_Object *layout = elm_layout_add(parent);
+
+ elm_layout_file_set(layout, CUSTOM_GENLIST_PATH, "gl_custom_common_item");
+ evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ elm_object_part_text_set(layout, "elm.text.title", dgettext(PACKAGE, title_txt));
+
+ return layout;
+}
+
+static Evas_Object *__get_eap_editfield_box(Evas_Object *parent, const char *title_txt)
+{
+ Evas_Object *entry = NULL;
+ Evas_Object *box = NULL;
+ Evas_Object *tpad = NULL;
+ Evas_Object *lpad = NULL;
+ Evas_Object *label = NULL;
+ char buf[MAX_LABEL_LENGTH] = {0, };
+
+ entry = elm_box_add(parent);
+ elm_box_align_set(entry, 0.0, 0.0);
+ evas_object_size_hint_min_set(entry, 0, ELM_SCALE_SIZE(60));
+ elm_object_focus_set(entry, EINA_FALSE);
+
+ tpad = evas_object_rectangle_add(entry);
+ evas_object_size_hint_min_set(tpad, 0, ELM_SCALE_SIZE(10));
+ evas_object_show(tpad);
+ elm_box_pack_end(entry, tpad);
+
+ box = elm_box_add(entry);
+ evas_object_size_hint_align_set(box, 0.0, 0.0);
+ elm_box_horizontal_set(box, EINA_TRUE);
+ elm_box_pack_end(entry, box);
+ evas_object_show(box);
+
+ lpad = evas_object_rectangle_add(box);
+ evas_object_size_hint_min_set(lpad, ELM_SCALE_SIZE(15), 0);
+ evas_object_show(lpad);
+ elm_box_pack_end(box, lpad);
+ evas_object_show(box);
+
+ label = elm_label_add(box);
+ snprintf(buf, MAX_LABEL_LENGTH, "<font_size=%d>%s</font_size>",
+ g_content_size_info.mid_font,
+ dgettext(PACKAGE, title_txt));
+ elm_object_text_set(label, buf);
+ evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(label, 0.9, EVAS_HINT_EXPAND);
+ elm_box_pack_end(box, label);
+ evas_object_show(label);
+
+ return entry;
+}
+
+static Evas_Object *__get_eap_editfield_layout(Evas_Object *box)
+{
+ Evas_Object *layout = NULL;
+
+ layout = elm_layout_add(box);
+ elm_layout_theme_set(layout, "layout", "editfield", "singleline");
+ evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ elm_box_pack_end(box, layout);
+
+ evas_object_show(layout);
+ evas_object_show(box);
+
+ return layout;
+}
+
+static int __get_eap_keypad_info(entry_id_type_t entry_id, eap_type_t eap_type,
+ Elm_Input_Panel_Layout *panel_type, int *return_key_type, Eina_Bool *hide_entry_txt)
+{
+ switch (entry_id) {
+ case ENTRY_TYPE_USER_ID:
+ *panel_type = ELM_INPUT_PANEL_LAYOUT_NORMAL;
+ *return_key_type = (eap_type == EAP_SEC_TYPE_TLS)
+ ? ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE
+ : ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT;
+ break;
+ case ENTRY_TYPE_PASSWORD:
+ *panel_type = ELM_INPUT_PANEL_LAYOUT_PASSWORD;
+ *hide_entry_txt = EINA_TRUE;
+ *return_key_type = ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE;
+ break;
+ default:
+ return -1;
+ }
+ return 0;
+}
+
static Evas_Object *_gl_eap_entry_item_content_get(void *data, Evas_Object *obj, const char *part)
{
common_utils_entry_info_t *entry_info = (common_utils_entry_info_t *)data;
return NULL;
if (g_strcmp0(part, g_genlist_info[WIFI_GENLIST_FULL_STYLE].content_part) == 0) {
- Evas_Object *entry = NULL;
+
+// return __get_editfield(obj, "test tiltle", "test guide");
+
Evas_Object *box = NULL;
- Evas_Object *tpad = NULL;
- Evas_Object *lpad = NULL;
- Evas_Object *label = NULL;
Evas_Object *layout = NULL;
Evas_Object *editfield = NULL;
- char buf[MAX_LABEL_LENGTH] = {0, };
- char *guide_txt = NULL;
char *accepted = NULL;
Eina_Bool hide_entry_txt = EINA_FALSE;
Elm_Input_Panel_Layout panel_type;
int return_key_type;
eap_type_t eap_type;
- int height = 60;
+ UG_TYPE ug_type = common_util_get_ug_type();
eap_type = __common_eap_connect_popup_get_eap_type(entry_info->ap);
static Elm_Entry_Filter_Limit_Size limit_filter_data;
- switch (entry_info->entry_id) {
- case ENTRY_TYPE_USER_ID:
- panel_type = ELM_INPUT_PANEL_LAYOUT_NORMAL;
- guide_txt = entry_info->guide_txt;
-
- if (eap_type == EAP_SEC_TYPE_TLS)
- return_key_type = ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE;
- else
- return_key_type = ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT;
-
- break;
- case ENTRY_TYPE_PASSWORD:
- panel_type = ELM_INPUT_PANEL_LAYOUT_PASSWORD;
- guide_txt = entry_info->guide_txt;
- hide_entry_txt = EINA_TRUE;
- return_key_type = ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE;
- break;
- default:
+ if (__get_eap_keypad_info(entry_info->entry_id, eap_type,
+ &panel_type, &return_key_type, &hide_entry_txt) < 0) {
+ ERROR_LOG(UG_NAME_ERR, "Failed to get EAP keypad info");
return NULL;
}
- entry = elm_box_add(obj);
- elm_box_align_set(entry, 0.0, 0.0);
-
- tpad = evas_object_rectangle_add(entry);
- evas_object_size_hint_min_set(tpad, 0, ELM_SCALE_SIZE(10));
- evas_object_show(tpad);
- elm_box_pack_end(entry, tpad);
-
- box = elm_box_add(entry);
- evas_object_size_hint_align_set(box, 0.0, 0.0);
- elm_box_horizontal_set(box, EINA_TRUE);
- elm_box_pack_end(entry, box);
- evas_object_show(box);
-
- lpad = evas_object_rectangle_add(box);
- evas_object_size_hint_min_set(lpad, ELM_SCALE_SIZE(15), 0);
- evas_object_show(lpad);
- elm_box_pack_end(box, lpad);
- evas_object_show(box);
-
- label = elm_label_add(box);
- snprintf(buf, MAX_LABEL_LENGTH, "<font_size=30>%s</font_size>",
- dgettext(PACKAGE, entry_info->title_txt));
- elm_object_text_set(label, buf);
- evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(label, 0.9, EVAS_HINT_EXPAND);
- elm_box_pack_end(box, label);
- evas_object_show(label);
-
- layout = elm_layout_add(entry);
- elm_layout_theme_set(layout, "layout", "editfield", "singleline");
- evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ if (ug_type == UG_VIEW_IOT_COMMON) {
+ layout = __get_eap_editfield_layout_common(obj, entry_info->title_txt);
+ } else {
+ box = __get_eap_editfield_box(obj, entry_info->title_txt);
+ layout = __get_eap_editfield_layout(box);
+ }
editfield = elm_entry_add(layout);
elm_entry_single_line_set(editfield, EINA_TRUE);
elm_entry_password_set(editfield, hide_entry_txt);
elm_entry_prediction_allow_set(editfield, EINA_FALSE);
elm_entry_autocapital_type_set(editfield, ELM_AUTOCAPITAL_TYPE_NONE);
-
elm_object_domain_translatable_part_text_set(editfield, "elm.guide",
- PACKAGE, guide_txt);
+ PACKAGE, entry_info->guide_txt);
if (entry_info->entry_txt && (strlen(entry_info->entry_txt) > 0))
elm_entry_entry_set(editfield, entry_info->entry_txt);
evas_object_smart_callback_add(editfield, "maxlength,reached", _gl_eap_entry_maxlength_reached, NULL);
elm_object_part_content_set(layout, "elm.swallow.content", editfield);
- evas_object_show(layout);
- elm_box_pack_end(entry, layout);
-
- evas_object_size_hint_min_set(entry, 0, ELM_SCALE_SIZE(height));
- elm_object_focus_set(entry, EINA_FALSE);
- evas_object_show(entry);
if (entry_info->entry_id == ENTRY_TYPE_PASSWORD)
g_pwd_entry = editfield;
- return entry;
+ return (ug_type == UG_VIEW_IOT_COMMON ? layout : box);
} else if (g_strcmp0(part, "elm.icon.eraser") == 0) { // TODO
Evas_Object *btn = elm_button_add(obj);
elm_object_style_set(btn, "editfield_clear");
{
g_eap_type_itc.item_style = g_genlist_info[WIFI_GENLIST_2LINE_STYLE].style_name;
g_eap_type_itc.func.text_get = _gl_eap_type_text_get;
- g_eap_type_itc.func.content_get = _gl_eap_type_content_get;
+ g_eap_type_itc.func.content_get = NULL;
g_eap_type_itc.func.state_get = NULL;
g_eap_type_itc.func.del = NULL;
g_eap_auth_itc.item_style = g_genlist_info[WIFI_GENLIST_2LINE_STYLE].style_name;
g_eap_auth_itc.func.text_get = _gl_eap_auth_text_get;
- g_eap_auth_itc.func.content_get = _gl_eap_auth_content_get;
+ g_eap_auth_itc.func.content_get = NULL;
g_eap_auth_itc.func.state_get = NULL;
g_eap_auth_itc.func.del = NULL;
view_list, &g_eap_type_itc,
eap_data, NULL,
ELM_GENLIST_ITEM_NONE,
- _gl_eap_item_sel_cb, eap_data);
+ _gl_eap_type_item_sel_cb, eap_data);
}
switch (new_type) {
eap_data->eap_auth_item = elm_genlist_item_insert_after(
view_list, &g_eap_auth_itc, eap_data, NULL,
insert_after_item, ELM_GENLIST_ITEM_NONE,
- _gl_eap_item_sel_cb, eap_data);
+ _gl_eap_auth_item_sel_cb, eap_data);
}
} else {
_delete_eap_auth_item(eap_data);