4 * Copyright 2012-2013 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.
21 * This file declares wifi direct application functions.
24 * @author Sungsik Jang (sungsik.jang@samsung.com)
29 #ifndef __WFD_SYS_POPAPP_MAIN_H__
30 #define __WFD_SYS_POPAPP_MAIN_H__
32 #include <appcore-efl.h>
34 #include <Elementary.h>
37 #include <notification.h>
38 #include <syspopup_caller.h>
39 #include "wifi-direct.h"
41 #define PACKAGE "org.tizen.wifi-direct-popup"
42 #define EDJ_NAME RESDIR"/edje/wifi-direct-popup.edj"
43 #define WFD_MAX_PEER_NUM 10
44 #define WFD_POP_STR_MAX_LEN 256
45 #define NO_ACTION_TIME_OUT 300 /*5min*/
47 #define NOTIFICATION_BUNDLE_PARAM "NotiType"
48 #define NOTIFICATION_BUNDLE_VALUE "WiFi-Direct"
49 #define TICKERNOTI_SYSPOPUP "tickernoti-syspopup"
52 #define LOCALE_FILE_NAME "wifi-direct-popup"
53 #define LOCALEDIR "/usr/apps/org.tizen.wifi-direct-popup/res/locale"
55 #define _(s) dgettext(LOCALE_FILE_NAME, s)
56 #define N_(s) dgettext_noop(s)
57 #define S_(s) dgettext("sys_string", s)
63 WFD_POP_TIMER_10 = 10,
64 WFD_POP_TIMER_30 = 30,
65 WFD_POP_TIMER_120 = 120,
69 WFD_POP_APRV_CONNECTION_WPS_PUSHBUTTON_REQ,
70 WFD_POP_APRV_CONNECTION_WPS_DISPLAY_REQ,
71 WFD_POP_APRV_CONNECTION_WPS_KEYPAD_REQ,
72 WFD_POP_APRV_CONNECTION_INVITATION_REQ,
75 WFD_POP_PROG_DISCONNECT,
76 WFD_POP_PROG_CONNECT_CANCEL,
77 WFD_POP_PROG_CONNECT_WITH_PIN,
78 WFD_POP_PROG_CONNECT_WITH_KEYPAD,
79 WFD_POP_NOTI_DISCONNECTED,
87 WFD_POP_RESP_APRV_CONNECT_PBC_YES = 1,
88 WFD_POP_RESP_APRV_CONNECT_INVITATION_YES,
89 WFD_POP_RESP_APRV_CONNECT_DISPLAY_OK,
90 WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES,
91 WFD_POP_RESP_APRV_CONNECT_NO,
92 WFD_POP_RESP_PROG_CONNECT_KEYPAD_OK,
93 WFD_POP_RESP_APRV_ENTER_PIN_YES,
94 WFD_POP_RESP_APRV_ENTER_PIN_NO,
99 char text[WFD_POP_STR_MAX_LEN];
100 char label1[WFD_POP_STR_MAX_LEN];
101 char label2[WFD_POP_STR_MAX_LEN];
110 char mac_address[18];
116 Evas_Object *pin_entry;
117 wfd_popup_t *popup_data;
118 uint popup_timeout_handle;
122 wfd_device_info_t *discovered_peers;
123 int discovered_peer_count;
127 wfd_device_info_t raw_connected_peers[WFD_MAX_PEER_NUM];
128 int raw_connected_peer_cnt;
131 wifi_direct_state_e wfd_status;
132 int last_wfd_transmit_time;
133 Ecore_Timer *transmit_timer;
138 Evas_Object *progressbar;
140 } wfd_wps_display_popup_t;
142 extern wfd_appdata_t *wfd_get_appdata();
145 * This function let the app do initialization
146 * @return If success, return TRUE, else return FALSE
147 * @param[in] ad the pointer to the main data structure
149 int init_wfd_popup_client(wfd_appdata_t *ad);
152 * This function let the app do de-initialization
153 * @return If success, return TRUE, else return FALSE
154 * @param[in] ad the pointer to the main data structure
156 int deinit_wfd_popup_client(wfd_appdata_t *ad);
160 * This function let the app destroy the popup
164 extern void wfd_destroy_popup();
167 * This function let the app create a popup
169 * @param[in] type the type of popup
170 * @param[in] userdata the pointer to the data which will be used
172 extern void wfd_prepare_popup(int type, void *userdata);
174 #endif /* __WFD_SYS_POPAPP_MAIN_H__ */