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"
27 #define WFD_UG_COMMON_MAIN_LAYOUT_EDJ_PATH EDJDIR"/main_layout.edj"
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"
64 #define WFD_UG_EDJ_ICON_SIZE 40
66 gboolean wfd_ug_util_is_profile_common(void);
74 #define WFD_UG_BIG_BUTTON_EDC_PART \
75 (wfd_ug_util_is_profile_common() ? "button_common.big" : "button.big")
76 #define WFD_UG_PREV_BUTTON_EDC_PART \
77 (wfd_ug_util_is_profile_common() ? "button_common.prev" : "button.prev")
78 #define WFD_UG_NEXT_BUTTON_EDC_PART \
79 (wfd_ug_util_is_profile_common() ? "button_common.next" : "button.next")
82 HEAD_TEXT_TYPE_DIRECT,
83 HEAD_TEXT_TYPE_DEACTIVATING,
84 HEAD_TEXT_TYPE_ACTIVATING,
85 HEAD_TEXT_TYPE_ACTIVATED,
89 TITLE_CONTENT_TYPE_NONE,
90 TITLE_CONTENT_TYPE_SCANNING,
91 TITLE_CONTENT_TYPE_FOUND,
97 #ifndef MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE
101 POPUP_TYPE_HOTSPOT_OFF = 1,
104 POPUP_TYPE_ACTIVATE_FAIL,
105 POPUP_TYPE_ACTIVATE_FAIL_POLICY_RESTRICTS,
106 POPUP_TYPE_DEACTIVATE_FAIL,
109 POPUP_TYPE_LINK_TIMEOUT,
110 POPUP_TYPE_AUTH_FAIL,
111 POPUP_TYPE_LINK_FAIL,
112 POPUP_TYPE_UNKNOWN_ERROR,
115 POPUP_TYPE_TERMINATE,
116 POPUP_TYPE_TERMINATE_DEACTIVATE_FAIL,
117 POPUP_TYPE_TERMINATE_NOT_SUPPORT,
122 POP_TYPE_CANCEL_CONNECT,
124 POP_TYPE_ACCEPT_CONNECTION,
130 POP_TYPE_MULTI_CONNECT_POPUP,
133 POP_TYPE_BUSY_DEVICE_POPUP,
135 /* Automaticlly turn off */
136 POP_TYPE_AUTOMATIC_TURN_OFF,
139 struct ug_data *wfd_get_ug_data();
141 void scan_button_create(struct ug_data *ugd);
144 * This function let the ug create the main view
146 * @param[in] data the pointer to the main data structure
148 void create_wfd_ug_view(void *data);
151 * This function let the ug destroy the main view
153 * @param[in] data the pointer to the main data structure
155 void destroy_wfd_ug_view(void *data);
158 * This function let the ug update the genlist item
160 * @param[in] gl_item the pointer to genlist item
162 void wfd_ug_view_refresh_glitem(Elm_Object_Item *gl_item);
165 * This function let the ug refresh the attributes of button
167 * @param[in] tb_item the pointer to the toolbar button
168 * @param[in] text the pointer to the text of button
169 * @param[in] enable whether the button is disabled
171 void wfd_ug_view_refresh_button(Evas_Object *tb_item, const char *text,
175 * This function let the ug update the peers
177 * @param[in] data the pointer to the main data structure
179 void wfd_ug_view_update_peers(void *data);
182 * This function let the ug free the peers
184 * @param[in] data the pointer to the main data structure
186 void wfd_ug_view_free_peers(void *data);
189 * This function let the ug create a action 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_act_popup(void *data, const char *message, int popup_type);
198 * This function let the ug remove the action popup
200 * @param[in] data the pointer to the main data structure
202 void wfg_ug_act_popup_remove(void *data);
205 * This function let the ug create a warning popup
207 * @param[in] data the pointer to the main data structure
208 * @param[in] message the pointer to the text of popup
209 * @param[in] popup_type the message type
211 void wfd_ug_warn_popup(void *data, const char *message, int popup_type);
214 * This function let the ug create the view for multi connection
216 * @param[in] ugd the pointer to the main data structure
218 void _wifid_create_multiconnect_view(struct ug_data *ugd);
221 * This function let the ug call it when click 'back' button
223 * @param[in] data the pointer to the main data structure
224 * @param[in] obj the pointer to the evas object
225 * @param[in] event_info the pointer to the event information
227 Eina_Bool _back_btn_cb(void *data, Elm_Object_Item *it);
230 * This function let the ug call it when click 'scan' button
232 * @param[in] data the pointer to the main data structure
233 * @param[in] obj the pointer to the evas object
234 * @param[in] event_info the pointer to the event information
236 void _scan_btn_cb(void *data, Evas_Object * obj, void *event_info);
239 * This function let the ug call it when click 'disconnect' button
241 * @param[in] data the pointer to the main data structure
242 * @param[in] obj the pointer to the evas object
243 * @param[in] event_info the pointer to the event information
245 void _wfd_ug_disconnect_button_cb(void *data, Evas_Object *obj, void *event_info);
248 * This function let the ug call it when click "Cancel Connection" button
250 * @param[in] data the pointer to the main data structure
251 * @param[in] obj the pointer to the evas object
252 * @param[in] event_info the pointer to the event information
254 void _wfd_ug_cancel_connection_button_cb(void *data, Evas_Object *obj, void *event_info);
257 * This function let the ug get the found peers
258 * @return If success, return 0, else return -1
259 * @param[in] ugd the pointer to the main data structure
261 int wfd_ug_get_discovered_peers(struct ug_data *ugd);
264 * This function let the ug get the connecting peer mac
265 * @return If success, return 0, else return -1
266 * @param[in] ugd the pointer to the main data structure
268 int wfd_ug_get_connecting_peer(struct ug_data *ugd);
271 * This function let the ug get the connected peers
272 * @return If success, return 0, else return -1
273 * @param[in] ugd the pointer to the main data structure
275 int wfd_ug_get_connected_peers(struct ug_data *ugd);
278 * This function let the ug get the device status
279 * @return If success, return 0-3(available: 0, connected: 1, busy: 2, connected failed: 3), else return -1
280 * @param[in] ugd the pointer to the main data structure
281 * @param[in] device the pointer to the number of connected failed devices
283 //int wfd_get_device_status(void *data, device_type_s *device);
286 * This function let the ug refresh current status of wi-fi direct
287 * @return If success, return 0, else return -1
288 * @param[in] data the pointer to the main data structure
290 int wfd_refresh_wifi_direct_state(void *data);
293 * This function let the ug free the selected peers in multi connect view
295 * @param[in] data the pointer to the main data structure
297 void wfd_free_multi_selected_peers(void *data);
300 * This function let the ug stop to connect to selected peer
301 * @return If success, return 0, else return -1
302 * @param[in] data the pointer to the main data structure
304 int wfd_stop_multi_connect(void *data);
307 * This function let the ug connect to the next selected peer automatically
308 * @return If stop the timer, return false, else return true
309 * @param[in] data the pointer to the main data structure
311 gboolean wfd_multi_connect_next_cb(void *data);
314 * This function let the ug add a dialogue separator
315 * @return the separator item
316 * @param[in] genlist the pointer to the genlist
317 * @param[in] separator_style the style of separator
319 Elm_Object_Item *wfd_add_dialogue_separator(Evas_Object *genlist,
320 const char *separator_style);
323 * This function let the ug free the multi connect devices
325 * @param[in] data the pointer to the main data structure
327 int wfd_free_multiconnect_device(struct ug_data *ugd);
330 * This function let the ug update the multi connect devices
332 * @param[in] ugd the pointer to the main data structure
333 * @param[in] is_free_all_peers true to free all peers
335 int wfd_update_multiconnect_device(struct ug_data *ugd, bool is_free_all_peers);
338 * This function let the ug create the view for multi connection
340 * @param[in] ugd the pointer to the main data structure
342 void wfd_create_multiconnect_view(struct ug_data *ugd);
345 * This function let the ug delete search progressbar
347 * @param[in] user_data the pointer to the main data structure
349 int wfd_delete_progressbar_cb(void *user_data);
352 * This function let the ug insert peer item to genlist
354 * @param[in] genlist the pointer to genlist
355 * @param[in] item the pointer to item to insert after
356 * @param[in] itc Elm_Gen_Item_Class
357 * @param[in] start_pos the pointer to the start position of peer array
358 * @param[in] peer_for_insert the pointer to the peer to insert
359 * @param[in] callback callback for peer select
361 int insert_gl_item(Evas_Object *genlist, Elm_Object_Item *item,
362 Elm_Gen_Item_Class *itc, device_type_s **start_pos,
363 device_type_s *peer_for_insert, void *callback);
366 * This function let the ug get the insert position for next item
367 * @return item the position to insert after
368 * @param[in] peer the pointer to peer to search
369 * @param[in] pre_item the title item of peer list
370 * @param[in] peer_cnt the count of gl peers
372 Elm_Object_Item *get_insert_postion(device_type_s *peer,
373 Elm_Object_Item *pre_item, int peer_cnt);
376 * This function let the ug find a peer in genlist
377 * @return peer the pointer of peer that found
378 * @param[in] start_pos the start position of peers list
379 * @param[in] mac_addr the mac_addr of peer for search
381 device_type_s *find_peer_in_glist(device_type_s *start_pos, const char *mac_addr);
384 * This function let the ug free gl peers
386 * @param[in] gl_peers_start the start pointer of peer list that for free
388 void wfd_ug_view_free_peer(device_type_s *gl_peers_start);
391 * This function let the ug exits automatically after successed connection
393 * @param[in] user_data the pointer to the main data structure
395 void _wfd_ug_auto_exit(void *user_data);
398 * This function let the ug update the buttons of toolbar
400 * @param[in] ugd the pointer to the main data structure
402 void wfd_ug_update_toolbar(struct ug_data *ugd);
405 * This function let the ug update the available and busy peers
407 * @param[in] data the pointer to the main data structure
409 void wfd_ug_update_available_peers(void *data);
412 * This function let the ug init the genlist
414 * @param[in] data the pointer to the main data structure
415 * @param[in] is_free_all_peers true to free all peer items
417 void wfd_ug_view_init_genlist(void *data, bool is_free_all_peers);
420 * This function let the ug delete dead peers
422 * @param[in] ugd the pointer to the main data structure
423 * @param[in] start_pos the pointer to start of peer list
424 * @param[in] cnt the pointer to the number of peets in list
426 void delete_not_alive_peers(struct ug_data *ugd, device_type_s **start_pos,
430 * This function let the ug mark up the dead peers
432 * @param[in] ugd the pointer to the main data structure
433 * @param[in] start_pos the pointer to start of peer list
435 void set_not_alive_peers(device_type_s *start_pos);
438 * This function let the ug update connected peers
440 * @param[in] data the pointer to the main data structure
442 void wfd_ug_update_connected_peers(void *data);
445 * This function let the ug update the multi-connect peers
447 * @param[in] data the pointer to the main data structure
449 void wfd_ug_view_update_multiconn_peers(void *data);
452 * This function let the ug update the failed peers
454 * @param[in] data the pointer to the main data structure
456 void wfd_ug_update_failed_peers(void *data);
459 * This function let the ug cancel progressbar stop timer
461 * @param[in] ugd the pointer to the main data structure
463 void wfd_cancel_progressbar_stop_timer(struct ug_data *ugd);
466 * This function let the ug cancel not-alive devices delete timer
468 * @param[in] ugd the pointer to the main data structure
470 void wfd_cancel_not_alive_delete_timer(struct ug_data *ugd);
473 * This function let the ug move ctxpopup to specified location
476 void _ctxpopup_move();
478 int _create_available_dev_genlist(void *data);
480 Evas_Object *_create_no_device_genlist(void *data);
482 Evas_Object *_create_no_device_multiconnect_genlist(struct ug_data *ugd);
485 * This function let the ug create rename popup
487 * @param[in] data the pointer to the main data structure
490 void _gl_rename_device_sel(void *data, Evas_Object *obj, void *event_info);
492 #ifdef WFD_ON_OFF_GENLIST
494 * This function let the ug create on off check
496 * @param[in] parent the pointer to the naviframe
498 void wfd_ug_create_on_off_check(struct ug_data *ugd);
501 * This function is called after select all button is checked to select all available devices
503 * @param[in] data the pointer to the main data structure
505 void wfd_genlist_select_all_check_changed_cb(void *data, Evas_Object *obj,
508 #endif /* __WFD_UG_VIEW_H__ */