d924dec1e451633bd349126b6430781000f12af8
[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         Eina_Bool show_wps_btn;
42         Evas_Smart_Cb ok_cb;
43         Evas_Smart_Cb cancel_cb;
44         Evas_Smart_Cb wps_btn_cb;
45         Evas_Smart_Cb wps_pin_cb;
46         wifi_manager_ap_h ap;
47         void *cb_data;
48         wifi_manager_security_type_e sec_type;
49 } pswd_popup_create_req_data_t;
50
51 typedef struct {
52         /* PBC popup related attributes */
53         Evas_Object* popup;
54         Evas_Object* progressbar;
55         Evas_Object* timer_label;
56         Ecore_Timer *timer;
57         int checker;
58         double value;
59         char *pin;
60         popup_type_t wps_type;
61 } pbc_popup_t;
62
63 struct pswd_popup {
64         /* Password popup related attributes */
65         const char *str_pkg_name;
66         Evas_Object *conf;
67         Evas_Object *win;
68         Evas_Object *popup;
69         Evas_Object *entry;
70         Evas_Object *info_popup;
71         Evas_Object *wps_options_popup;
72         Elm_Object_Item *wps_options_item;
73         Evas_Smart_Cb wps_btn_cb;
74         pbc_popup_t *pbc_popup_data;
75         wifi_manager_ap_h ap;
76         wifi_manager_security_type_e sec_type;
77         char *curr_ap_name;
78         Eina_Bool show_wps_btn;
79         time_t start_time;
80 };
81
82 typedef struct pswd_popup pswd_popup_t;
83
84 pswd_popup_t *create_passwd_popup(Evas_Object *conformant,
85                 Evas_Object *win_main, const char *pkg_name,
86                 pswd_popup_create_req_data_t *popup_info);
87 void create_pbc_popup(pswd_popup_t *pswd_popup_data, Evas_Smart_Cb cancel_cb,
88                 void *cancel_cb_data, popup_type_t type, char *pin);
89 void create_wps_options_popup(Evas_Object *win_main,
90                 pswd_popup_t *pswd_popup_data,
91                 pswd_popup_create_req_data_t *popup_info);
92
93 void current_popup_free(pswd_popup_t *pswd_popup_data, popup_type_t type);
94 void passwd_popup_show(pswd_popup_t *pswd_popup_data);
95 void passwd_popup_hide(pswd_popup_t *pswd_popup_data);
96 void passwd_popup_free(pswd_popup_t *pswd_popup_data);
97
98 char *passwd_popup_get_txt(pswd_popup_t *pswd_popup_data);
99 wifi_manager_ap_h passwd_popup_get_ap(pswd_popup_t *pswd_popup_data);
100
101 #ifdef __cplusplus
102 }
103 #endif
104
105 #endif