Some genlist styles are different between profiles.
So, this patch inititializes genlist style according to profile type.
Change-Id: Ia10366ea5e8ade44a58e9216272f143c6d44792b
Name: wifi-efl-ug
Summary: Wi-Fi UI Gadget for TIZEN
-Version: 1.0.244
+Version: 1.0.245
Release: 1
Group: App/Network
License: Flora-1.1
static void _eap_popup_keypad_on_cb(void *data, Evas_Object *obj,
void *event_info);
+extern genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
+
static void ctxpopup_dismissed_cb(void *data, Evas_Object *obj,
void *event_info)
{
{
eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
- if (!g_strcmp0(part, "elm.text.sub")) {
+ 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_User_Certificate));
}
char buf[100];
int ug_type;
+ // TODO
if (!strcmp(part, "elm.swallow.icon.0")) {
ug_type = common_util_get_ug_type();
if (ug_type != UG_VIEW_OOBE) {
{
eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
- if (!g_strcmp0(part, "elm.text.sub"))
+ 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;
char buf[100];
int ug_type;
- if (!strcmp(part, "elm.swallow.icon.0")) {
+ 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);
{
eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
- if (!g_strcmp0(part, "elm.text.sub")) {
+ 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));
}
char buf[100];
int ug_type;
- if (!strcmp(part, "elm.swallow.icon.0")) {
+ 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);
if (!entry_info)
return NULL;
- if (!g_strcmp0(part, "elm.text.sub"))
+ if (!g_strcmp0(part, g_genlist_info[WIFI_GENLIST_FULL_STYLE].sub_text_part))
return g_strdup(dgettext(PACKAGE, entry_info->title_txt));
return NULL;
if (!entry_info)
return NULL;
- if (g_strcmp0(part, "elm.swallow.content") == 0) {
+ if (g_strcmp0(part, g_genlist_info[WIFI_GENLIST_FULL_STYLE].content_part) == 0) {
Evas_Object *entry = NULL;
Evas_Object *box = NULL;
Evas_Object *tpad = NULL;
g_pwd_entry = editfield;
return entry;
- } else if (g_strcmp0(part, "elm.icon.eraser") == 0) {
+ } else if (g_strcmp0(part, "elm.icon.eraser") == 0) { // TODO
Evas_Object *btn = elm_button_add(obj);
elm_object_style_set(btn, "editfield_clear");
evas_object_smart_callback_add(btn, "clicked", _gl_eap_entry_eraser_clicked_cb, entry_info);
{
char *str_pkg_name = (char *)data;
- if (!strcmp("elm.text", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) {
char buf[1024];
snprintf(buf, 1023, "%s", sc(str_pkg_name, I18N_TYPE_Show_password));
return strdup(buf);
{
Evas_Object *check = NULL;
- if (!strcmp("elm.swallow.icon", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].content_part, part)) {
check = elm_check_add(obj);
if (common_util_get_ug_type() == UG_VIEW_OOBE)
elm_object_style_set(check, "oobe-casual");
static void __common_eap_connect_popup_init_item_class(void *data)
{
- g_eap_type_itc.item_style = WIFI_GENLIST_2LINE_BOTTOM_SWALLOW_STYLE;
+ 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.state_get = NULL;
g_eap_type_itc.func.del = NULL;
- g_eap_auth_itc.item_style = WIFI_GENLIST_2LINE_BOTTOM_SWALLOW_STYLE;
+ 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.state_get = NULL;
g_eap_auth_itc.func.del = NULL;
- g_eap_user_cert_itc.item_style = WIFI_GENLIST_2LINE_BOTTOM_SWALLOW_STYLE;
+ g_eap_user_cert_itc.item_style = g_genlist_info[WIFI_GENLIST_2LINE_STYLE].style_name;
g_eap_user_cert_itc.func.text_get = _gl_eap_user_cert_text_get;
g_eap_user_cert_itc.func.content_get = _gl_eap_user_cert_content_get;
g_eap_user_cert_itc.func.state_get = NULL;
g_eap_user_cert_itc.func.del = NULL;
- g_eap_entry_itc.item_style = WIFI_GENLIST_FULL_STYLE;
+ g_eap_entry_itc.item_style = g_genlist_info[WIFI_GENLIST_FULL_STYLE].style_name;
g_eap_entry_itc.func.text_get = _gl_eap_entry_item_text_get;
g_eap_entry_itc.func.content_get = _gl_eap_entry_item_content_get;
g_eap_entry_itc.func.state_get = NULL;
g_eap_entry_itc.func.del = _gl_eap_entry_item_del;
- g_eap_chkbox_itc.item_style = WIFI_GENLIST_1LINE_TEXT_ICON_STYLE;
+ g_eap_chkbox_itc.item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name;
g_eap_chkbox_itc.func.text_get = _gl_eap_chkbox_item_text_get;
g_eap_chkbox_itc.func.content_get = _gl_eap_chkbox_item_content_get;
g_eap_chkbox_itc.func.state_get = NULL;
auth_type = __common_eap_connect_popup_get_auth_type(ap);
item = common_utils_add_2_line_txt_disabled_item(view_list,
- WIFI_GENLIST_2LINE_TOP_TEXT_STYLE,
+ g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name,
sc(str_pkg_name, I18N_TYPE_EAP_method),
list_eap_type[eap_type].name);
eap_info_list_data->eap_method_item = item;
eap_type == EAP_SEC_TYPE_TTLS) {
/* Add EAP phase2 authentication */
item = common_utils_add_2_line_txt_disabled_item(view_list,
- WIFI_GENLIST_2LINE_TOP_TEXT_STYLE,
+ g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name,
sc(str_pkg_name, I18N_TYPE_Phase_2_authentication),
list_eap_auth[auth_type].name);
eap_info_list_data->eap_auth_item = item;
}
item = common_utils_add_2_line_txt_disabled_item(view_list,
- WIFI_GENLIST_2LINE_TOP_TEXT_STYLE,
+ g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name,
sc(str_pkg_name, I18N_TYPE_User_Certificate),
temp_str);
eap_info_list_data->user_cert_item = item;
return NULL;
}
item = common_utils_add_2_line_txt_disabled_item(view_list,
- WIFI_GENLIST_2LINE_TOP_TEXT_STYLE,
+ g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name,
sc(str_pkg_name, I18N_TYPE_Identity),
temp_str);
eap_info_list_data->id_item = item;
static int curr_unfocuc_cursor_pos = 0;
static char *ip_info_text_list[ENTRY_TYPE_MAX];
+extern genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
+
static void _ip_info_set_current_unfocussed_entry(Evas_Object *entry)
{
if (entry == NULL)
retvm_if(NULL == data || NULL == part, NULL);
full_ip_info_t *ip_data = (full_ip_info_t *) data;
- if (!strcmp("elm.text", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) {
ip_info_list_t *ip_info_list_data = ip_data->ip_info_list;
#ifdef ACCESSIBLITY_FEATURE
char buf[100];
ip_info_list_t *ip_info_list_data = ip_data->ip_info_list;
Evas_Object *toggle_btn = NULL;
- if (!strcmp("elm.swallow.end", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_content_part, part)) {
toggle_btn = elm_check_add(obj);
elm_object_style_set(toggle_btn, "on&off");
elm_object_focus_allow_set(toggle_btn, EINA_FALSE);
ip_info_list_data->input_panel_cb_data = input_panel_cb_data;
ip_toggle_itc = elm_genlist_item_class_new();
- ip_toggle_itc->item_style = WIFI_GENLIST_1LINE_TEXT_ICON_STYLE;
+ ip_toggle_itc->item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name;
ip_toggle_itc->func.text_get = _ip_info_iptoggle_text_get;
ip_toggle_itc->func.content_get = _ip_info_iptoggle_content_get;
ip_toggle_itc->func.state_get = NULL;
ip_toggle_itc->func.del = NULL;
description_itc = elm_genlist_item_class_new();
- description_itc->item_style = WIFI_GENLIST_FULL_STYLE;
+ description_itc->item_style = g_genlist_info[WIFI_GENLIST_FULL_STYLE].style_name;
description_itc->func.text_get = NULL;
description_itc->func.content_get = _ip_info_detail_description_content_get;
description_itc->func.state_get = NULL;
description_itc->func.del = _ip_info_detail_description_del;
ip_entry_itc = elm_genlist_item_class_new();
- ip_entry_itc->item_style = WIFI_GENLIST_FULL_STYLE;
+ ip_entry_itc->item_style = g_genlist_info[WIFI_GENLIST_FULL_STYLE].style_name;
ip_entry_itc->func.text_get = NULL;
ip_entry_itc->func.content_get = _ip_info_entry_item_content_get;
ip_entry_itc->func.state_get = NULL;
static gboolean wps_options_click = FALSE;
static gboolean keypad_state = FALSE;
+extern genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
+
static void __popup_entry_changed_cb(void* data, Evas_Object* obj, void* event_info)
{
Evas_Object *btn_ok = NULL;
static char *_gl_wps_text_get(void *data, Evas_Object *obj, const char *part)
{
- if (!strcmp("elm.text", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) {
char buf[1024];
snprintf(buf, 1023, "%s", sc(PACKAGE, (int)data));
return g_strdup(dgettext(PACKAGE, buf));
elm_scroller_content_min_limit(genlist, EINA_FALSE, EINA_TRUE);
evas_object_smart_callback_add(genlist, "realized", _gl_realized, NULL);
- wps_itc.item_style = WIFI_GENLIST_1LINE_TEXT_STYLE;
+ wps_itc.item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name;
wps_itc.func.text_get = _gl_wps_text_get;
wps_itc.func.content_get = NULL;
wps_itc.func.state_get = NULL;
static char *_passwd_popup_wps_item_text_get(void *data, Evas_Object *obj,
const char *part)
{
- if (!strcmp("elm.text", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) {
char buf[1024];
snprintf(buf, 1023, "%s", sc(PACKAGE, I18N_TYPE_WPS));
return strdup(buf);
{
Evas_Object *icon = NULL;
- if (!strcmp("elm.swallow.icon", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].content_part, part)) {
/* image */
icon = elm_image_add(obj);
retvm_if(NULL == icon, NULL);
static Elm_Entry_Filter_Limit_Size limit_filter_data;
pswd_popup_t *pswd_popup_data = (pswd_popup_t *)data;
- if (!g_strcmp0(part, "elm.swallow.content")) {
+ if (!g_strcmp0(part, g_genlist_info[WIFI_GENLIST_FULL_STYLE].content_part)) {
editfield = elm_layout_add(obj);
elm_layout_theme_set(editfield, "layout", "editfield", "singleline");
evas_object_size_hint_align_set(editfield, EVAS_HINT_FILL, 0.0);
static char *_gl_pswd_check_box_item_text_get(void *data, Evas_Object *obj,
const char *part)
{
- if (!strcmp("elm.text", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) {
char buf[1024];
snprintf(buf, 1023, "%s", sc(PACKAGE, I18N_TYPE_Show_password));
return strdup(buf);
Evas_Object *check = NULL;
pswd_popup_t *pswd_popup_data = (pswd_popup_t *)data;
- if (!strcmp("elm.swallow.icon", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].content_part, part)) {
check = elm_check_add(obj);
if (common_util_get_ug_type() == UG_VIEW_OOBE)
elm_object_style_set(check, "oobe-casual");
evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
/* Entry genlist item */
- g_pswd_entry_itc.item_style = WIFI_GENLIST_SWALLOW_CONTENT_STYLE;
+ g_pswd_entry_itc.item_style = g_genlist_info[WIFI_GENLIST_FULL_STYLE].style_name;
g_pswd_entry_itc.func.text_get = NULL;
g_pswd_entry_itc.func.content_get = _gl_pswd_entry_item_content_get;
g_check_box_itc.func.state_get = NULL;
NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
/* Checkbox genlist item */
- g_check_box_itc.item_style = WIFI_GENLIST_1LINE_TEXT_ICON_STYLE;
+ g_check_box_itc.item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name;
g_check_box_itc.func.text_get = _gl_pswd_check_box_item_text_get;
g_check_box_itc.func.content_get = _gl_pswd_check_box_item_content_get;
g_check_box_itc.func.state_get = NULL;
if (popup_info->show_wps_btn) {
/* WPS options genlist item */
- g_wps_itc.item_style = WIFI_GENLIST_1LINE_TEXT_ICON_STYLE;
+ g_wps_itc.item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name;
g_wps_itc.func.text_get = _passwd_popup_wps_item_text_get;
g_wps_itc.func.content_get = _passwd_popup_wps_item_content_get;
g_wps_itc.func.state_get = NULL;
static Eina_Bool is_portrait_mode = EINA_TRUE;
static Ecore_Timer *scan_update_timer = NULL;
+genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
+
static char *__common_utils_2line_text_get(void *data, Evas_Object *obj, const char *part)
{
two_line_disp_data_t *item_data = (two_line_disp_data_t *)data;
- if (!strcmp("elm.text", part))
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part))
return g_strdup(item_data->title_str);
- else if (!strcmp("elm.text.sub", part))
+ else if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_text_part, part))
return g_strdup(item_data->info_str);
return NULL;
}
}
+bool is_common_profile(void)
+{
+ char *profile = NULL;
+
+ if (system_info_get_platform_string("http://tizen.org/feature/profile", &profile) < 0)
+ return false;
+
+ if (profile == NULL)
+ return false;
+
+ if (strncmp(profile, "common", strlen("common")) == 0) {
+ free(profile);
+ return true;
+ }
+
+ free(profile);
+ return false;
+}
+
+static void _init_genlist_1line_style(void)
+{
+ g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name = GENLIST_STYLE_1LINE;
+ g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part = GENLIST_PART_ELM_TEXT;
+ g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_text_part = GENLIST_PART_ELM_TEXT_END;
+ g_genlist_info[WIFI_GENLIST_1LINE_STYLE].content_part = GENLIST_PART_ELM_ICON;
+ g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_content_part = GENLIST_PART_ELM_END;
+}
+
+static void _init_genlist_2line_style(void)
+{
+ g_genlist_info[WIFI_GENLIST_2LINE_STYLE].style_name = GENLIST_STYLE_2LINE;
+ g_genlist_info[WIFI_GENLIST_2LINE_STYLE].text_part = GENLIST_PART_ELM_TEXT;
+ g_genlist_info[WIFI_GENLIST_2LINE_STYLE].sub_text_part = GENLIST_PART_ELM_TEXT_SUB;
+ g_genlist_info[WIFI_GENLIST_2LINE_STYLE].content_part = GENLIST_PART_ELM_ICON;
+ g_genlist_info[WIFI_GENLIST_2LINE_STYLE].sub_content_part = GENLIST_PART_ELM_END;
+}
+
+static void _init_genlist_type1_style(void)
+{
+ g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name = GENLIST_STYLE_TYPE1;
+ g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part = GENLIST_PART_ELM_TEXT;
+ g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_text_part = GENLIST_PART_ELM_TEXT_SUB;
+ g_genlist_info[WIFI_GENLIST_1LINE_STYLE].content_part = GENLIST_PART_ELM_SWALLOW_ICON;
+ g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_content_part = GENLIST_PART_ELM_SWALLOW_END;
+}
+
+// type2
+// -------------------------------------------------------------------------------------------
+// | | elm.text.sub | elm.text.sub.end | |
+// | elm.swallow.icon |----------------------------------------------------| elm.swallow.end |
+// | | elm.swallow.icon.0 | elm.text | elm.swallow.icon.1 | |
+// -------------------------------------------------------------------------------------------
+static void _init_genlist_type2_style(void)
+{
+ g_genlist_info[WIFI_GENLIST_2LINE_STYLE].style_name = GENLIST_STYLE_TYPE2;
+ g_genlist_info[WIFI_GENLIST_2LINE_STYLE].text_part = GENLIST_PART_ELM_TEXT_SUB;
+ g_genlist_info[WIFI_GENLIST_2LINE_STYLE].sub_text_part = GENLIST_PART_ELM_TEXT;
+ g_genlist_info[WIFI_GENLIST_2LINE_STYLE].content_part = GENLIST_PART_ELM_SWALLOW_ICON;
+ g_genlist_info[WIFI_GENLIST_2LINE_STYLE].sub_content_part = GENLIST_PART_ELM_SWALLOW_END;
+}
+
+static void _init_genlist_multiline_style(void)
+{
+ g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].style_name = GENLIST_STYLE_MULTILINE;
+ g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].text_part = GENLIST_PART_ELM_TEXT;
+ g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].sub_text_part = GENLIST_PART_ELM_TEXT_MULTILINE;
+ g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].content_part = NULL;
+ g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].sub_content_part = GENLIST_PART_ELM_SWALLOW_END;
+}
+
+static void _init_genlist_group_index_style(void)
+{
+ g_genlist_info[WIFI_GENLIST_GROUP_INDEX_STYLE].style_name = GENLIST_STYLE_GROUP_INDEX;
+ g_genlist_info[WIFI_GENLIST_GROUP_INDEX_STYLE].text_part = GENLIST_PART_ELM_TEXT;
+ g_genlist_info[WIFI_GENLIST_GROUP_INDEX_STYLE].sub_text_part = NULL;
+ g_genlist_info[WIFI_GENLIST_GROUP_INDEX_STYLE].content_part = NULL;
+ g_genlist_info[WIFI_GENLIST_GROUP_INDEX_STYLE].sub_content_part = NULL;
+}
+
+static void _init_genlist_full_style(void)
+{
+ g_genlist_info[WIFI_GENLIST_FULL_STYLE].style_name = GENLIST_STYLE_FULL;
+ g_genlist_info[WIFI_GENLIST_FULL_STYLE].text_part = NULL;
+ g_genlist_info[WIFI_GENLIST_FULL_STYLE].sub_text_part = GENLIST_PART_ELM_TEXT_SUB;
+ g_genlist_info[WIFI_GENLIST_FULL_STYLE].content_part = GENLIST_PART_ELM_SWALLOW_CONTENT;
+ g_genlist_info[WIFI_GENLIST_FULL_STYLE].sub_content_part = NULL;
+}
+
+void common_util_update_genlist_style(void)
+{
+ if (g_ug_type == UG_VIEW_IOT_COMMON) {
+ _init_genlist_1line_style();
+ _init_genlist_2line_style();
+ } else {
+ _init_genlist_type1_style();
+ _init_genlist_type2_style();
+ }
+ _init_genlist_multiline_style();
+ _init_genlist_group_index_style();
+ _init_genlist_full_style();
+}
+
void common_util_set_ug_type(UG_TYPE type)
{
g_ug_type = type;
/* Device-picker width for landscape mode */
#define DEVICE_PICKER_POPUP_LN_W 600
-/* Genlist new style for Tizen 2.4 */
-#define WIFI_GENLIST_1LINE_TEXT_STYLE "type1"
-#define WIFI_GENLIST_1LINE_TEXT_ICON_STYLE "type1"
-#define WIFI_GENLIST_2LINE_TOP_TEXT_STYLE "type1"
-#define WIFI_GENLIST_2LINE_TOP_TEXT_ICON_STYLE "type1"
-#define WIFI_GENLIST_2LINE_BOTTOM_TEXT_STYLE "type2"
-#define WIFI_GENLIST_2LINE_BOTTOM_TEXT_ICON_STYLE "type2"
-#define WIFI_GENLIST_MULTILINE_TEXT_STYLE "multiline"
-#define WIFI_GENLIST_GROUP_INDEX_STYLE "group_index"
-#define WIFI_GENLIST_FULL_STYLE "full"
-
-/* Genlist new style for Tizen 3.0 */
-#define WIFI_GENLIST_2LINE_BOTTOM_SWALLOW_STYLE "type2"
-#define WIFI_GENLIST_SWALLOW_CONTENT_STYLE "full"
+/* Genlist style */
+#define MAX_GENLIST_STYLE_NAME_LEN 16
+#define MAX_GENLIST_PART_NAME_LEN 24
+
+typedef enum {
+ WIFI_GENLIST_1LINE_STYLE = 0,
+ WIFI_GENLIST_2LINE_STYLE,
+ WIFI_GENLIST_MULTILINE_STYLE,
+ WIFI_GENLIST_GROUP_INDEX_STYLE,
+ WIFI_GENLIST_FULL_STYLE,
+ WIFI_GENLIST_STYLE_MAX
+} genlist_style_t;
+
+typedef struct {
+ const char *style_name;
+ const char *text_part;
+ const char *sub_text_part;
+ const char *content_part;
+ const char *sub_content_part;
+} genlist_info_t;
+
+//#if !defined TIZEN_WIFI_QS
+//extern genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
+//genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX] = {0, };
+//#endif
+
+#define GENLIST_STYLE_1LINE "1line"
+#define GENLIST_STYLE_2LINE "2line"
+#define GENLIST_STYLE_TYPE1 "type1"
+#define GENLIST_STYLE_TYPE2 "type2"
+#define GENLIST_STYLE_MULTILINE "multiline"
+#define GENLIST_STYLE_GROUP_INDEX "group_index"
+#define GENLIST_STYLE_FULL "full"
+
+#define GENLIST_PART_ELM_TEXT "elm.text"
+#define GENLIST_PART_ELM_TEXT_SUB "elm.text.sub"
+#define GENLIST_PART_ELM_TEXT_SUB_END "elm.text.sub.end"
+#define GENLIST_PART_ELM_TEXT_END "elm.text.end"
+#define GENLIST_PART_ELM_TEXT_MULTILINE "elm.text.MULTILINE"
+#define GENLIST_PART_ELM_ICON "elm.icon"
+#define GENLIST_PART_ELM_END "elm.end"
+#define GENLIST_PART_ELM_SWALLOW_CONTENT "elm.swallow.content"
+#define GENLIST_PART_ELM_SWALLOW_ICON "elm.swallow.icon"
+#define GENLIST_PART_ELM_SWALLOW_END "elm.swallow.end"
/* Icon Size*/
#define DEFAULT_BG_SIZE 60
typedef enum {
UG_VIEW_DEFAULT = 0,
UG_VIEW_SETUP_WIZARD,
- UG_VIEW_OOBE
+ UG_VIEW_OOBE,
+ UG_VIEW_IOT_COMMON
} UG_TYPE;
typedef enum {
int common_utils_get_sim_state(void);
Eina_Bool _is_emulator(void);
+bool is_common_profile(void);
+void common_util_update_genlist_style(void);
+
void common_util_set_ug_type(UG_TYPE type);
UG_TYPE common_util_get_ug_type(void);
#ifdef __cplusplus
};
struct _private_data g_pd;
+extern genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
/* Prototype */
static char *_gl_network_notification_text_get(void *data, Evas_Object *obj, const char *part);
/* Global variables for elm_genlist itc */
static Elm_Genlist_Item_Class itc_network_noti = {
- .item_style = WIFI_GENLIST_MULTILINE_TEXT_STYLE,
+// .item_style = g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].style_name,
+ .item_style = GENLIST_STYLE_MULTILINE,
.func.text_get = _gl_network_notification_text_get,
.func.content_get = _gl_content_get_network_noti
};
#if TIZEN_SLEEP_POLICY
static Elm_Genlist_Item_Class itc_keep_wifi = {
- .item_style = WIFI_GENLIST_2LINE_TOP_TEXT_STYLE,
+// .item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name,
+ .item_style = GENLIST_STYLE_TYPE1,
.func.text_get = _gl_keep_wifi_on_during_sleep_text_get,
};
static Elm_Genlist_Item_Class itc_keep_wifi_sub = {
- .item_style = WIFI_GENLIST_1LINE_TEXT_ICON_STYLE,
+// .item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name,
+ .item_style = GENLIST_STYLE_TYPE1,
.func.text_get = _gl_text_get,
.func.content_get = _gl_content_get_keep_wifi_sub,
};
static Elm_Genlist_Item_Class itc_keep_wifi_sub_never = {
- .item_style = WIFI_GENLIST_2LINE_TOP_TEXT_ICON_STYLE,
+// .item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name,
+ .item_style = GENLIST_STYLE_TYPE1,
.func.text_get = _gl_never_text_get,
.func.content_get = _gl_content_get_keep_wifi_sub,
};
#endif
static Elm_Genlist_Item_Class itc_sort_by = {
- .item_style = WIFI_GENLIST_2LINE_TOP_TEXT_STYLE,
+// .item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name,
+ .item_style = GENLIST_STYLE_TYPE1,
.func.text_get = _gl_sort_by_text_get,
};
static Elm_Genlist_Item_Class itc_sort_by_sub = {
- .item_style = WIFI_GENLIST_1LINE_TEXT_ICON_STYLE,
+ //.item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name,
+ .item_style = GENLIST_STYLE_TYPE1,
.func.text_get = _gl_sort_by_sub_text_get,
.func.content_get = _gl_content_get_sort_by_sub,
};
static Elm_Genlist_Item_Class itc_install_cert = {
- .item_style = WIFI_GENLIST_1LINE_TEXT_STYLE,
+// .item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name,
+ .item_style = GENLIST_STYLE_TYPE1,
.func.text_get = _gl_install_certificate_text_get,
};
{
char buf[1024];
- if (!strcmp("elm.text", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) {
snprintf(buf, 1023, "%s", sc(PACKAGE, I18N_TYPE_Install_certificate));
return strdup(buf);
}
const char *part)
{
char buf[1024];
- if (!strcmp("elm.text", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) {
if ((int) data != 0) {
snprintf(buf, 1023, "%s", sc(PACKAGE, (int) data));
return strdup(buf);
}
- } else if (!strcmp("elm.text.sub", part)) {
+ } else if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_text_part, part)) {
int value;
value = _convert_vconf_to_sort_by_value(
static char *_gl_sort_by_sub_text_get(void *data, Evas_Object *obj, const char *part)
{
char buf[1024];
- if (!strcmp("elm.text", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) {
if ((int) data != 0) {
snprintf(buf, 1023, "%s", sc(PACKAGE, (int) data));
return strdup(buf);
{
char buf[1024];
- if (!strcmp("elm.text", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].text_part, part)) {
snprintf(buf, 1023, "%s", sc(PACKAGE, I18N_TYPE_Network_notification));
return strdup(buf);
- } else if (!strcmp("elm.text.multiline", part)) {
+ } else if (!strcmp(g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].sub_text_part, part)) {
snprintf(buf, 1023, "<font_size=30>%s</font_size>",
sc(PACKAGE, I18N_TYPE_Network_notify_me_later));
return strdup(buf);
const char *part)
{
char buf[1024];
- if (!strcmp("elm.text", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) {
if ((int) data != 0) {
snprintf(buf, 1023, "%s", sc(PACKAGE, (int) data));
return strdup(buf);
{
char buf[1024];
- if (!strcmp("elm.text", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) {
snprintf(buf, 1023, "%s", sc(PACKAGE, I18N_TYPE_Keep_WIFI_on_during_sleep));
return strdup(buf);
- } else if (!strcmp("elm.text.sub", part)) {
+ } else if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_text_part, part)) {
int value;
value = _convert_vconf_to_wifi_keep_value(
common_util_get_system_registry(VCONF_SLEEP_POLICY));
static char *_gl_never_text_get(void *data, Evas_Object *obj,
const char *part)
{
- if (!strcmp("elm.text", part))
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part))
return g_strdup(sc(PACKAGE, I18N_TYPE_Donot_Use));
- else if (!strcmp("elm.text.sub", part))
+ else if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_text_part, part))
return g_strdup(sc(PACKAGE, I18N_TYPE_Increases_Data_Usage));
return NULL;
Evas_Object *toggle_btn = NULL;
int ret;
- if (!strcmp("elm.swallow.end", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].sub_content_part, part)) {
toggle_btn = elm_check_add(obj);
evas_object_size_hint_align_set(toggle_btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(toggle_btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_radio_state_value_set(g_pd.keep_wifi_radio_group, -1);
}
- if (!strcmp("elm.swallow.end", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_content_part, part)) {
content = elm_layout_add(obj);
elm_layout_theme_set(content, "layout", "list/C/type.2", "default");
elm_radio_state_value_set(g_pd.sort_by_radio_group, -1);
}
- if (!strcmp("elm.swallow.end", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_content_part, part)) {
content = elm_layout_add(obj);
elm_layout_theme_set(content, "layout", "list/C/type.2", "default");
static void _ctxpopup_rotate_cb(void *data, Evas_Object *obj, void *event_info);
static void _ctxpopup_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+extern genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
+
static void _create_ctxpopup_forget_btn_cb(void *data, Evas_Object *obj, void *event_info)
{
struct ug_data *ugd = NULL;
char *tmp = NULL;
char *txt = NULL;
- if (!strcmp("elm.text", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_2LINE_STYLE].text_part, part)) {
_detail_data = (view_detail_data *)data;
retvm_if(NULL == _detail_data, NULL);
_detail_data = (view_detail_data *)data;
Evas_Object* icon = NULL;
- if (!strcmp("elm.swallow.end", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_2LINE_STYLE].sub_content_part, part)) {
char *temp_str = NULL;
/* for strength */
evas_object_smart_callback_add(detailview_list, "language,changed",
gl_lang_changed, NULL);
- grouptitle_itc.item_style = WIFI_GENLIST_2LINE_BOTTOM_TEXT_ICON_STYLE;
+ grouptitle_itc.item_style = g_genlist_info[WIFI_GENLIST_2LINE_STYLE].style_name;
grouptitle_itc.func.text_get = _view_detail_grouptitle_text_get;
grouptitle_itc.func.content_get = _view_detail_grouptitle_content_get;
grouptitle_itc.func.state_get = NULL;
static void _hidden_button_callback(void* data, Evas_Object* obj, void* event_info);
static void viewer_manager_hidden_confirm_cleanup(void);
+extern genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
+
#ifdef MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE
static void _launch_wifi_direct_app(void)
{
retvm_if(NULL == manager_object, NULL);
- if (!strcmp("elm.text", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) {
if (ug_type == UG_VIEW_OOBE) {
det = g_strdup_printf("<font_size=%d>%s</font_size>",
OOBE_MID_FONT_SIZE,
retvm_if(NULL == manager_object, NULL);
- if (!strcmp("elm.text.multiline", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].sub_text_part, part)) {
det = g_strdup(manager_object->item_onoff_description_text);
assertm_if(NULL == det, "NULL!!");
}
const char *style;
// On&Off toggle button
- if (!strcmp("elm.swallow.end", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_content_part, part)) {
if (ug_type == UG_VIEW_OOBE)
style = "onoff";
else
}
// OOBE: Progress icon
- if (ug_type == UG_VIEW_OOBE && !strcmp("elm.swallow.icon", part)) {
-// if (manager_object->header_mode == HEADER_MODE_ACTIVATING
-// || manager_object->header_mode == HEADER_MODE_SEARCHING) {
+ if (ug_type == UG_VIEW_OOBE
+ && !strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].content_part, part)) {
if (manager_object->header_mode == HEADER_MODE_SEARCHING) {
c = elm_progressbar_add(obj);
elm_object_style_set(c, "process_small");
manager_object->item_wifi_onoff_text = g_strdup(sc(PACKAGE, I18N_TYPE_Wi_Fi));
- wifi_onoff_itc.item_style = WIFI_GENLIST_1LINE_TEXT_ICON_STYLE;
+ wifi_onoff_itc.item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name;
wifi_onoff_itc.func.text_get = _gl_wifi_onoff_text_get;
wifi_onoff_itc.func.content_get = _gl_wifi_onoff_content_get;
wifi_onoff_itc.func.state_get = NULL;
manager_object->item_onoff_description_text = g_strdup(sc(PACKAGE, I18N_TYPE_Turn_on_wifi_to_view_available_networks));
- onoff_description_itc.item_style = WIFI_GENLIST_MULTILINE_TEXT_STYLE;
+ onoff_description_itc.item_style = g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].style_name;
onoff_description_itc.func.text_get = _gl_helper_text_get;
onoff_description_itc.func.content_get = NULL;
onoff_description_itc.func.state_get = NULL;
static struct connecting_cancel_popup_data *g_disconnect_popup = NULL;
+extern genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
+
static void _gl_listview_more_btn_cb(void *data, Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
assertm_if(NULL == gdata->device_info->ssid, "NULL!!");
- if (!strcmp("elm.text", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_2LINE_STYLE].text_part, part)) {
det = evas_textblock_text_utf8_to_markup(NULL,
gdata->device_info->ssid);
assertm_if(NULL == det, "NULL!!");
g_free(det);
return buf;
}
- } else if (!strcmp("elm.text.sub", part)
+ } else if (!strcmp(g_genlist_info[WIFI_GENLIST_2LINE_STYLE].sub_text_part, part)
&& gdata->device_info->ap_status_txt != NULL) {
det = g_strdup(gdata->device_info->ap_status_txt);
assertm_if(NULL == det, "NULL!!");
/* if there is no ap_image_path (NO AP Found situation) */
DEBUG_LOG(UG_NAME_ERR, "Fatal: Image path is NULL");
- } else if (!strcmp("elm.swallow.icon", part)) {
+ } else if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].content_part, part)) {
icon = elm_image_add(obj);
retvm_if(NULL == icon, NULL);
evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(DEFAULT_BUTTON_CIRCLE_SIZE),
ELM_SCALE_SIZE(DEFAULT_BUTTON_CIRCLE_SIZE));
}
- } else if (!strcmp("elm.swallow.end", part)) {
+ } else if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_content_part, part)) {
if (VIEWER_ITEM_RADIO_MODE_CONNECTING == gdata->radio_mode ||
VIEWER_ITEM_RADIO_MODE_CONFIGURATION == gdata->radio_mode) {
static char *_gl_text_available_networks_get(void *data, Evas_Object *obj,
const char *part)
{
- if (!strcmp("elm.text", part))
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_GROUP_INDEX_STYLE].text_part, part))
return g_strdup(sc(PACKAGE, I18N_TYPE_Available_networks));
return NULL;
static char *_gl_hidden_network_text_get(void *data, Evas_Object *obj,
const char *part)
{
- if (!strcmp("elm.text", part))
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part))
return g_strdup_printf("<font_size=%d>%s</font_size>",
BIG_FONT_SIZE, sc(PACKAGE, I18N_TYPE_Find_Hidden_Network));
{
Evas_Object *icon = NULL;
- if (!strcmp("elm.swallow.icon", part)) {
+ if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].content_part, part)) {
icon = elm_image_add(obj);
retvm_if(NULL == icon, NULL);
elm_image_file_set(icon, CUSTOM_EDITFIELD_PATH, "find_hidden_network.png");
evas_object_size_hint_align_set(viewer_list, EVAS_HINT_FILL, EVAS_HINT_FILL);
itc = elm_genlist_item_class_new();
- itc->item_style = WIFI_GENLIST_2LINE_TOP_TEXT_ICON_STYLE;
+ itc->item_style = g_genlist_info[WIFI_GENLIST_2LINE_STYLE].style_name;
itc->func.text_get = _gl_listview_text_get;
itc->func.content_get = _gl_listview_content_get;
itc->func.state_get = NULL;
itc->func.del = _gl_listview_del;
no_wifi_device_itc = elm_genlist_item_class_new();
- no_wifi_device_itc->item_style = WIFI_GENLIST_1LINE_TEXT_STYLE;
+ no_wifi_device_itc->item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name;
no_wifi_device_itc->func.text_get = _gl_listview_text_get;
no_wifi_device_itc->func.content_get = NULL;
no_wifi_device_itc->func.state_get = NULL;
if (wifi_get_ug_type() == UG_VIEW_OOBE) {
last_item_itc = elm_genlist_item_class_new();
- last_item_itc->item_style = WIFI_GENLIST_1LINE_TEXT_ICON_STYLE;
+ last_item_itc->item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name;
last_item_itc->func.text_get = _gl_hidden_network_text_get;
last_item_itc->func.content_get = _gl_hidden_network_content_get;
last_item_itc->func.del = NULL;
//memset(&grouptitle_itc, 0, sizeof(grouptitle_itc));
grouptitle_itc = elm_genlist_item_class_new();
if (wifi_get_ug_type() == UG_VIEW_OOBE) {
- grouptitle_itc->item_style = WIFI_GENLIST_FULL_STYLE;
+ grouptitle_itc->item_style = g_genlist_info[WIFI_GENLIST_FULL_STYLE].style_name;
grouptitle_itc->func.text_get = NULL;
grouptitle_itc->func.content_get = NULL;
} else {
- grouptitle_itc->item_style = WIFI_GENLIST_GROUP_INDEX_STYLE;
+ grouptitle_itc->item_style = g_genlist_info[WIFI_GENLIST_GROUP_INDEX_STYLE].style_name;
grouptitle_itc->func.text_get = _gl_text_available_networks_get;
grouptitle_itc->func.content_get = _gl_content_scanning_icon_get;
}
struct ug_data *ugd;
ugd = (struct ug_data*)priv;
ugd->ug = ug;
+ ug_app_state->ug_type = UG_VIEW_DEFAULT;
if (NULL != app_control) {
INFO_LOG(UG_NAME_NORMAL, "message load from caller");
if (g_strcmp0(caller, "pwlock") == 0) {
ugd->elm_conform = ug_get_conformant();
ug_app_state->ug_type = UG_VIEW_OOBE;
- common_util_set_ug_type(UG_VIEW_OOBE);
} else if (g_strcmp0(caller, "notification") == 0) {
/* Remove the "WiFi networks found" from the notification tray.*/
common_util_managed_idle_add(__wifi_efl_ug_del_found_ap_noti, NULL);
- ug_app_state->ug_type = UG_VIEW_DEFAULT;
} else if (g_strcmp0(caller, "lbhome") == 0) {
- ug_app_state->ug_type = UG_VIEW_DEFAULT;
ug_app_state->app_control = app_control;
ug_app_state->is_lbhome = EINA_TRUE;
- } else {
- ug_app_state->ug_type = UG_VIEW_DEFAULT;
}
-
free(caller);
} else {
INFO_LOG(UG_NAME_NORMAL, "caller is not defined");
- ug_app_state->ug_type = UG_VIEW_DEFAULT;
}
+ }
-
- } else {
- INFO_LOG(UG_NAME_NORMAL, "caller is not defined");
- ug_app_state->ug_type = UG_VIEW_DEFAULT;
+ if (ug_app_state->ug_type == UG_VIEW_DEFAULT
+ && is_common_profile()) {
+ ug_app_state->ug_type = UG_VIEW_IOT_COMMON;
}
+ common_util_set_ug_type(ug_app_state->ug_type);
+ common_util_update_genlist_style();
+
Evas_Object *parent_layout = ug_get_parent_layout(ug);
if (parent_layout == NULL) {
ERROR_LOG(UG_NAME_NORMAL, "Failed to get parent layout");
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
- itc.item_style = WIFI_GENLIST_2LINE_TOP_TEXT_ICON_STYLE;
+ itc.item_style = GENLIST_STYLE_TYPE1;
itc.func.text_get = _gl_text_get;
itc.func.content_get = _gl_content_get;
itc.func.state_get = NULL;
static void view_main_add_group_title(void)
{
- grouptitle_itc.item_style = WIFI_GENLIST_GROUP_INDEX_STYLE;
+ grouptitle_itc.item_style = GENLIST_STYLE_GROUP_INDEX;
grouptitle_itc.func.text_get = _gl_text_title_get;
grouptitle_itc.func.content_get = _gl_content_title_get;