95711ef5ba402fafe13a511f094ad1dccb0effd8
[apps/native/ug-wifi-efl.git] / sources / ui-gadget / viewers-layout / view_detail.c
1 /*
2  * Wi-Fi
3  *
4  * Copyright 2012 Samsung Electronics Co., Ltd
5  *
6  * Licensed under the Flora License, Version 1.0 (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
9  *
10  * http://www.tizenopensource.org/license
11  *
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.
17  *
18  */
19 #include <efl_extension.h>
20
21 #include "ug_wifi.h"
22 #include "view_detail.h"
23 #include "i18nmanager.h"
24 #include "viewer_manager.h"
25 #include "viewer_list.h"
26 #include "winset_popup.h"
27 #include "common_utils.h"
28 #include "common_ip_info.h"
29 #include "common_eap_connect.h"
30
31 typedef struct _view_detail_data {
32         Evas_Object *win;
33         Evas_Object *nav;
34         char *ap_image_path;
35         wifi_ap_h ap;
36         eap_info_list_t *eap_info_list;
37         full_ip_info_t *ip_info;
38         Evas_Object *forget_confirm_popup;
39         Evas_Object *view_detail_list;
40         Evas_Object *btn;
41         Evas_Object *ctxpopup;
42 } view_detail_data;
43
44 static int view_detail_end = TRUE;
45 extern wifi_appdata *ug_app_state;
46 static view_detail_data *_detail_data = NULL;
47 static Eina_Bool rotate_flag = EINA_FALSE;
48 static int pos_changed = 0;
49
50 static Eina_Bool detailview_sk_cb(void *data, Elm_Object_Item *it);
51 static void forget_sk_cb(void *data, Evas_Object *obj, void *event_info);
52 static void _transition_finished_sub_cb(void *data, Evas_Object *obj, void *event_info);
53 static void _create_ctxpopup_forget_btn_cb(void *data, Evas_Object *obj, void *event_info);
54 static void _ctxpopup_del_cb(void *data, Evas_Object *obj, void *event_info);
55 static void _ctxpopup_move(Evas_Object *parent);
56 static void _ctxpopup_dismissed_cb(void *data, Evas_Object *obj, void *event_info);
57 static void _ctxpopup_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
58 static void _ctxpopup_rotate_cb(void *data, Evas_Object *obj, void *event_info);
59 static void _ctxpopup_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
60
61 static void _create_ctxpopup_forget_btn_cb(void *data, Evas_Object *obj, void *event_info)
62 {
63         struct ug_data *ugd = NULL;
64         Evas_Object *parent = NULL;
65         Elm_Object_Item *item = NULL;
66
67         ugd = (struct ug_data *)ug_app_state->gadget;
68         retm_if(ugd == NULL);
69
70         parent = ugd->win_main;
71         if (!parent || !_detail_data) {
72                 return;
73         }
74
75         if (_detail_data->ctxpopup) {
76                 evas_object_del(_detail_data->ctxpopup);
77         }
78
79         _detail_data->ctxpopup = elm_ctxpopup_add(parent);
80
81         elm_ctxpopup_auto_hide_disabled_set(_detail_data->ctxpopup, EINA_TRUE);
82         elm_object_style_set(_detail_data->ctxpopup, "more/default");
83         eext_object_event_callback_add(_detail_data->ctxpopup, EA_CALLBACK_BACK,
84                         _ctxpopup_del_cb, NULL);
85         eext_object_event_callback_add(_detail_data->ctxpopup, EA_CALLBACK_MORE,
86                         _ctxpopup_del_cb, NULL);
87         evas_object_smart_callback_add(_detail_data->ctxpopup, "dismissed",
88                         _ctxpopup_dismissed_cb, NULL);
89         evas_object_event_callback_add(_detail_data->ctxpopup, EVAS_CALLBACK_DEL,
90                         _ctxpopup_delete_cb, parent);
91         evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE,
92                         _ctxpopup_resize_cb, _detail_data->ctxpopup);
93
94         evas_object_smart_callback_add(elm_object_top_widget_get(_detail_data->ctxpopup),
95                         "rotation,changed", _ctxpopup_rotate_cb, _detail_data->ctxpopup);
96
97         item = elm_ctxpopup_item_append(_detail_data->ctxpopup,
98                         "IDS_WIFI_SK_FORGET", NULL, forget_sk_cb, _detail_data);
99         elm_object_item_domain_text_translatable_set(item, PACKAGE, EINA_TRUE);
100
101         elm_ctxpopup_direction_priority_set(_detail_data->ctxpopup,
102                         ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UNKNOWN,
103                         ELM_CTXPOPUP_DIRECTION_UNKNOWN, ELM_CTXPOPUP_DIRECTION_UNKNOWN);
104
105         _ctxpopup_move(_detail_data->ctxpopup);
106         evas_object_show(_detail_data->ctxpopup);
107 }
108
109 static void _ctxpopup_del_cb(void *data, Evas_Object *obj, void *event_info)
110 {
111         __COMMON_FUNC_ENTER__;
112
113         if (!_detail_data)
114                 return;
115
116         evas_object_del(_detail_data->ctxpopup);
117         _detail_data->ctxpopup = NULL;
118
119         __COMMON_FUNC_EXIT__;
120 }
121
122 static void _ctxpopup_move(Evas_Object *parent)
123 {
124         __COMMON_FUNC_ENTER__;
125
126         if (!_detail_data)
127                 return;
128
129         Evas_Object *win;
130         Evas_Coord w, h;
131         int pos = -1;
132
133         win = elm_object_top_widget_get(_detail_data->ctxpopup);
134         elm_win_screen_size_get(win, NULL, NULL, &w, &h);
135         pos = elm_win_rotation_get(win);
136         if (pos == 0 || pos == 180) {
137                 pos_changed = 0;
138         } else if (pos == 90 || pos == 270) {
139                 pos_changed = 1;
140         }
141
142         switch (pos) {
143                 case 0:
144                 case 180:
145                         evas_object_move(_detail_data->ctxpopup, (w/2), h);
146                         break;
147                 case 90:
148                         evas_object_move(_detail_data->ctxpopup, (h/2), w);
149                         break;
150                 case 270:
151                         evas_object_move(_detail_data->ctxpopup, (h/2), w);
152                         break;
153         }
154         __COMMON_FUNC_EXIT__;
155 }
156
157 static void _ctxpopup_dismissed_cb(void *data, Evas_Object *obj, void *event_info)
158 {
159         __COMMON_FUNC_ENTER__;
160
161         if (!_detail_data)
162                 return;
163
164         Evas_Object *_win_main = data;
165
166         if (!rotate_flag) {
167                 evas_object_del(_detail_data->ctxpopup);
168                 _detail_data->ctxpopup = NULL;
169         } else {
170                 _ctxpopup_move(_win_main);
171                 evas_object_show(_detail_data->ctxpopup);
172                 rotate_flag = EINA_FALSE;
173         }
174
175         __COMMON_FUNC_EXIT__;
176 }
177
178 static void _ctxpopup_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
179 {
180         __COMMON_FUNC_ENTER__;
181
182         Evas_Object *navi = (Evas_Object *)data;
183         Evas_Object *ctx = obj;
184
185         if (navi == NULL)
186                 return;
187
188         if (ctx == NULL)
189                 return;
190
191         evas_object_smart_callback_del(ctx, "dismissed",
192                         _ctxpopup_dismissed_cb);
193         evas_object_event_callback_del(navi, EVAS_CALLBACK_RESIZE,
194                         _ctxpopup_resize_cb);
195         evas_object_smart_callback_del(elm_object_top_widget_get(ctx),
196                         "rotation,changed", _ctxpopup_rotate_cb);
197         evas_object_event_callback_del_full(ctx, EVAS_CALLBACK_DEL,
198                         _ctxpopup_delete_cb, navi);
199
200         __COMMON_FUNC_EXIT__;
201
202 }
203
204 static void _ctxpopup_rotate_cb(void *data, Evas_Object *obj, void *event_info)
205 {
206
207         __COMMON_FUNC_ENTER__;
208
209         if (!_detail_data)
210                 return;
211
212         Evas_Object *_win_main = data;
213
214         _ctxpopup_move(_win_main);
215         evas_object_show(_detail_data->ctxpopup);
216
217         __COMMON_FUNC_EXIT__;
218 }
219
220 static void _ctxpopup_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
221 {
222         __COMMON_FUNC_ENTER__;
223
224         if (_detail_data->ctxpopup) {
225                 Evas_Object *win;
226                 Evas_Coord w, h;
227                 int pos = -1;
228
229                 win = elm_object_top_widget_get(_detail_data->ctxpopup);
230                 elm_win_screen_size_get(win, NULL, NULL, &w, &h);
231                 pos = elm_win_rotation_get(win);
232                 if (pos == 0 || pos == 180) {
233                         pos = 0;
234                 } else if (pos == 90 || pos == 270) {
235                         pos = 1;
236                 }
237                 if (pos_changed != pos) {
238                         rotate_flag = EINA_TRUE;
239                 } else
240                         rotate_flag = EINA_FALSE;
241         }
242         else
243                 rotate_flag = EINA_FALSE;
244
245         __COMMON_FUNC_EXIT__;
246 }
247
248 static char *_view_detail_grouptitle_text_get(void *data,
249                 Evas_Object *obj, const char *part)
250 {
251         __COMMON_FUNC_ENTER__;
252
253         retvm_if(NULL == part, NULL);
254
255         char *ret = NULL;
256         char *tmp = NULL;
257         char *txt = NULL;
258
259         if (!strcmp("elm.text.sub", part)) {
260                 ret = (char*) g_strdup(dgettext(PACKAGE, "IDS_WIFI_BODY_NAME"));
261         } else if (!strcmp("elm.text", part)) {
262                 _detail_data = (view_detail_data *)data;
263                 retvm_if(NULL == _detail_data, NULL);
264
265                 if (wifi_ap_get_essid(_detail_data->ap, &tmp) != WIFI_ERROR_NONE) {
266                                 ret = NULL;
267                 }
268
269                 txt = evas_textblock_text_utf8_to_markup(NULL, tmp);
270                 g_free(tmp);
271                 ret = g_strdup(txt);
272                 g_free(txt);
273         }
274
275         __COMMON_FUNC_EXIT__;
276         return ret;
277 }
278
279 static Evas_Object *_view_detail_grouptitle_content_get(void *data, Evas_Object *obj, const char *part)
280 {
281         retvm_if(NULL == data || NULL == part, NULL);
282
283         view_detail_data *_detail_data = (view_detail_data *)data;
284         _detail_data = (view_detail_data *)data;
285         Evas_Object* icon = NULL;
286         Evas_Object* ic = NULL;
287
288         if (!strcmp("elm.swallow.end", part)) {
289                 char *temp_str = NULL;
290
291                 ic = elm_layout_add(obj);
292                 elm_layout_theme_set(ic, "layout", "list/C/type.1", "default");
293                 /* for strength */
294                 icon = elm_image_add(ic);
295                 retvm_if(NULL == icon, NULL);
296
297                 if (_detail_data->ap_image_path != NULL) {
298                         temp_str = g_strdup_printf("%s.png", _detail_data->ap_image_path);
299                 } else {
300                         /* if there is no ap_image_path (NO AP Found situation)
301                          * So use a default image */
302                         temp_str = g_strdup_printf("%s.png", "A01-3_icon_lock_00");
303                 }
304                 evas_object_color_set(icon, 2, 61, 132, 204);
305
306                 elm_image_file_set(icon, CUSTOM_EDITFIELD_PATH, temp_str);
307                 g_free(temp_str);
308
309                 evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
310                 evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
311                 elm_layout_content_set(ic, "elm.swallow.content", icon);
312         }
313         return ic;
314 }
315
316 static void _remove_all(view_detail_data *_detail_data)
317 {
318         __COMMON_FUNC_ENTER__;
319
320         if (_detail_data) {
321
322                 if (_detail_data->forget_confirm_popup != NULL) {
323                         evas_object_del(_detail_data->forget_confirm_popup);
324                         _detail_data->forget_confirm_popup = NULL;
325                 }
326
327                 if (_detail_data->ctxpopup) {
328                         evas_object_del(_detail_data->ctxpopup);
329                         _detail_data->ctxpopup = NULL;
330                 }
331
332                 if (_detail_data->eap_info_list) {
333                         eap_info_remove(_detail_data->eap_info_list);
334                 }
335
336                 ip_info_remove(_detail_data->ip_info->ip_info_list);
337                 ip_info_delete_prev(_detail_data->ip_info->prev_ip_info);
338                 _detail_data->ip_info->ip_info_list = NULL;
339                 _detail_data->eap_info_list = NULL;
340
341                 g_free(_detail_data->ap_image_path);
342                 _detail_data->ap_image_path = NULL;
343                 g_free(_detail_data);
344
345                 _detail_data = NULL;
346         }
347
348         __COMMON_FUNC_EXIT__;
349 }
350
351 static gboolean __forget_wifi_ap(gpointer data)
352 {
353         __COMMON_FUNC_ENTER__;
354
355         wifi_ap_h ap = (wifi_ap_h)data;
356
357         wlan_manager_forget(ap);
358
359         viewer_manager_update_item_favorite_status(ap);
360         wifi_ap_destroy(ap);
361
362         __COMMON_FUNC_EXIT__;
363         return FALSE;
364 }
365
366 static void ok_cb(void *data, Evas_Object *obj, void *event_info)
367 {
368         __COMMON_FUNC_ENTER__;
369
370         guint id;
371         wifi_ap_h ap = NULL;
372         //view_detail_data *_detail_data;
373
374         if (view_detail_end == TRUE) {
375                 return;
376         }
377
378         view_detail_end = TRUE;
379         _detail_data = (view_detail_data *)data;
380         retm_if(NULL == _detail_data);
381
382         wifi_ap_clone(&ap, _detail_data->ap);
383
384         if (_detail_data->forget_confirm_popup != NULL) {
385                 evas_object_del(_detail_data->forget_confirm_popup);
386                 _detail_data->forget_confirm_popup = NULL;
387         }
388
389         _remove_all(_detail_data);
390
391         elm_naviframe_item_pop(viewer_manager_get_naviframe());
392
393         id = common_util_managed_idle_add(__forget_wifi_ap, (gpointer)ap);
394         if (!id) {
395                 wifi_ap_destroy(ap);
396         }
397
398         __COMMON_FUNC_EXIT__;
399 }
400
401 static void cancel_cb(void *data, Evas_Object *obj, void *event_info)
402 {
403         __COMMON_FUNC_ENTER__;
404
405 //      view_detail_data *_detail_data = (view_detail_data *)data;
406         _detail_data = (view_detail_data *)data;
407         retm_if(NULL == _detail_data);
408
409         if (_detail_data->forget_confirm_popup != NULL) {
410                 evas_object_del(_detail_data->forget_confirm_popup);
411                 _detail_data->forget_confirm_popup = NULL;
412         }
413
414         __COMMON_FUNC_EXIT__;
415 }
416
417 static void forget_sk_cb(void *data, Evas_Object *obj, void *event_info)
418 {
419         __COMMON_FUNC_ENTER__;
420
421 //      view_detail_data *_detail_data = (view_detail_data *)data;
422         _detail_data = (view_detail_data *)data;
423         retm_if(NULL == _detail_data);
424
425         if (!_detail_data->forget_confirm_popup) {
426                 popup_btn_info_t popup_data;
427                 memset(&popup_data, 0, sizeof(popup_data));
428
429                 popup_data.title_txt = "IDS_WIFI_OPT_FORGET_NETWORK";
430                 popup_data.info_txt = "IDS_WIFI_POP_CURRENT_NETWORK_WILL_BE_DISCONNECTED";
431                 popup_data.btn1_cb = cancel_cb;
432                 popup_data.btn1_txt = "IDS_WIFI_SK_CANCEL";
433                 popup_data.btn1_data = _detail_data;
434                 popup_data.btn2_cb = ok_cb;
435                 popup_data.btn2_txt = "IDS_WIFI_SK_FORGET";
436                 popup_data.btn2_data = _detail_data;
437
438                 _detail_data->forget_confirm_popup = common_utils_show_info_popup(_detail_data->win, &popup_data);
439         }
440
441         if (_detail_data->ctxpopup != NULL) {
442                 evas_object_del(_detail_data->ctxpopup);
443                 _detail_data->ctxpopup = NULL;
444         }
445
446         __COMMON_FUNC_EXIT__;
447 }
448
449 static Eina_Bool detailview_sk_cb(void *data, Elm_Object_Item *it)
450 {
451         __COMMON_FUNC_ENTER__;
452
453         Evas_Object *navi_frame = NULL;
454
455         if (view_detail_end == TRUE) {
456                 return EINA_TRUE;
457         }
458
459         view_detail_end = TRUE;
460
461 //      view_detail_data *_detail_data = (view_detail_data *)data;
462         _detail_data = (view_detail_data *)data;
463         retvm_if(NULL == _detail_data, EINA_TRUE);
464
465         /* Delete context popup */
466         if (_detail_data->ctxpopup) {
467                 evas_object_del(_detail_data->ctxpopup);
468                 _detail_data->ctxpopup = NULL;
469         }
470
471         navi_frame = viewer_manager_get_naviframe();
472         retvm_if(NULL == navi_frame, EINA_TRUE);
473
474         evas_object_smart_callback_add(navi_frame, "transition,finished",
475                         _transition_finished_sub_cb, _detail_data);
476
477         __COMMON_FUNC_EXIT__;
478
479         return EINA_TRUE;
480 }
481
482 static void __view_detail_imf_ctxt_evnt_cb(void *data, Ecore_IMF_Context *ctx, int value)
483 {
484         if (!data) {
485                 return;
486         }
487         if (value == ECORE_IMF_INPUT_PANEL_STATE_SHOW) {
488                 DEBUG_LOG(UG_NAME_NORMAL, "Key pad is now open");
489                 elm_object_item_signal_emit(data, "elm,state,sip,shown", "");
490         } else if (value == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
491                 DEBUG_LOG(UG_NAME_NORMAL, "Key pad is now closed");
492                 elm_object_item_signal_emit(data, "elm,state,sip,hidden", "");
493         }
494         return;
495 }
496
497 static gboolean __view_detail_load_ip_info_list_cb(void *data)
498 {
499         __COMMON_FUNC_ENTER__;
500         Elm_Object_Item *navi_it = NULL;
501         Evas_Object *list = NULL;
502         Evas_Object *layout;
503         _detail_data = (view_detail_data *)data;
504
505         if (!_detail_data) {
506                 return FALSE;
507         }
508
509         navi_it = elm_naviframe_top_item_get(viewer_manager_get_naviframe());
510         layout = elm_object_item_part_content_get(navi_it, "elm.swallow.content");
511
512         /* Create an EAP connect view list */
513         list = elm_object_part_content_get(layout, "elm.swallow.content");
514
515         /* Append ip info list */
516         _detail_data->ip_info = ip_info_append_items(_detail_data->ap,
517                         PACKAGE, list, __view_detail_imf_ctxt_evnt_cb, navi_it);
518         if (_detail_data && _detail_data->btn) {
519                 elm_object_disabled_set(_detail_data->btn, EINA_FALSE);
520         }
521         __COMMON_FUNC_EXIT__;
522         return FALSE;
523 }
524
525 static void _transition_finished_sub_cb(void *data, Evas_Object *obj, void *event_info)
526 {
527         __COMMON_FUNC_ENTER__;
528
529         Evas_Object *navi = NULL;
530         Elm_Object_Item *target_item = NULL;
531         wifi_connection_state_e connection_state;
532
533         _detail_data = (view_detail_data *)data;
534         if (!_detail_data) {
535                 __COMMON_FUNC_EXIT__;
536                 return;
537         }
538
539 #if 0
540         if (_detail_data->eap_info_list) {
541                 eap_info_save_data(_detail_data->eap_info_list);
542         }
543 #endif
544
545         navi = (Evas_Object *)viewer_manager_get_naviframe();
546         if (navi == NULL) {
547                 __COMMON_FUNC_EXIT__;
548                 return;
549         } else {
550                 ip_info_save_data(_detail_data->ip_info);
551
552                 evas_object_smart_callback_del(navi, "transition,finished",
553                                 _transition_finished_sub_cb);
554
555                 if (_detail_data->ip_info->is_info_changed == TRUE &&
556                                 _detail_data->ap != NULL) {
557                         wifi_ap_get_connection_state(_detail_data->ap, &connection_state);
558                         if (WIFI_CONNECTION_STATE_CONNECTED == connection_state) {
559                                 target_item = item_get_for_ap(_detail_data->ap);
560                                 viewer_list_item_radio_mode_set(target_item,
561                                                 VIEWER_ITEM_RADIO_MODE_CONNECTING);
562                         }
563                 }
564
565                 _remove_all(_detail_data);
566         }
567
568         __COMMON_FUNC_EXIT__;
569 }
570
571 static void gl_lang_changed(void *data, Evas_Object *obj, void *event_info)
572 {
573         elm_genlist_realized_items_update(obj);
574 }
575
576 void view_detail(wifi_device_info_t *device_info, Evas_Object *win_main,
577                 Evas_Object *btn)
578 {
579         __COMMON_FUNC_ENTER__;
580         bool favorite = 0;
581         guint id;
582         wifi_ap_h ap;
583         static Elm_Genlist_Item_Class grouptitle_itc;
584         Evas_Object *layout = NULL;
585         Evas_Object *navi_frame = NULL;
586         Evas_Object *detailview_list = NULL;
587         Elm_Object_Item *title = NULL;
588         Elm_Object_Item *navi_it = NULL;
589         Evas_Object *more_btn = NULL;
590
591         if (device_info == NULL) {
592                 ERROR_LOG(UG_NAME_NORMAL, "Failed: device_info is NULL");
593                 return;
594         }
595
596         navi_frame = viewer_manager_get_naviframe();
597         if (navi_frame == NULL) {
598                 ERROR_LOG(UG_NAME_NORMAL, "Failed to get naviframe");
599                 return;
600         }
601         ecore_imf_input_panel_hide();
602         view_detail_end = FALSE;
603
604         _detail_data = g_try_new0(view_detail_data, 1);
605         retm_if(NULL == _detail_data);
606
607         _detail_data->win = win_main;
608         _detail_data->nav = navi_frame;
609         _detail_data->ap = ap = device_info->ap;
610         wifi_ap_is_favorite(ap, &favorite);
611
612         if (device_info->ap_image_path) {
613                 _detail_data->ap_image_path = g_strdup(device_info->ap_image_path);
614         }
615         _detail_data->btn = btn;
616         if (ug_app_state->ug_type == UG_VIEW_SETUP_WIZARD) {
617                 layout = elm_layout_add(navi_frame);
618
619                 elm_layout_file_set(layout, SETUP_WIZARD_EDJ_PATH, "detail_pwlock");
620                 elm_object_domain_translatable_part_text_set(layout,
621                         "text.title", PACKAGE, "IDS_WIFI_HEADER_WI_FI_NETWORK_INFO_ABB");
622
623                 navi_it = elm_naviframe_item_push(navi_frame,
624                                         NULL, NULL, NULL, layout, NULL);
625                 elm_naviframe_item_title_enabled_set(navi_it, EINA_FALSE, EINA_FALSE);
626
627                 struct ug_data *ugd = (struct ug_data *)ug_app_state->gadget;
628                 int change_ang = elm_win_rotation_get(ugd->win_main);
629                 if (change_ang == 0 || change_ang == 180) {
630                         common_utils_contents_rotation_adjust(UG_EVENT_ROTATE_PORTRAIT);
631                         edje_object_signal_emit((Evas_Object *)elm_layout_edje_get(layout)
632                                 ,"location,vertical", "elm");
633                 } else {
634                         common_utils_contents_rotation_adjust(UG_EVENT_ROTATE_LANDSCAPE);
635                         edje_object_signal_emit((Evas_Object *)elm_layout_edje_get(layout),
636                                 "location,horizontal", "elm");
637                 }
638         } else {
639                 layout = common_utils_create_layout(navi_frame);
640
641                 navi_it = elm_naviframe_item_push(navi_frame,
642                                 "IDS_WIFI_HEADER_WI_FI_NETWORK_INFO_ABB",
643                                 NULL, NULL, layout, NULL);
644                 elm_object_item_domain_text_translatable_set(navi_it,
645                                 PACKAGE, EINA_TRUE);
646         }
647
648         evas_object_show(layout);
649
650         detailview_list = elm_genlist_add(layout);
651         assertm_if(NULL == detailview_list, "NULL!!");
652
653         elm_object_style_set(detailview_list, "dialogue");
654         _detail_data->view_detail_list = detailview_list;
655
656         evas_object_smart_callback_add(detailview_list, "language,changed",
657                         gl_lang_changed, NULL);
658
659         grouptitle_itc.item_style = WIFI_GENLIST_2LINE_BOTTOM_TEXT_ICON_STYLE;
660         grouptitle_itc.func.text_get = _view_detail_grouptitle_text_get;
661         grouptitle_itc.func.content_get = _view_detail_grouptitle_content_get;
662         grouptitle_itc.func.state_get = NULL;
663         grouptitle_itc.func.del = NULL;
664
665         /* AP name and signal strength icon */
666         title = elm_genlist_item_append(detailview_list,
667                                 &grouptitle_itc, _detail_data, NULL, ELM_GENLIST_ITEM_GROUP,
668                                 NULL, NULL);
669         elm_genlist_item_select_mode_set(title, ELM_OBJECT_SELECT_MODE_NONE);
670
671         elm_object_part_content_set(layout, "elm.swallow.content", detailview_list);
672
673         evas_object_data_set(navi_frame, SCREEN_TYPE_ID_KEY,
674                                 (void *)VIEW_MANAGER_VIEW_TYPE_DETAIL);
675
676         /* Set pop callback */
677         elm_naviframe_item_pop_cb_set(navi_it, detailview_sk_cb, _detail_data);
678
679         if (favorite) {
680                 /* Toolbar Forget button */
681 #if 0
682                 Evas_Object *toolbar = NULL;
683
684                 toolbar = elm_toolbar_add(navi_frame);
685                 elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND);
686                 elm_toolbar_transverse_expanded_set(toolbar, EINA_TRUE);
687                 elm_toolbar_select_mode_set(toolbar, ELM_OBJECT_SELECT_MODE_NONE);
688
689                 elm_toolbar_item_append(toolbar, NULL,
690                                 sc(PACKAGE, I18N_TYPE_Forget),
691                                 forget_sk_cb, _detail_data);
692
693                 elm_object_item_part_content_set(navi_it, "toolbar", toolbar);
694 #endif
695
696                 more_btn = elm_button_add(_detail_data->nav);
697                 elm_object_style_set(more_btn, "naviframe/more/default");
698                 evas_object_smart_callback_add(more_btn, "clicked",
699                                 _create_ctxpopup_forget_btn_cb, win_main);
700                 elm_object_item_part_content_set(navi_it, "toolbar_more_btn", more_btn);
701         }
702
703         wifi_security_type_e type = WIFI_SECURITY_TYPE_NONE;
704         wifi_ap_get_security_type(ap, &type);
705         if (WIFI_SECURITY_TYPE_EAP == type) {
706                 wifi_connection_state_e connection_state;
707                 wifi_ap_get_connection_state(ap, &connection_state);
708                 if (favorite || WIFI_CONNECTION_STATE_CONNECTED == connection_state) {
709                         _detail_data->eap_info_list = eap_info_append_items(ap,
710                                         detailview_list, PACKAGE, __view_detail_imf_ctxt_evnt_cb,
711                                         navi_it);
712                 }
713         }
714
715         /* Append the ip info details */
716         id = common_util_managed_idle_add(__view_detail_load_ip_info_list_cb, _detail_data);
717         if (!id) {
718                 g_free(_detail_data);
719         }
720
721         __COMMON_FUNC_EXIT__;
722 }