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"
29 /* Genlist new style for Tizen 2.4 */
30 #define WFD_GENLIST_1LINE_TEXT_STYLE "type1"
31 #define WFD_GENLIST_1LINE_TEXT_ICON_STYLE "type1"
32 #define WFD_GENLIST_2LINE_TOP_TEXT_STYLE "type1"
33 #define WFD_GENLIST_2LINE_TOP_TEXT_ICON_STYLE "type1"
34 #define WFD_GENLIST_2LINE_BOTTOM_TEXT_STYLE "type2"
35 #define WFD_GENLIST_2LINE_BOTTOM_TEXT_ICON_STYLE "type2"
36 #define WFD_GENLIST_MULTILINE_TEXT_STYLE "multiline"
37 #define WFD_GENLIST_GROUP_INDEX_STYLE "group_index"
40 #define WFD_ICON_DEVICE_COMPUTER "A09_device_computer.png"
41 #define WFD_ICON_DEVICE_INPUT_DEVICE "A09_device_input_device.png"
42 #define WFD_ICON_DEVICE_PRINTER "A09_device_printer.png"
43 #define WFD_ICON_DEVICE_CAMERA "A09_device_camera.png"
44 #define WFD_ICON_DEVICE_STORAGE "A09_device_storage.png"
45 #define WFD_ICON_DEVICE_NETWORK_INFRA "A09_device_network_infrastructure.png"
46 #define WFD_ICON_DEVICE_DISPLAY "A09_device_display.png"
47 #define WFD_ICON_DEVICE_MULTIMEDIA "A09_device_multimedia.png"
48 #define WFD_ICON_DEVICE_GAMING "A09_device_gaming.png"
49 #define WFD_ICON_DEVICE_TELEPHONE "A09_device_telephone.png"
50 #define WFD_ICON_DEVICE_HEADSET "A09_device_headset.png"
51 #define WFD_ICON_DEVICE_UNKNOWN "A09_device_unknown.png"
52 #define WFD_ICON_DEVICE_BD "U04_device_BD.png"
53 #define WFD_ICON_DEVICE_DONGLE "U04_device_Dongle.png"
54 #define WFD_ICON_DEVICE_HOME_THEATER "U04_device_Home_Theater.png"
55 #define WFD_ICON_DEVICE_STB "U04_device_STB.png"
58 #define WFD_ICON_DEVICE_HEADPHONE "A09_device_headphone.png"
59 #define WFD_ICON_DEVICE_MEDICAL "A09_device_Medical.png"
60 #define WFD_ICON_DEVICE_MOUSE "A09_device_mouse.png"
62 #define WFD_ICON_DEVICE_MORE_HELP "A09_popup_help.png"
65 HEAD_TEXT_TYPE_DIRECT,
66 HEAD_TEXT_TYPE_DEACTIVATING,
67 HEAD_TEXT_TYPE_ACTIVATING,
68 HEAD_TEXT_TYPE_ACTIVATED,
72 TITLE_CONTENT_TYPE_NONE,
73 TITLE_CONTENT_TYPE_SCANNING,
74 TITLE_CONTENT_TYPE_FOUND,
80 #ifndef MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE
84 POPUP_TYPE_HOTSPOT_OFF = 1,
87 POPUP_TYPE_ACTIVATE_FAIL,
88 POPUP_TYPE_ACTIVATE_FAIL_POLICY_RESTRICTS,
89 POPUP_TYPE_DEACTIVATE_FAIL,
92 POPUP_TYPE_LINK_TIMEOUT,
95 POPUP_TYPE_UNKNOWN_ERROR,
99 POPUP_TYPE_TERMINATE_DEACTIVATE_FAIL,
100 POPUP_TYPE_TERMINATE_NOT_SUPPORT,
105 POP_TYPE_CANCEL_CONNECT,
107 POP_TYPE_ACCEPT_CONNECTION,
113 POP_TYPE_MULTI_CONNECT_POPUP,
116 POP_TYPE_BUSY_DEVICE_POPUP,
118 /* Automaticlly turn off */
119 POP_TYPE_AUTOMATIC_TURN_OFF,
122 struct ug_data *wfd_get_ug_data();
125 * This function let the ug create the main view
127 * @param[in] data the pointer to the main data structure
129 void create_wfd_ug_view(void *data);
132 * This function let the ug destroy the main view
134 * @param[in] data the pointer to the main data structure
136 void destroy_wfd_ug_view(void *data);
139 * This function let the ug update the genlist item
141 * @param[in] gl_item the pointer to genlist item
143 void wfd_ug_view_refresh_glitem(Elm_Object_Item *gl_item);
146 * This function let the ug refresh the attributes of button
148 * @param[in] tb_item the pointer to the toolbar button
149 * @param[in] text the pointer to the text of button
150 * @param[in] enable whether the button is disabled
152 void wfd_ug_view_refresh_button(Evas_Object *tb_item, const char *text,
156 * This function let the ug update the peers
158 * @param[in] data the pointer to the main data structure
160 void wfd_ug_view_update_peers(void *data);
163 * This function let the ug free the peers
165 * @param[in] data the pointer to the main data structure
167 void wfd_ug_view_free_peers(void *data);
170 * This function let the ug create a action popup
172 * @param[in] data the pointer to the main data structure
173 * @param[in] message the pointer to the text of popup
174 * @param[in] popup_type the message type
176 void wfd_ug_act_popup(void *data, const char *message, int popup_type);
179 * This function let the ug remove the action popup
181 * @param[in] data the pointer to the main data structure
183 void wfg_ug_act_popup_remove(void *data);
186 * This function let the ug create a warning popup
188 * @param[in] data the pointer to the main data structure
189 * @param[in] message the pointer to the text of popup
190 * @param[in] popup_type the message type
192 void wfd_ug_warn_popup(void *data, const char *message, int popup_type);
195 * This function let the ug create the view for multi connection
197 * @param[in] ugd the pointer to the main data structure
199 void _wifid_create_multiconnect_view(struct ug_data *ugd);
202 * This function let the ug call it when click 'back' button
204 * @param[in] data the pointer to the main data structure
205 * @param[in] obj the pointer to the evas object
206 * @param[in] event_info the pointer to the event information
208 Eina_Bool _back_btn_cb(void *data, Elm_Object_Item *it);
211 * This function let the ug call it when click 'scan' button
213 * @param[in] data the pointer to the main data structure
214 * @param[in] obj the pointer to the evas object
215 * @param[in] event_info the pointer to the event information
217 void _scan_btn_cb(void *data, Evas_Object * obj, void *event_info);
220 * This function let the ug call it when click 'disconnect' button
222 * @param[in] data the pointer to the main data structure
223 * @param[in] obj the pointer to the evas object
224 * @param[in] event_info the pointer to the event information
226 void _wfd_ug_disconnect_button_cb(void *data, Evas_Object *obj, void *event_info);
229 * This function let the ug call it when click "Cancel Connection" button
231 * @param[in] data the pointer to the main data structure
232 * @param[in] obj the pointer to the evas object
233 * @param[in] event_info the pointer to the event information
235 void _wfd_ug_cancel_connection_button_cb(void *data, Evas_Object *obj, void *event_info);
238 * This function let the ug get the found peers
239 * @return If success, return 0, else return -1
240 * @param[in] ugd the pointer to the main data structure
242 int wfd_ug_get_discovered_peers(struct ug_data *ugd);
245 * This function let the ug get the connecting peer mac
246 * @return If success, return 0, else return -1
247 * @param[in] ugd the pointer to the main data structure
249 int wfd_ug_get_connecting_peer(struct ug_data *ugd);
252 * This function let the ug get the connected peers
253 * @return If success, return 0, else return -1
254 * @param[in] ugd the pointer to the main data structure
256 int wfd_ug_get_connected_peers(struct ug_data *ugd);
259 * This function let the ug get the device status
260 * @return If success, return 0-3(available: 0, connected: 1, busy: 2, connected failed: 3), else return -1
261 * @param[in] ugd the pointer to the main data structure
262 * @param[in] device the pointer to the number of connected failed devices
264 //int wfd_get_device_status(void *data, device_type_s *device);
267 * This function let the ug refresh current status of wi-fi direct
268 * @return If success, return 0, else return -1
269 * @param[in] data the pointer to the main data structure
271 int wfd_refresh_wifi_direct_state(void *data);
274 * This function let the ug free the selected peers in multi connect view
276 * @param[in] data the pointer to the main data structure
278 void wfd_free_multi_selected_peers(void *data);
281 * This function let the ug stop to connect to selected peer
282 * @return If success, return 0, else return -1
283 * @param[in] data the pointer to the main data structure
285 int wfd_stop_multi_connect(void *data);
288 * This function let the ug connect to the next selected peer automatically
289 * @return If stop the timer, return false, else return true
290 * @param[in] data the pointer to the main data structure
292 gboolean wfd_multi_connect_next_cb(void *data);
295 * This function let the ug add a dialogue separator
296 * @return the separator item
297 * @param[in] genlist the pointer to the genlist
298 * @param[in] separator_style the style of separator
300 Elm_Object_Item *wfd_add_dialogue_separator(Evas_Object *genlist,
301 const char *separator_style);
304 * This function let the ug free the multi connect devices
306 * @param[in] data the pointer to the main data structure
308 int wfd_free_multiconnect_device(struct ug_data *ugd);
311 * This function let the ug update the multi connect devices
313 * @param[in] ugd the pointer to the main data structure
314 * @param[in] is_free_all_peers true to free all peers
316 int wfd_update_multiconnect_device(struct ug_data *ugd, bool is_free_all_peers);
319 * This function let the ug create the view for multi connection
321 * @param[in] ugd the pointer to the main data structure
323 void wfd_create_multiconnect_view(struct ug_data *ugd);
326 * This function let the ug delete search progressbar
328 * @param[in] user_data the pointer to the main data structure
330 int wfd_delete_progressbar_cb(void *user_data);
333 * This function let the ug insert peer item to genlist
335 * @param[in] genlist the pointer to genlist
336 * @param[in] item the pointer to item to insert after
337 * @param[in] itc Elm_Gen_Item_Class
338 * @param[in] start_pos the pointer to the start position of peer array
339 * @param[in] peer_for_insert the pointer to the peer to insert
340 * @param[in] callback callback for peer select
342 int insert_gl_item(Evas_Object *genlist, Elm_Object_Item *item,
343 Elm_Gen_Item_Class *itc, device_type_s **start_pos,
344 device_type_s *peer_for_insert, void *callback);
347 * This function let the ug get the insert position for next item
348 * @return item the position to insert after
349 * @param[in] peer the pointer to peer to search
350 * @param[in] pre_item the title item of peer list
351 * @param[in] peer_cnt the count of gl peers
353 Elm_Object_Item *get_insert_postion(device_type_s *peer,
354 Elm_Object_Item *pre_item, int peer_cnt);
357 * This function let the ug find a peer in genlist
358 * @return peer the pointer of peer that found
359 * @param[in] start_pos the start position of peers list
360 * @param[in] mac_addr the mac_addr of peer for search
362 device_type_s *find_peer_in_glist(device_type_s *start_pos, const char *mac_addr);
365 * This function let the ug free gl peers
367 * @param[in] gl_peers_start the start pointer of peer list that for free
369 void wfd_ug_view_free_peer(device_type_s *gl_peers_start);
372 * This function let the ug exits automatically after successed connection
374 * @param[in] user_data the pointer to the main data structure
376 void _wfd_ug_auto_exit(void *user_data);
379 * This function let the ug update the buttons of toolbar
381 * @param[in] ugd the pointer to the main data structure
383 void wfd_ug_update_toolbar(struct ug_data *ugd);
386 * This function let the ug update the available and busy peers
388 * @param[in] data the pointer to the main data structure
390 void wfd_ug_update_available_peers(void *data);
393 * This function let the ug init the genlist
395 * @param[in] data the pointer to the main data structure
396 * @param[in] is_free_all_peers true to free all peer items
398 void wfd_ug_view_init_genlist(void *data, bool is_free_all_peers);
401 * This function let the ug delete 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
405 * @param[in] cnt the pointer to the number of peets in list
407 void delete_not_alive_peers(struct ug_data *ugd, device_type_s **start_pos,
411 * This function let the ug mark up the dead peers
413 * @param[in] ugd the pointer to the main data structure
414 * @param[in] start_pos the pointer to start of peer list
416 void set_not_alive_peers(device_type_s *start_pos);
419 * This function let the ug update connected peers
421 * @param[in] data the pointer to the main data structure
423 void wfd_ug_update_connected_peers(void *data);
426 * This function let the ug update the multi-connect peers
428 * @param[in] data the pointer to the main data structure
430 void wfd_ug_view_update_multiconn_peers(void *data);
433 * This function let the ug update the failed peers
435 * @param[in] data the pointer to the main data structure
437 void wfd_ug_update_failed_peers(void *data);
440 * This function let the ug cancel progressbar stop timer
442 * @param[in] ugd the pointer to the main data structure
444 void wfd_cancel_progressbar_stop_timer(struct ug_data *ugd);
447 * This function let the ug cancel not-alive devices delete timer
449 * @param[in] ugd the pointer to the main data structure
451 void wfd_cancel_not_alive_delete_timer(struct ug_data *ugd);
454 * This function let the ug move ctxpopup to specified location
457 void _ctxpopup_move();
459 int _create_available_dev_genlist(void *data);
461 Evas_Object *_create_no_device_genlist(void *data);
463 Evas_Object *_create_no_device_multiconnect_genlist(struct ug_data *ugd);
466 * This function let the ug create rename popup
468 * @param[in] data the pointer to the main data structure
471 void _gl_rename_device_sel(void *data, Evas_Object *obj, void *event_info);
473 #ifdef WFD_ON_OFF_GENLIST
475 * This function let the ug create on off check
477 * @param[in] parent the pointer to the naviframe
479 void wfd_ug_create_on_off_check(struct ug_data *ugd);
482 * This function is called after select all button is checked to select all available devices
484 * @param[in] data the pointer to the main data structure
486 void wfd_genlist_select_all_check_changed_cb(void *data, Evas_Object *obj,
489 #endif /* __WFD_UG_VIEW_H__ */