/*
* WiFi-Direct UG
*
-* Copyright 2012 Samsung Electronics Co., Ltd
+* Copyright 2012 Samsung Electronics Co., Ltd
-* Licensed under the Flora License, Version 1.0 (the "License");
+* Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
-* http://www.tizenopensource.org/license
+* http://floralicense.org/license
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
static Elm_Genlist_Item_Class itc;
+/**
+ * This function let the ug get the label of about
+ * @return the label of about
+ * @param[in] parent the pointer to the label's parent
+ * @param[in] obj the pointer to the evas object
+ * @param[in] part the pointer to the part of item
+ */
static char *_wfd_gl_label_help_dialogue_get(void *data, Evas_Object *obj, const char *part)
{
- DBG(LOG_VERBOSE, "Adding text");
-
- if (!strcmp(part, "elm.text.2")) {
- return strdup(_("IDS_WFD_BODY_ABOUT_WIFI"));
- }
- return NULL;
-}
-
-static Evas_Object *_wfd_gl_help_icon_get(void *data, Evas_Object * obj, const char *part)
-{
- __FUNC_ENTER__;
-
- DBG(LOG_VERBOSE, "Current part: %s\n", part);
- Evas_Object *label = NULL;
- char content[1024] = {0};
-
- label = elm_label_add(obj);
- snprintf(content, 1024, "<color=#7C7C7CFF><font_size=32>%s</font_size></color>", _("IDS_WFD_BODY_ABOUT_WIFI"));
- elm_label_line_wrap_set(label, ELM_WRAP_WORD);
- elm_object_text_set(label, content);
- evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0.0);
- evas_object_size_hint_align_set(label, EVAS_HINT_FILL, 0.0);
- evas_object_show(label);
-
- __FUNC_EXIT__;
- return label;
+ return strdup(_("IDS_WFD_BODY_ABOUT_WIFI"));
}
+/**
+ * This function let the ug call it when click 'back' button
+ * @return void
+ * @param[in] data the pointer to the main data structure
+ * @param[in] obj the pointer to the evas object
+ * @param[in] event_info the pointer to the event information
+ */
void _about_view_back_btn_cb(void *data, Evas_Object * obj, void *event_info)
{
- __FUNC_ENTER__;
- struct ug_data *ugd = (struct ug_data*) data;
+ __WDUG_LOG_FUNC_ENTER__;
+ struct ug_data *ugd = (struct ug_data *) data;
- if(!ugd)
- {
- DBG(LOG_ERROR, "The param is NULL\n");
- return;
- }
+ if (!ugd) {
+ WDUG_LOGE("The param is NULL\n");
+ return;
+ }
- elm_naviframe_item_pop(ugd->naviframe);
+ elm_naviframe_item_pop(ugd->naviframe);
- __FUNC_EXIT__;
- return;
+ __WDUG_LOG_FUNC_EXIT__;
+ return;
}
+/**
+ * This function let the ug create about view
+ * @return void
+ * @param[in] ugd the pointer to the main data structure
+ */
void _wifid_create_about_view(struct ug_data *ugd)
{
+ __WDUG_LOG_FUNC_ENTER__;
+
+ Evas_Object *back_btn = NULL;
+ Elm_Object_Item *navi_item = NULL;
+ Evas_Object *genlist = NULL;
+ Elm_Object_Item *item = NULL;
+
+ if (ugd == NULL) {
+ WDUG_LOGE("Incorrect parameter(NULL)");
+ return;
+ }
+
+ genlist = elm_genlist_add(ugd->naviframe);
+ if (NULL == genlist) {
+ WDUG_LOGE("Create genlist failed\n");
+ return;
+ }
+
+ elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
+
+ /* Set multiline item class */
+ itc.item_style = "multiline/1text";
+ itc.func.text_get = _wfd_gl_label_help_dialogue_get;
+ itc.func.content_get = NULL;
+ itc.func.state_get = NULL;
+ itc.func.del = NULL;
+
+ item = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+
+ back_btn = elm_button_add(ugd->naviframe);
+ elm_object_style_set(back_btn, "naviframe/back_btn/default");
+ evas_object_smart_callback_add(back_btn, "clicked", _about_view_back_btn_cb, (void *)ugd);
+ elm_object_focus_allow_set(back_btn, EINA_FALSE);
- Evas_Object *back_btn = NULL;
- Elm_Object_Item *navi_item = NULL;
- Evas_Object *control_bar = NULL;
- Elm_Object_Item *item = NULL;
- Evas_Object *genlist = NULL;
- if(ugd == NULL)
- {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)");
- return;
- }
-
- genlist = elm_genlist_add(ugd->naviframe);
- elm_object_style_set(genlist, "dialogue");
-
- DBG(LOG_VERBOSE, "creating about view");
- elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
-#if 0
- itc.item_style = "multiline/1text";
- itc.func.text_get = _wfd_gl_label_help_dialogue_get;
- itc.func.content_get = NULL;
-#else
- itc.item_style = "1icon";
- itc.func.text_get = NULL;
- itc.func.content_get = _wfd_gl_help_icon_get;
-#endif
- itc.func.state_get = NULL;
- itc.func.del = NULL;
- back_btn = elm_button_add(ugd->naviframe);
- elm_object_style_set(back_btn, "naviframe/back_btn/default");
- evas_object_smart_callback_add(back_btn, "clicked", _about_view_back_btn_cb, (void*) ugd);
- elm_object_focus_allow_set(back_btn, EINA_FALSE);
-
- item = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- evas_object_show(genlist);
- navi_item = elm_naviframe_item_push(ugd->naviframe, _("IDS_WFD_TITLE_ABOUT_WIFI"), back_btn, NULL, genlist, NULL);
-
- control_bar = elm_toolbar_add(ugd->naviframe);
- elm_toolbar_shrink_mode_set(control_bar, ELM_TOOLBAR_SHRINK_EXPAND);
- evas_object_show(control_bar);
- elm_object_item_part_content_set(navi_item, "controlbar", control_bar);
+ navi_item = elm_naviframe_item_push(ugd->naviframe, IDS_WFD_TITLE_ABOUT_WIFI_DIRECT, back_btn, NULL, genlist, NULL);
+ __WDUG_LOG_FUNC_EXIT__;
}