Implement OOBE view #6
[apps/native/ug-wifi-efl.git] / sources / libraries / Common / include / common_pswd_popup.h
1 /*
2  * Wi-Fi
3  *
4  * Copyright 2012 Samsung Electronics Co., Ltd
5  *
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
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
20 #ifndef __COMMON_PSWD_POPUP_H__
21 #define __COMMON_PSWD_POPUP_H__
22
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27
28 #include <Evas.h>
29 #include <wifi-manager.h>
30
31 #include "common_utils.h"
32
33 typedef enum {
34         POPUP_WPS_OPTIONS,
35         POPUP_WPS_PIN,
36         POPUP_WPS_BTN,
37 } popup_type_t;
38
39 typedef struct {
40         char *title;
41         char *sub_title;
42         Eina_Bool show_wps_btn;
43         Evas_Smart_Cb ok_cb;
44         Evas_Smart_Cb cancel_cb;
45         Evas_Smart_Cb wps_btn_cb;
46         Evas_Smart_Cb wps_pin_cb;
47         wifi_manager_ap_h ap;
48         void *cb_data;
49         wifi_manager_security_type_e sec_type;
50 } pswd_popup_create_req_data_t;
51
52 typedef struct {
53         /* PBC popup related attributes */
54         Evas_Object* popup;
55         Evas_Object* progressbar;
56         Evas_Object* timer_label;
57         Ecore_Timer *timer;
58         int checker;
59         double value;
60         char *pin;
61         popup_type_t wps_type;
62 } pbc_popup_t;
63
64 struct pswd_popup {
65         /* Password popup related attributes */
66         const char *str_pkg_name;
67         Evas_Object *conf;
68         Evas_Object *win;
69         Evas_Object *popup;
70         Evas_Object *entry;
71         Evas_Object *info_popup;
72         Evas_Object *wps_options_popup;
73         Elm_Object_Item *wps_options_item;
74         Evas_Smart_Cb wps_btn_cb;
75         pbc_popup_t *pbc_popup_data;
76         wifi_manager_ap_h ap;
77         wifi_manager_security_type_e sec_type;
78         char *curr_ap_name;
79         Eina_Bool show_wps_btn;
80         time_t start_time;
81 };
82
83 typedef struct pswd_popup pswd_popup_t;
84
85 pswd_popup_t *create_passwd_popup(Evas_Object *conformant,
86                 Evas_Object *win_main, const char *pkg_name,
87                 pswd_popup_create_req_data_t *popup_info);
88 void create_pbc_popup(pswd_popup_t *pswd_popup_data, Evas_Smart_Cb cancel_cb,
89                 void *cancel_cb_data, popup_type_t type, char *pin);
90 void create_wps_options_popup(Evas_Object *win_main,
91                 pswd_popup_t *pswd_popup_data,
92                 pswd_popup_create_req_data_t *popup_info);
93
94 void current_popup_free(pswd_popup_t *pswd_popup_data, popup_type_t type);
95 void passwd_popup_show(pswd_popup_t *pswd_popup_data);
96 void passwd_popup_hide(pswd_popup_t *pswd_popup_data);
97 void passwd_popup_free(pswd_popup_t *pswd_popup_data);
98
99 char *passwd_popup_get_txt(pswd_popup_t *pswd_popup_data);
100 wifi_manager_ap_h passwd_popup_get_ap(pswd_popup_t *pswd_popup_data);
101
102 #ifdef __cplusplus
103 }
104 #endif
105
106 #endif