4 * Copyright 2012 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://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/ug-setting-wifidirect-efl/res/edje/ug-setting-wifidirect-efl"
26 #define WFD_UG_EDJ_PATH EDJDIR"/wfd_ug.edj"
28 /* Genlist new style for Tizen 2.4 */
29 #define WFD_GENLIST_1LINE_TEXT_STYLE "type1"
30 #define WFD_GENLIST_1LINE_TEXT_ICON_STYLE "type1"
31 #define WFD_GENLIST_2LINE_TOP_TEXT_STYLE "type1"
32 #define WFD_GENLIST_2LINE_TOP_TEXT_ICON_STYLE "type1"
33 #define WFD_GENLIST_2LINE_BOTTOM_TEXT_STYLE "type2"
34 #define WFD_GENLIST_2LINE_BOTTOM_TEXT_ICON_STYLE "type2"
35 #define WFD_GENLIST_MULTILINE_TEXT_STYLE "multiline"
36 #define WFD_GENLIST_GROUP_INDEX_STYLE "group_index"
39 #define WFD_ICON_DEVICE_COMPUTER "A09_device_computer.png"
40 #define WFD_ICON_DEVICE_INPUT_DEVICE "A09_device_input_device.png"
41 #define WFD_ICON_DEVICE_PRINTER "A09_device_printer.png"
42 #define WFD_ICON_DEVICE_CAMERA "A09_device_camera.png"
43 #define WFD_ICON_DEVICE_STORAGE "A09_device_storage.png"
44 #define WFD_ICON_DEVICE_NETWORK_INFRA "A09_device_network_infrastructure.png"
45 #define WFD_ICON_DEVICE_DISPLAY "A09_device_display.png"
46 #define WFD_ICON_DEVICE_MULTIMEDIA "A09_device_multimedia.png"
47 #define WFD_ICON_DEVICE_GAMING "A09_device_gaming.png"
48 #define WFD_ICON_DEVICE_TELEPHONE "A09_device_telephone.png"
49 #define WFD_ICON_DEVICE_HEADSET "A09_device_headset.png"
50 #define WFD_ICON_DEVICE_UNKNOWN "A09_device_unknown.png"
51 #define WFD_ICON_DEVICE_BD "U04_device_BD.png"
52 #define WFD_ICON_DEVICE_DONGLE "U04_device_Dongle.png"
53 #define WFD_ICON_DEVICE_HOME_THEATER "U04_device_Home_Theater.png"
54 #define WFD_ICON_DEVICE_STB "U04_device_STB.png"
57 #define WFD_ICON_DEVICE_HEADPHONE "A09_device_headphone.png"
58 #define WFD_ICON_DEVICE_MEDICAL "A09_device_Medical.png"
59 #define WFD_ICON_DEVICE_MOUSE "A09_device_mouse.png"
61 #define WFD_ICON_DEVICE_MORE_HELP "A09_popup_help.png"
63 #define WFD_UG_EDJ_ICON_SIZE 40
66 HEAD_TEXT_TYPE_DIRECT,
67 HEAD_TEXT_TYPE_DEACTIVATING,
68 HEAD_TEXT_TYPE_ACTIVATING,
69 HEAD_TEXT_TYPE_ACTIVATED,
73 TITLE_CONTENT_TYPE_NONE,
74 TITLE_CONTENT_TYPE_SCANNING,
75 TITLE_CONTENT_TYPE_FOUND,
81 #ifndef MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE
85 POPUP_TYPE_HOTSPOT_OFF = 1,
88 POPUP_TYPE_ACTIVATE_FAIL,
89 POPUP_TYPE_ACTIVATE_FAIL_POLICY_RESTRICTS,
90 POPUP_TYPE_DEACTIVATE_FAIL,
93 POPUP_TYPE_LINK_TIMEOUT,
96 POPUP_TYPE_UNKNOWN_ERROR,
100 POPUP_TYPE_TERMINATE_DEACTIVATE_FAIL,
101 POPUP_TYPE_TERMINATE_NOT_SUPPORT,
106 POP_TYPE_CANCEL_CONNECT,
108 POP_TYPE_ACCEPT_CONNECTION,
114 POP_TYPE_MULTI_CONNECT_POPUP,
117 POP_TYPE_BUSY_DEVICE_POPUP,
119 /* Automaticlly turn off */
120 POP_TYPE_AUTOMATIC_TURN_OFF,
123 struct ug_data *wfd_get_ug_data();
125 void scan_button_create(struct ug_data *ugd);
128 * This function let the ug create the main view
130 * @param[in] data the pointer to the main data structure
132 void create_wfd_ug_view(void *data);
135 * This function let the ug destroy the main view
137 * @param[in] data the pointer to the main data structure
139 void destroy_wfd_ug_view(void *data);
142 * This function let the ug update the genlist item
144 * @param[in] gl_item the pointer to genlist item
146 void wfd_ug_view_refresh_glitem(Elm_Object_Item *gl_item);
149 * This function let the ug refresh the attributes of button
151 * @param[in] tb_item the pointer to the toolbar button
152 * @param[in] text the pointer to the text of button
153 * @param[in] enable whether the button is disabled
155 void wfd_ug_view_refresh_button(Evas_Object *tb_item, const char *text,
159 * This function let the ug update the peers
161 * @param[in] data the pointer to the main data structure
163 void wfd_ug_view_update_peers(void *data);
166 * This function let the ug free the peers
168 * @param[in] data the pointer to the main data structure
170 void wfd_ug_view_free_peers(void *data);
173 * This function let the ug create a action popup
175 * @param[in] data the pointer to the main data structure
176 * @param[in] message the pointer to the text of popup
177 * @param[in] popup_type the message type
179 void wfd_ug_act_popup(void *data, const char *message, int popup_type);
182 * This function let the ug remove the action popup
184 * @param[in] data the pointer to the main data structure
186 void wfg_ug_act_popup_remove(void *data);
189 * This function let the ug create a warning popup
191 * @param[in] data the pointer to the main data structure
192 * @param[in] message the pointer to the text of popup
193 * @param[in] popup_type the message type
195 void wfd_ug_warn_popup(void *data, const char *message, int popup_type);
198 * This function let the ug create the view for multi connection
200 * @param[in] ugd the pointer to the main data structure
202 void _wifid_create_multiconnect_view(struct ug_data *ugd);
205 * This function let the ug call it when click 'back' button
207 * @param[in] data the pointer to the main data structure
208 * @param[in] obj the pointer to the evas object
209 * @param[in] event_info the pointer to the event information
211 Eina_Bool _back_btn_cb(void *data, Elm_Object_Item *it);
214 * This function let the ug call it when click 'scan' button
216 * @param[in] data the pointer to the main data structure
217 * @param[in] obj the pointer to the evas object
218 * @param[in] event_info the pointer to the event information
220 void _scan_btn_cb(void *data, Evas_Object * obj, void *event_info);
223 * This function let the ug call it when click 'disconnect' button
225 * @param[in] data the pointer to the main data structure
226 * @param[in] obj the pointer to the evas object
227 * @param[in] event_info the pointer to the event information
229 void _wfd_ug_disconnect_button_cb(void *data, Evas_Object *obj, void *event_info);
232 * This function let the ug call it when click "Cancel Connection" button
234 * @param[in] data the pointer to the main data structure
235 * @param[in] obj the pointer to the evas object
236 * @param[in] event_info the pointer to the event information
238 void _wfd_ug_cancel_connection_button_cb(void *data, Evas_Object *obj, void *event_info);
241 * This function let the ug get the found peers
242 * @return If success, return 0, else return -1
243 * @param[in] ugd the pointer to the main data structure
245 int wfd_ug_get_discovered_peers(struct ug_data *ugd);
248 * This function let the ug get the connecting peer mac
249 * @return If success, return 0, else return -1
250 * @param[in] ugd the pointer to the main data structure
252 int wfd_ug_get_connecting_peer(struct ug_data *ugd);
255 * This function let the ug get the connected peers
256 * @return If success, return 0, else return -1
257 * @param[in] ugd the pointer to the main data structure
259 int wfd_ug_get_connected_peers(struct ug_data *ugd);
262 * This function let the ug get the device status
263 * @return If success, return 0-3(available: 0, connected: 1, busy: 2, connected failed: 3), else return -1
264 * @param[in] ugd the pointer to the main data structure
265 * @param[in] device the pointer to the number of connected failed devices
267 //int wfd_get_device_status(void *data, device_type_s *device);
270 * This function let the ug refresh current status of wi-fi direct
271 * @return If success, return 0, else return -1
272 * @param[in] data the pointer to the main data structure
274 int wfd_refresh_wifi_direct_state(void *data);
277 * This function let the ug free the selected peers in multi connect view
279 * @param[in] data the pointer to the main data structure
281 void wfd_free_multi_selected_peers(void *data);
284 * This function let the ug stop to connect to selected peer
285 * @return If success, return 0, else return -1
286 * @param[in] data the pointer to the main data structure
288 int wfd_stop_multi_connect(void *data);
291 * This function let the ug connect to the next selected peer automatically
292 * @return If stop the timer, return false, else return true
293 * @param[in] data the pointer to the main data structure
295 gboolean wfd_multi_connect_next_cb(void *data);
298 * This function let the ug add a dialogue separator
299 * @return the separator item
300 * @param[in] genlist the pointer to the genlist
301 * @param[in] separator_style the style of separator
303 Elm_Object_Item *wfd_add_dialogue_separator(Evas_Object *genlist,
304 const char *separator_style);
307 * This function let the ug free the multi connect devices
309 * @param[in] data the pointer to the main data structure
311 int wfd_free_multiconnect_device(struct ug_data *ugd);
314 * This function let the ug update the multi connect devices
316 * @param[in] ugd the pointer to the main data structure
317 * @param[in] is_free_all_peers true to free all peers
319 int wfd_update_multiconnect_device(struct ug_data *ugd, bool is_free_all_peers);
322 * This function let the ug create the view for multi connection
324 * @param[in] ugd the pointer to the main data structure
326 void wfd_create_multiconnect_view(struct ug_data *ugd);
329 * This function let the ug delete search progressbar
331 * @param[in] user_data the pointer to the main data structure
333 int wfd_delete_progressbar_cb(void *user_data);
336 * This function let the ug insert peer item to genlist
338 * @param[in] genlist the pointer to genlist
339 * @param[in] item the pointer to item to insert after
340 * @param[in] itc Elm_Gen_Item_Class
341 * @param[in] start_pos the pointer to the start position of peer array
342 * @param[in] peer_for_insert the pointer to the peer to insert
343 * @param[in] callback callback for peer select
345 int insert_gl_item(Evas_Object *genlist, Elm_Object_Item *item,
346 Elm_Gen_Item_Class *itc, device_type_s **start_pos,
347 device_type_s *peer_for_insert, void *callback);
350 * This function let the ug get the insert position for next item
351 * @return item the position to insert after
352 * @param[in] peer the pointer to peer to search
353 * @param[in] pre_item the title item of peer list
354 * @param[in] peer_cnt the count of gl peers
356 Elm_Object_Item *get_insert_postion(device_type_s *peer,
357 Elm_Object_Item *pre_item, int peer_cnt);
360 * This function let the ug find a peer in genlist
361 * @return peer the pointer of peer that found
362 * @param[in] start_pos the start position of peers list
363 * @param[in] mac_addr the mac_addr of peer for search
365 device_type_s *find_peer_in_glist(device_type_s *start_pos, const char *mac_addr);
368 * This function let the ug free gl peers
370 * @param[in] gl_peers_start the start pointer of peer list that for free
372 void wfd_ug_view_free_peer(device_type_s *gl_peers_start);
375 * This function let the ug exits automatically after successed connection
377 * @param[in] user_data the pointer to the main data structure
379 void _wfd_ug_auto_exit(void *user_data);
382 * This function let the ug update the buttons of toolbar
384 * @param[in] ugd the pointer to the main data structure
386 void wfd_ug_update_toolbar(struct ug_data *ugd);
389 * This function let the ug update the available and busy peers
391 * @param[in] data the pointer to the main data structure
393 void wfd_ug_update_available_peers(void *data);
396 * This function let the ug init the genlist
398 * @param[in] data the pointer to the main data structure
399 * @param[in] is_free_all_peers true to free all peer items
401 void wfd_ug_view_init_genlist(void *data, bool is_free_all_peers);
404 * This function let the ug delete dead peers
406 * @param[in] ugd the pointer to the main data structure
407 * @param[in] start_pos the pointer to start of peer list
408 * @param[in] cnt the pointer to the number of peets in list
410 void delete_not_alive_peers(struct ug_data *ugd, device_type_s **start_pos,
414 * This function let the ug mark up the dead peers
416 * @param[in] ugd the pointer to the main data structure
417 * @param[in] start_pos the pointer to start of peer list
419 void set_not_alive_peers(device_type_s *start_pos);
422 * This function let the ug update connected peers
424 * @param[in] data the pointer to the main data structure
426 void wfd_ug_update_connected_peers(void *data);
429 * This function let the ug update the multi-connect peers
431 * @param[in] data the pointer to the main data structure
433 void wfd_ug_view_update_multiconn_peers(void *data);
436 * This function let the ug update the failed peers
438 * @param[in] data the pointer to the main data structure
440 void wfd_ug_update_failed_peers(void *data);
443 * This function let the ug cancel progressbar stop timer
445 * @param[in] ugd the pointer to the main data structure
447 void wfd_cancel_progressbar_stop_timer(struct ug_data *ugd);
450 * This function let the ug cancel not-alive devices delete timer
452 * @param[in] ugd the pointer to the main data structure
454 void wfd_cancel_not_alive_delete_timer(struct ug_data *ugd);
457 * This function let the ug move ctxpopup to specified location
460 void _ctxpopup_move();
462 int _create_available_dev_genlist(void *data);
464 Evas_Object *_create_no_device_genlist(void *data);
466 Evas_Object *_create_no_device_multiconnect_genlist(struct ug_data *ugd);
469 * This function let the ug create rename popup
471 * @param[in] data the pointer to the main data structure
474 void _gl_rename_device_sel(void *data, Evas_Object *obj, void *event_info);
476 #ifdef WFD_ON_OFF_GENLIST
478 * This function let the ug create on off check
480 * @param[in] parent the pointer to the naviframe
482 void wfd_ug_create_on_off_check(struct ug_data *ugd);
485 * This function is called after select all button is checked to select all available devices
487 * @param[in] data the pointer to the main data structure
489 void wfd_genlist_select_all_check_changed_cb(void *data, Evas_Object *obj,
492 #endif /* __WFD_UG_VIEW_H__ */