apply FSL(Flora Software License)
[apps/home/ug-wifi-direct.git] / popup-wifidirect / include / wfd-app.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  * 
8  *    http://www.tizenopensource.org/license
9  * 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /*
18  * This file declares wifi direct popup application functions.
19  *
20  * @file    wfd-app.h
21  * @author  Sungsik Jang (sungsik.jang@samsung.com)
22  * @version 0.1
23  */
24
25
26 #ifndef __WFD_SYS_POPAPP_MAIN_H__
27 #define __WFD_SYS_POPAPP_MAIN_H__
28
29 #include <appcore-efl.h>
30 #include <Ecore_X.h>
31 #include <Elementary.h>
32 #include <appsvc.h>
33 #include <aul.h>
34
35 #define PACKAGE "wifi-direct-popup"
36 #define EDJ_NAME RESDIR"/edje/wifi-direct-popup.edj"
37 #define LOCALEDIR "/opt/apps/org.tizen.wifi-direct-popup/res/locale"
38 #define WFD_POP_STR_MAX_LEN             128
39
40 enum
41 {
42     WFD_POP_TIMER_3 = 3,
43     WFD_POP_TIMER_10 = 10,
44     WFD_POP_TIMER_30 = 30,
45     WFD_POP_TIMER_120 = 120,
46 };
47
48 enum
49 {
50     WFD_POP_APRV_CONNECTION_WPS_PUSHBUTTON_REQ,
51     WFD_POP_APRV_CONNECTION_WPS_DISPLAY_REQ,
52     WFD_POP_APRV_CONNECTION_WPS_KEYPAD_REQ,
53
54     WFD_POP_PROG_CONNECT,
55     WFD_POP_PROG_DISCONNECT,
56     WFD_POP_PROG_CONNECT_CANCEL,
57     WFD_POP_PROG_CONNECT_WITH_PIN,
58     WFD_POP_PROG_CONNECT_WITH_KEYPAD,
59     WFD_POP_NOTI_CONNECTED,
60     WFD_POP_NOTI_DISCONNECTED,
61
62     WFD_POP_FAIL_INIT,
63     WFD_POP_FAIL_CONNECT,
64     WFD_POP_INCORRECT_PIN,
65
66 };
67
68 enum
69 {
70     WFD_POP_RESP_OK,
71     WFD_POP_RESP_CANCEL,
72     WFD_POP_RESP_APRV_CONNECT_PBC_YES = 1,
73     WFD_POP_RESP_APRV_CONNECT_DISPLAY_YES,
74     WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES,
75     WFD_POP_RESP_APRV_CONNECT_NO,
76     WFD_POP_RESP_PROG_CONNECT_CANCEL,
77     WFD_POP_RESP_PROG_CONNECT_KEYPAD_OK,
78     WFD_POP_RESP_APRV_ENTER_PIN_YES,
79     WFD_POP_RESP_APRV_ENTER_PIN_NO,
80 };
81
82 typedef struct
83 {
84     int type;
85     char text[WFD_POP_STR_MAX_LEN];
86     char label1[WFD_POP_STR_MAX_LEN];
87     char label2[WFD_POP_STR_MAX_LEN];
88     int timeout;
89     int resp_data1;
90     int resp_data2;
91     int data;
92 } wfd_popup_t;
93
94 typedef struct
95 {
96     char ssid[32];
97     char mac_address[18];
98 } wfd_device_info_t;
99
100 typedef struct
101 {
102     Evas_Object *win;
103     Evas_Object *popup;
104     Evas_Object *pin_entry;
105     wfd_popup_t *popup_data;
106     uint popup_timeout_handle;
107     char pin_number[32];
108     char peer_mac[18];
109     char peer_name[32];
110     wfd_device_info_t *discovered_peers;
111     int discovered_peer_count;
112 } wfd_appdata_t;
113
114
115 extern wfd_appdata_t *wfd_get_appdata();
116 extern void wfd_destroy_popup();
117 extern void wfd_prepare_popup(int type, void *userdata);
118
119 #endif                          /* __WFD_SYS_POPAPP_MAIN_H__ */