4 * Copyright 2012 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.1 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://floralicense.org/license
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
25 #include <Elementary.h>
27 #include <ui-gadget-module.h>
28 #include <wifi-direct.h>
31 #include "wfd_ug_view.h"
32 #include "wfd_client.h"
34 static Elm_Genlist_Item_Class itc;
37 * This function let the ug get the label of about
38 * @return the label of about
39 * @param[in] parent the pointer to the label's parent
40 * @param[in] obj the pointer to the evas object
41 * @param[in] part the pointer to the part of item
43 static char *_wfd_gl_label_help_dialogue_get(void *data, Evas_Object *obj, const char *part)
45 return strdup(_("IDS_WFD_BODY_ABOUT_WIFI"));
49 * This function let the ug call it when click 'back' button
51 * @param[in] data the pointer to the main data structure
52 * @param[in] obj the pointer to the evas object
53 * @param[in] event_info the pointer to the event information
55 void _about_view_back_btn_cb(void *data, Evas_Object * obj, void *event_info)
57 __WDUG_LOG_FUNC_ENTER__;
58 struct ug_data *ugd = (struct ug_data *) data;
61 WDUG_LOGE("The param is NULL\n");
65 elm_naviframe_item_pop(ugd->naviframe);
67 __WDUG_LOG_FUNC_EXIT__;
72 * This function let the ug create about view
74 * @param[in] ugd the pointer to the main data structure
76 void _wifid_create_about_view(struct ug_data *ugd)
78 __WDUG_LOG_FUNC_ENTER__;
80 Evas_Object *back_btn = NULL;
81 Elm_Object_Item *navi_item = NULL;
82 Evas_Object *genlist = NULL;
83 Elm_Object_Item *item = NULL;
86 WDUG_LOGE("Incorrect parameter(NULL)");
90 genlist = elm_genlist_add(ugd->naviframe);
91 if (NULL == genlist) {
92 WDUG_LOGE("Create genlist failed\n");
96 elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
98 /* Set multiline item class */
99 itc.item_style = "multiline/1text";
100 itc.func.text_get = _wfd_gl_label_help_dialogue_get;
101 itc.func.content_get = NULL;
102 itc.func.state_get = NULL;
105 item = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
106 elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
108 back_btn = elm_button_add(ugd->naviframe);
109 elm_object_style_set(back_btn, "naviframe/back_btn/default");
110 evas_object_smart_callback_add(back_btn, "clicked", _about_view_back_btn_cb, (void *)ugd);
111 elm_object_focus_allow_set(back_btn, EINA_FALSE);
113 navi_item = elm_naviframe_item_push(ugd->naviframe, IDS_WFD_TITLE_ABOUT_WIFI_DIRECT, back_btn, NULL, genlist, NULL);
115 __WDUG_LOG_FUNC_EXIT__;