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__
25 #define EDJDIR "/usr/apps/setting-wifidirect-efl/res/edje/ug-setting-wifidirect-efl"
26 #define WFD_UG_EDJ_PATH EDJDIR"/wfd_ug.edj"
27 #define WFD_IMG_DIR "/usr/apps/setting-wifidirect-efl/res/images/ug-setting-wifidirect-efl"
30 #define WFD_ICON_DEVICE_COMPUTER "A09_device_computer.png"
31 #define WFD_ICON_DEVICE_INPUT_DEVICE "A09_device_input_device.png"
32 #define WFD_ICON_DEVICE_PRINTER "A09_device_printer.png"
33 #define WFD_ICON_DEVICE_CAMERA "A09_device_camera.png"
34 #define WFD_ICON_DEVICE_STORAGE "A09_device_storage.png"
35 #define WFD_ICON_DEVICE_NETWORK_INFRA "A09_device_network_infrastructure.png"
36 #define WFD_ICON_DEVICE_DISPLAY "A09_device_display.png"
37 #define WFD_ICON_DEVICE_MULTIMEDIA "A09_device_multimedia.png"
38 #define WFD_ICON_DEVICE_GAMING "A09_device_gaming.png"
39 #define WFD_ICON_DEVICE_TELEPHONE "A09_device_telephone.png"
40 #define WFD_ICON_DEVICE_HEADSET "A09_device_headset.png"
41 #define WFD_ICON_DEVICE_UNKNOWN "A09_device_unknown.png"
42 #define WFD_ICON_DEVICE_BD "U04_device_BD.png"
43 #define WFD_ICON_DEVICE_DONGLE "U04_device_Dongle.png"
44 #define WFD_ICON_DEVICE_HOME_THEATER "U04_device_Home_Theater.png"
45 #define WFD_ICON_DEVICE_STB "U04_device_STB.png"
48 #define WFD_ICON_DEVICE_HEADPHONE "A09_device_headphone.png"
49 #define WFD_ICON_DEVICE_MEDICAL "A09_device_Medical.png"
50 #define WFD_ICON_DEVICE_MOUSE "A09_device_mouse.png"
52 #define WFD_ICON_DEVICE_MORE_HELP "A09_popup_help.png"
55 HEAD_TEXT_TYPE_DIRECT,
56 HEAD_TEXT_TYPE_DEACTIVATING,
57 HEAD_TEXT_TYPE_ACTIVATING,
58 HEAD_TEXT_TYPE_ACTIVATED,
62 TITLE_CONTENT_TYPE_NONE,
63 TITLE_CONTENT_TYPE_SCANNING,
64 TITLE_CONTENT_TYPE_FOUND,
70 #ifndef MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE
74 POPUP_TYPE_HOTSPOT_OFF = 1,
77 POPUP_TYPE_ACTIVATE_FAIL,
78 POPUP_TYPE_ACTIVATE_FAIL_POLICY_RESTRICTS,
79 POPUP_TYPE_DEACTIVATE_FAIL,
82 POPUP_TYPE_LINK_TIMEOUT,
85 POPUP_TYPE_UNKNOWN_ERROR,
89 POPUP_TYPE_TERMINATE_DEACTIVATE_FAIL,
90 POPUP_TYPE_TERMINATE_NOT_SUPPORT,
95 POP_TYPE_CANCEL_CONNECT,
97 POP_TYPE_ACCEPT_CONNECTION,
103 POP_TYPE_MULTI_CONNECT_POPUP,
106 POP_TYPE_BUSY_DEVICE_POPUP,
108 /* Automaticlly turn off */
109 POP_TYPE_AUTOMATIC_TURN_OFF,
112 struct ug_data *wfd_get_ug_data();
115 * This function let the ug create the main view
117 * @param[in] data the pointer to the main data structure
119 void create_wfd_ug_view(void *data);
122 * This function let the ug destroy the main view
124 * @param[in] data the pointer to the main data structure
126 void destroy_wfd_ug_view(void *data);
129 * This function let the ug update the genlist item
131 * @param[in] gl_item the pointer to genlist item
133 void wfd_ug_view_refresh_glitem(Elm_Object_Item *gl_item);
136 * This function let the ug refresh the attributes of button
138 * @param[in] tb_item the pointer to the toolbar button
139 * @param[in] text the pointer to the text of button
140 * @param[in] enable whether the button is disabled
142 void wfd_ug_view_refresh_button(Evas_Object *tb_item, const char *text,
146 * This function let the ug update the peers
148 * @param[in] data the pointer to the main data structure
150 void wfd_ug_view_update_peers(void *data);
153 * This function let the ug free the peers
155 * @param[in] data the pointer to the main data structure
157 void wfd_ug_view_free_peers(void *data);
160 * This function let the ug create a action popup
162 * @param[in] data the pointer to the main data structure
163 * @param[in] message the pointer to the text of popup
164 * @param[in] popup_type the message type
166 void wfd_ug_act_popup(void *data, const char *message, int popup_type);
169 * This function let the ug remove the action popup
171 * @param[in] data the pointer to the main data structure
173 void wfg_ug_act_popup_remove(void *data);
176 * This function let the ug create a warning popup
178 * @param[in] data the pointer to the main data structure
179 * @param[in] message the pointer to the text of popup
180 * @param[in] popup_type the message type
182 void wfd_ug_warn_popup(void *data, const char *message, int popup_type);
185 * This function let the ug create the view for multi connection
187 * @param[in] ugd the pointer to the main data structure
189 void _wifid_create_multiconnect_view(struct ug_data *ugd);
192 * This function let the ug call it when click 'back' button
194 * @param[in] data the pointer to the main data structure
195 * @param[in] obj the pointer to the evas object
196 * @param[in] event_info the pointer to the event information
198 Eina_Bool _back_btn_cb(void *data, Elm_Object_Item *it);
201 * This function let the ug call it when click 'scan' button
203 * @param[in] data the pointer to the main data structure
204 * @param[in] obj the pointer to the evas object
205 * @param[in] event_info the pointer to the event information
207 void _scan_btn_cb(void *data, Evas_Object * obj, void *event_info);
210 * This function let the ug call it when click 'disconnect' button
212 * @param[in] data the pointer to the main data structure
213 * @param[in] obj the pointer to the evas object
214 * @param[in] event_info the pointer to the event information
216 void _wfd_ug_disconnect_button_cb(void *data, Evas_Object *obj, void *event_info);
219 * This function let the ug call it when click "Cancel Connection" button
221 * @param[in] data the pointer to the main data structure
222 * @param[in] obj the pointer to the evas object
223 * @param[in] event_info the pointer to the event information
225 void _wfd_ug_cancel_connection_button_cb(void *data, Evas_Object *obj, void *event_info);
228 * This function let the ug get the found peers
229 * @return If success, return 0, else return -1
230 * @param[in] ugd the pointer to the main data structure
232 int wfd_ug_get_discovered_peers(struct ug_data *ugd);
235 * This function let the ug get the connecting peer mac
236 * @return If success, return 0, else return -1
237 * @param[in] ugd the pointer to the main data structure
239 int wfd_ug_get_connecting_peer(struct ug_data *ugd);
242 * This function let the ug get the connected peers
243 * @return If success, return 0, else return -1
244 * @param[in] ugd the pointer to the main data structure
246 int wfd_ug_get_connected_peers(struct ug_data *ugd);
249 * This function let the ug get the device status
250 * @return If success, return 0-3(available: 0, connected: 1, busy: 2, connected failed: 3), else return -1
251 * @param[in] ugd the pointer to the main data structure
252 * @param[in] device the pointer to the number of connected failed devices
254 //int wfd_get_device_status(void *data, device_type_s *device);
257 * This function let the ug refresh current status of wi-fi direct
258 * @return If success, return 0, else return -1
259 * @param[in] data the pointer to the main data structure
261 int wfd_refresh_wifi_direct_state(void *data);
264 * This function let the ug free the selected peers in multi connect view
266 * @param[in] data the pointer to the main data structure
268 void wfd_free_multi_selected_peers(void *data);
271 * This function let the ug stop to connect to selected peer
272 * @return If success, return 0, else return -1
273 * @param[in] data the pointer to the main data structure
275 int wfd_stop_multi_connect(void *data);
278 * This function let the ug connect to the next selected peer automatically
279 * @return If stop the timer, return false, else return true
280 * @param[in] data the pointer to the main data structure
282 gboolean wfd_multi_connect_next_cb(void *data);
285 * This function let the ug add a dialogue separator
286 * @return the separator item
287 * @param[in] genlist the pointer to the genlist
288 * @param[in] separator_style the style of separator
290 Elm_Object_Item *wfd_add_dialogue_separator(Evas_Object *genlist,
291 const char *separator_style);
294 * This function let the ug free the multi connect devices
296 * @param[in] data the pointer to the main data structure
298 int wfd_free_multiconnect_device(struct ug_data *ugd);
301 * This function let the ug update the multi connect devices
303 * @param[in] ugd the pointer to the main data structure
304 * @param[in] is_free_all_peers true to free all peers
306 int wfd_update_multiconnect_device(struct ug_data *ugd, bool is_free_all_peers);
309 * This function let the ug create the view for multi connection
311 * @param[in] ugd the pointer to the main data structure
313 void wfd_create_multiconnect_view(struct ug_data *ugd);
316 * This function let the ug delete search progressbar
318 * @param[in] user_data the pointer to the main data structure
320 int wfd_delete_progressbar_cb(void *user_data);
323 * This function let the ug insert peer item to genlist
325 * @param[in] genlist the pointer to genlist
326 * @param[in] item the pointer to item to insert after
327 * @param[in] itc Elm_Gen_Item_Class
328 * @param[in] start_pos the pointer to the start position of peer array
329 * @param[in] peer_for_insert the pointer to the peer to insert
330 * @param[in] callback callback for peer select
332 int insert_gl_item(Evas_Object *genlist, Elm_Object_Item *item,
333 Elm_Gen_Item_Class *itc, device_type_s **start_pos,
334 device_type_s *peer_for_insert, void *callback);
337 * This function let the ug get the insert position for next item
338 * @return item the position to insert after
339 * @param[in] peer the pointer to peer to search
340 * @param[in] pre_item the title item of peer list
341 * @param[in] peer_cnt the count of gl peers
343 Elm_Object_Item *get_insert_postion(device_type_s *peer,
344 Elm_Object_Item *pre_item, int peer_cnt);
347 * This function let the ug find a peer in genlist
348 * @return peer the pointer of peer that found
349 * @param[in] start_pos the start position of peers list
350 * @param[in] mac_addr the mac_addr of peer for search
352 device_type_s *find_peer_in_glist(device_type_s *start_pos, const char *mac_addr);
355 * This function let the ug free gl peers
357 * @param[in] gl_peers_start the start pointer of peer list that for free
359 void wfd_ug_view_free_peer(device_type_s *gl_peers_start);
362 * This function let the ug exits automatically after successed connection
364 * @param[in] user_data the pointer to the main data structure
366 void _wfd_ug_auto_exit(void *user_data);
369 * This function let the ug update the buttons of toolbar
371 * @param[in] ugd the pointer to the main data structure
373 void wfd_ug_update_toolbar(struct ug_data *ugd);
376 * This function let the ug update the available and busy peers
378 * @param[in] data the pointer to the main data structure
380 void wfd_ug_update_available_peers(void *data);
383 * This function let the ug init the genlist
385 * @param[in] data the pointer to the main data structure
386 * @param[in] is_free_all_peers true to free all peer items
388 void wfd_ug_view_init_genlist(void *data, bool is_free_all_peers);
391 * This function let the ug delete dead peers
393 * @param[in] ugd the pointer to the main data structure
394 * @param[in] start_pos the pointer to start of peer list
395 * @param[in] cnt the pointer to the number of peets in list
397 void delete_not_alive_peers(struct ug_data *ugd, device_type_s **start_pos,
401 * This function let the ug mark up the dead peers
403 * @param[in] ugd the pointer to the main data structure
404 * @param[in] start_pos the pointer to start of peer list
406 void set_not_alive_peers(device_type_s *start_pos);
409 * This function let the ug update connected peers
411 * @param[in] data the pointer to the main data structure
413 void wfd_ug_update_connected_peers(void *data);
416 * This function let the ug update the multi-connect peers
418 * @param[in] data the pointer to the main data structure
420 void wfd_ug_view_update_multiconn_peers(void *data);
423 * This function let the ug update the failed peers
425 * @param[in] data the pointer to the main data structure
427 void wfd_ug_update_failed_peers(void *data);
430 * This function let the ug cancel progressbar stop timer
432 * @param[in] ugd the pointer to the main data structure
434 void wfd_cancel_progressbar_stop_timer(struct ug_data *ugd);
437 * This function let the ug cancel not-alive devices delete timer
439 * @param[in] ugd the pointer to the main data structure
441 void wfd_cancel_not_alive_delete_timer(struct ug_data *ugd);
444 * This function let the ug move ctxpopup to specified location
447 void _ctxpopup_move();
449 int _create_available_dev_genlist(void *data);
451 Evas_Object *_create_no_device_genlist(void *data);
453 Evas_Object *_create_no_device_multiconnect_genlist(struct ug_data *ugd);
456 * This function let the ug create rename popup
458 * @param[in] data the pointer to the main data structure
461 void _gl_rename_device_sel(void *data, Evas_Object *obj, void *event_info);
463 #ifdef WFD_ON_OFF_GENLIST
465 * This function let the ug create on off check
467 * @param[in] parent the pointer to the naviframe
469 void wfd_ug_create_on_off_check(struct ug_data *ugd);
472 * This function is called after select all button is checked to select all available devices
474 * @param[in] data the pointer to the main data structure
476 void wfd_genlist_select_all_check_changed_cb(void *data, Evas_Object *obj,
479 #endif /* __WFD_UG_VIEW_H__ */