4 * Copyright 2012 Samsung Electronics Co., Ltd
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
10 * http://www.tizenopensource.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.
20 #ifndef __WFD_UG_VIEW_H__
21 #define __WFD_UG_VIEW_H__
24 #include <syspopup_caller.h>
26 #define EDJDIR "/usr/ug/res/edje/ug-setting-wifidirect-efl"
27 #define WFD_UG_EDJ_PATH EDJDIR"/wfd_ug.edj"
28 #define WFD_IMG_DIR "/usr/ug/res/images/ug-setting-wifidirect-efl"
29 #define TICKERNOTI_SYSPOPUP "tickernoti-syspopup"
34 #define WFD_ICON_DEVICE_COMPUTER WFD_IMG_DIR"/A09_device_computer.png"
35 #define WFD_ICON_DEVICE_INPUT_DEVICE WFD_IMG_DIR"/A09_device_input_device.png"
36 #define WFD_ICON_DEVICE_PRINTER WFD_IMG_DIR"/A09_device_printer.png"
37 #define WFD_ICON_DEVICE_CAMERA WFD_IMG_DIR"/A09_device_camera.png"
38 #define WFD_ICON_DEVICE_STORAGE WFD_IMG_DIR"/A09_device_storage.png"
39 #define WFD_ICON_DEVICE_NETWORK_INFRA WFD_IMG_DIR"/A09_device_network_infrastructure.png"
40 #define WFD_ICON_DEVICE_DISPLAY WFD_IMG_DIR"/A09_device_display.png"
41 #define WFD_ICON_DEVICE_MULTIMEDIA_DEVICE WFD_IMG_DIR"/A09_device_multimedia_devices.png"
42 #define WFD_ICON_DEVICE_GAMING_DEVICE WFD_IMG_DIR"/A09_device_gaming_devices.png"
43 #define WFD_ICON_DEVICE_TELEPHONE WFD_IMG_DIR"/A09_device_telephone.png"
44 #define WFD_ICON_DEVICE_AUDIO_DEVICE WFD_IMG_DIR"/A09_device_audio_devices.png"
46 #define WFD_ICON_DEVICE_COMPUTER_CONNECT WFD_IMG_DIR"/A09_device_computer_connect.png"
47 #define WFD_ICON_DEVICE_INPUT_DEVICE_CONNECT WFD_IMG_DIR"/A09_device_input_device_connect.png"
48 #define WFD_ICON_DEVICE_PRINTER_CONNECT WFD_IMG_DIR"/A09_device_printer_connect.png"
49 #define WFD_ICON_DEVICE_CAMERA_CONNECT WFD_IMG_DIR"/A09_device_camera_connect.png"
50 #define WFD_ICON_DEVICE_STORAGE_CONNECT WFD_IMG_DIR"/A09_device_storage_connect.png"
51 #define WFD_ICON_DEVICE_NETWORK_INFRA_CONNECT WFD_IMG_DIR"/A09_device_network_infrastructure_connect.png"
52 #define WFD_ICON_DEVICE_DISPLAY_CONNECT WFD_IMG_DIR"/A09_device_display_connect.png"
53 #define WFD_ICON_DEVICE_MULTIMEDIA_DEVICE_CONNECT WFD_IMG_DIR"/A09_device_multimedia_devices_connect.png"
54 #define WFD_ICON_DEVICE_GAMING_DEVICE_CONNECT WFD_IMG_DIR"/A09_device_gaming_devices_connect.png"
55 #define WFD_ICON_DEVICE_TELEPHONE_CONNECT WFD_IMG_DIR"/A09_device_telephone_connect.png"
56 #define WFD_ICON_DEVICE_AUDIO_DEVICE_CONNECT WFD_IMG_DIR"/A09_device_audio_devices_connect.png"
58 #define WFD_ICON_CONNECTED WFD_IMG_DIR"/A09_Connect.png"
62 HEAD_TEXT_TYPE_DIRECT,
63 HEAD_TEXT_TYPE_DEACTIVATING,
64 HEAD_TEXT_TYPE_ACTIVATING,
65 HEAD_TEXT_TYPE_ACTIVATED,
66 HEAD_TEXT_TYPE_SCANING,
72 POPUP_TYPE_HOTSPOT_OFF,
75 POPUP_TYPE_ACTIVATE_FAIL,
76 POPUP_TYPE_DEACTIVATE_FAIL,
79 POPUP_TYPE_LINK_TIMEOUT,
82 POPUP_TYPE_UNKNOWN_ERROR,
90 POP_TYPE_DISCONNECT_ALL,
96 POP_TYPE_MULTI_CONNECT_POPUP,
99 POP_TYPE_BUSY_DEVICE_POPUP,
101 /* Automaticlly turn off */
102 POP_TYPE_AUTOMATIC_TURN_OFF,
105 struct ug_data *wfd_get_ug_data();
108 * This function let the ug create the main view
110 * @param[in] data the pointer to the main data structure
112 void create_wfd_ug_view(void *data);
115 * This function let the ug destroy the main view
117 * @param[in] data the pointer to the main data structure
119 void destroy_wfd_ug_view(void *data);
122 * This function let the ug update the genlist item
124 * @param[in] obj the pointer to genlist item
126 void wfd_ug_view_refresh_glitem(void *obj);
129 * This function let the ug refresh the attributes of button
131 * @param[in] obj the pointer to the button
132 * @param[in] text the pointer to the text of button
133 * @param[in] enable whether the button is disabled
135 void wfd_ug_view_refresh_button(void *obj, const char *text, int enable);
138 * This function let the ug update the peers
140 * @param[in] data the pointer to the main data structure
142 void wfd_ug_view_update_peers(void *data);
145 * This function let the ug free the peers
147 * @param[in] data the pointer to the main data structure
149 void wfd_ug_view_free_peers(void *data);
152 * This function let the ug create a action popup
154 * @param[in] data the pointer to the main data structure
155 * @param[in] message the pointer to the text of popup
156 * @param[in] popup_type the message type
158 void wfd_ug_act_popup(void *data, const char *message, int popup_type);
161 * This function let the ug remove the action popup
163 * @param[in] data the pointer to the main data structure
165 void wfg_ug_act_popup_remove(void *data);
168 * This function let the ug create a warning popup
170 * @param[in] data the pointer to the main data structure
171 * @param[in] message the pointer to the text of popup
172 * @param[in] popup_type the message type
174 void wfd_ug_warn_popup(void *data, const char *message, int popup_type);
177 * This function let the ug change the text of multi button
178 * @return If success, return 0, else return -1
179 * @param[in] data the pointer to the main data structure
181 int _change_multi_button_title(void *data);
184 * This function let the ug create about view
186 * @param[in] ugd the pointer to the main data structure
188 void _wifid_create_about_view(struct ug_data *ugd);
191 * This function let the ug create the view for multi connection
193 * @param[in] ugd the pointer to the main data structure
195 void _wifid_create_multiconnect_view(struct ug_data *ugd);
198 * This function let the ug call it when click 'back' button
200 * @param[in] data the pointer to the main data structure
201 * @param[in] obj the pointer to the evas object
202 * @param[in] event_info the pointer to the event information
204 void _back_btn_cb(void *data, Evas_Object * obj, void *event_info);
207 * This function let the ug call it when click 'scan' button
209 * @param[in] data the pointer to the main data structure
210 * @param[in] obj the pointer to the evas object
211 * @param[in] event_info the pointer to the event information
213 void _scan_btn_cb(void *data, Evas_Object * obj, void *event_info);
216 * This function let the ug call it when click 'multi connect' button
218 * @param[in] data the pointer to the main data structure
219 * @param[in] obj the pointer to the evas object
220 * @param[in] event_info the pointer to the event information
222 void _wifid_create_multibutton_cb(void *data, Evas_Object *obj, void *event_info);
225 * This function let the ug get the found peers
226 * @return If success, return 0, else return -1
227 * @param[in] ugd the pointer to the main data structure
229 int wfd_ug_get_discovered_peers(struct ug_data *ugd);
232 * This function let the ug get the connected peers
233 * @return If success, return 0, else return -1
234 * @param[in] ugd the pointer to the main data structure
236 int wfd_ug_get_connected_peers(struct ug_data *ugd);
239 * This function let the ug get the device status
240 * @return If success, return 0-3(available: 0, connected: 1, busy: 2, connected failed: 3), else return -1
241 * @param[in] ugd the pointer to the main data structure
242 * @param[in] device the pointer to the number of connected failed devices
244 int wfd_get_device_status(void *data, device_type_s *device);
247 * This function let the ug refresh current status of wi-fi direct
248 * @return If success, return 0, else return -1
249 * @param[in] data the pointer to the main data structure
251 int wfd_refresh_wifi_direct_state(void *data);
254 * This function let the ug free the selected peers in multi connect view
256 * @param[in] data the pointer to the main data structure
258 void wfd_free_multi_selected_peers(void *data);
261 * This function let the ug stop to connect to selected peer
262 * @return If success, return 0, else return -1
263 * @param[in] data the pointer to the main data structure
265 int wfd_stop_multi_connect(void *data);
268 * This function let the ug connect to the next selected peer automatically
269 * @return If stop the timer, return false, else return true
270 * @param[in] data the pointer to the main data structure
272 gboolean wfd_multi_connect_next_cb(void *data);
275 * This function let the ug add a dialogue separator
276 * @return the separator item
277 * @param[in] genlist the pointer to the genlist
278 * @param[in] separator_style the style of separator
280 Elm_Object_Item *wfd_add_dialogue_separator(Evas_Object *genlist, const char *separator_style);
283 * This function let the ug fee the multi connect devices
285 * @param[in] data the pointer to the main data structure
287 int wfd_free_multiconnect_device(struct ug_data *ugd);
290 * This function let the ug update the multi connect devices
292 * @param[in] data the pointer to the main data structure
294 int wfd_update_multiconnect_device(struct ug_data *ugd);
297 * This function let the ug create the view for multi connection
299 * @param[in] ugd the pointer to the main data structure
301 void wfd_create_multiconnect_view(struct ug_data *ugd);
304 #endif /* __WFD_UG_VIEW_H__ */