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/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"
64 HEAD_TEXT_TYPE_DIRECT,
65 HEAD_TEXT_TYPE_DEACTIVATING,
66 HEAD_TEXT_TYPE_ACTIVATING,
67 HEAD_TEXT_TYPE_ACTIVATED,
71 TITLE_CONTENT_TYPE_NONE,
72 TITLE_CONTENT_TYPE_SCANNING,
73 TITLE_CONTENT_TYPE_FOUND,
79 #ifndef MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE
83 POPUP_TYPE_HOTSPOT_OFF = 1,
86 POPUP_TYPE_ACTIVATE_FAIL,
87 POPUP_TYPE_ACTIVATE_FAIL_POLICY_RESTRICTS,
88 POPUP_TYPE_DEACTIVATE_FAIL,
91 POPUP_TYPE_LINK_TIMEOUT,
94 POPUP_TYPE_UNKNOWN_ERROR,
98 POPUP_TYPE_TERMINATE_DEACTIVATE_FAIL,
99 POPUP_TYPE_TERMINATE_NOT_SUPPORT,
104 POP_TYPE_CANCEL_CONNECT,
106 POP_TYPE_ACCEPT_CONNECTION,
112 POP_TYPE_MULTI_CONNECT_POPUP,
115 POP_TYPE_BUSY_DEVICE_POPUP,
117 /* Automaticlly turn off */
118 POP_TYPE_AUTOMATIC_TURN_OFF,
121 struct ug_data *wfd_get_ug_data();
123 void scan_button_create(struct ug_data *ugd);
126 * This function let the ug create the main view
128 * @param[in] data the pointer to the main data structure
130 void create_wfd_ug_view(void *data);
133 * This function let the ug destroy the main view
135 * @param[in] data the pointer to the main data structure
137 void destroy_wfd_ug_view(void *data);
140 * This function let the ug update the genlist item
142 * @param[in] gl_item the pointer to genlist item
144 void wfd_ug_view_refresh_glitem(Elm_Object_Item *gl_item);
147 * This function let the ug refresh the attributes of button
149 * @param[in] tb_item the pointer to the toolbar button
150 * @param[in] text the pointer to the text of button
151 * @param[in] enable whether the button is disabled
153 void wfd_ug_view_refresh_button(Evas_Object *tb_item, const char *text,
157 * This function let the ug update the peers
159 * @param[in] data the pointer to the main data structure
161 void wfd_ug_view_update_peers(void *data);
164 * This function let the ug free the peers
166 * @param[in] data the pointer to the main data structure
168 void wfd_ug_view_free_peers(void *data);
171 * This function let the ug create a action popup
173 * @param[in] data the pointer to the main data structure
174 * @param[in] message the pointer to the text of popup
175 * @param[in] popup_type the message type
177 void wfd_ug_act_popup(void *data, const char *message, int popup_type);
180 * This function let the ug remove the action popup
182 * @param[in] data the pointer to the main data structure
184 void wfg_ug_act_popup_remove(void *data);
187 * This function let the ug create a warning popup
189 * @param[in] data the pointer to the main data structure
190 * @param[in] message the pointer to the text of popup
191 * @param[in] popup_type the message type
193 void wfd_ug_warn_popup(void *data, const char *message, int popup_type);
196 * This function let the ug create the view for multi connection
198 * @param[in] ugd the pointer to the main data structure
200 void _wifid_create_multiconnect_view(struct ug_data *ugd);
203 * This function let the ug call it when click 'back' button
205 * @param[in] data the pointer to the main data structure
206 * @param[in] obj the pointer to the evas object
207 * @param[in] event_info the pointer to the event information
209 Eina_Bool _back_btn_cb(void *data, Elm_Object_Item *it);
212 * This function let the ug call it when click 'scan' button
214 * @param[in] data the pointer to the main data structure
215 * @param[in] obj the pointer to the evas object
216 * @param[in] event_info the pointer to the event information
218 void _scan_btn_cb(void *data, Evas_Object * obj, void *event_info);
221 * This function let the ug call it when click 'disconnect' 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 void _wfd_ug_disconnect_button_cb(void *data, Evas_Object *obj, void *event_info);
230 * This function let the ug call it when click "Cancel Connection" 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 _wfd_ug_cancel_connection_button_cb(void *data, Evas_Object *obj, void *event_info);
239 * This function let the ug get the found peers
240 * @return If success, return 0, else return -1
241 * @param[in] ugd the pointer to the main data structure
243 int wfd_ug_get_discovered_peers(struct ug_data *ugd);
246 * This function let the ug get the connecting peer mac
247 * @return If success, return 0, else return -1
248 * @param[in] ugd the pointer to the main data structure
250 int wfd_ug_get_connecting_peer(struct ug_data *ugd);
253 * This function let the ug get the connected peers
254 * @return If success, return 0, else return -1
255 * @param[in] ugd the pointer to the main data structure
257 int wfd_ug_get_connected_peers(struct ug_data *ugd);
260 * This function let the ug get the device status
261 * @return If success, return 0-3(available: 0, connected: 1, busy: 2, connected failed: 3), else return -1
262 * @param[in] ugd the pointer to the main data structure
263 * @param[in] device the pointer to the number of connected failed devices
265 //int wfd_get_device_status(void *data, device_type_s *device);
268 * This function let the ug refresh current status of wi-fi direct
269 * @return If success, return 0, else return -1
270 * @param[in] data the pointer to the main data structure
272 int wfd_refresh_wifi_direct_state(void *data);
275 * This function let the ug free the selected peers in multi connect view
277 * @param[in] data the pointer to the main data structure
279 void wfd_free_multi_selected_peers(void *data);
282 * This function let the ug stop to connect to selected peer
283 * @return If success, return 0, else return -1
284 * @param[in] data the pointer to the main data structure
286 int wfd_stop_multi_connect(void *data);
289 * This function let the ug connect to the next selected peer automatically
290 * @return If stop the timer, return false, else return true
291 * @param[in] data the pointer to the main data structure
293 gboolean wfd_multi_connect_next_cb(void *data);
296 * This function let the ug add a dialogue separator
297 * @return the separator item
298 * @param[in] genlist the pointer to the genlist
299 * @param[in] separator_style the style of separator
301 Elm_Object_Item *wfd_add_dialogue_separator(Evas_Object *genlist,
302 const char *separator_style);
305 * This function let the ug free the multi connect devices
307 * @param[in] data the pointer to the main data structure
309 int wfd_free_multiconnect_device(struct ug_data *ugd);
312 * This function let the ug update the multi connect devices
314 * @param[in] ugd the pointer to the main data structure
315 * @param[in] is_free_all_peers true to free all peers
317 int wfd_update_multiconnect_device(struct ug_data *ugd, bool is_free_all_peers);
320 * This function let the ug create the view for multi connection
322 * @param[in] ugd the pointer to the main data structure
324 void wfd_create_multiconnect_view(struct ug_data *ugd);
327 * This function let the ug delete search progressbar
329 * @param[in] user_data the pointer to the main data structure
331 int wfd_delete_progressbar_cb(void *user_data);
334 * This function let the ug insert peer item to genlist
336 * @param[in] genlist the pointer to genlist
337 * @param[in] item the pointer to item to insert after
338 * @param[in] itc Elm_Gen_Item_Class
339 * @param[in] start_pos the pointer to the start position of peer array
340 * @param[in] peer_for_insert the pointer to the peer to insert
341 * @param[in] callback callback for peer select
343 int insert_gl_item(Evas_Object *genlist, Elm_Object_Item *item,
344 Elm_Gen_Item_Class *itc, device_type_s **start_pos,
345 device_type_s *peer_for_insert, void *callback);
348 * This function let the ug get the insert position for next item
349 * @return item the position to insert after
350 * @param[in] peer the pointer to peer to search
351 * @param[in] pre_item the title item of peer list
352 * @param[in] peer_cnt the count of gl peers
354 Elm_Object_Item *get_insert_postion(device_type_s *peer,
355 Elm_Object_Item *pre_item, int peer_cnt);
358 * This function let the ug find a peer in genlist
359 * @return peer the pointer of peer that found
360 * @param[in] start_pos the start position of peers list
361 * @param[in] mac_addr the mac_addr of peer for search
363 device_type_s *find_peer_in_glist(device_type_s *start_pos, const char *mac_addr);
366 * This function let the ug free gl peers
368 * @param[in] gl_peers_start the start pointer of peer list that for free
370 void wfd_ug_view_free_peer(device_type_s *gl_peers_start);
373 * This function let the ug exits automatically after successed connection
375 * @param[in] user_data the pointer to the main data structure
377 void _wfd_ug_auto_exit(void *user_data);
380 * This function let the ug update the buttons of toolbar
382 * @param[in] ugd the pointer to the main data structure
384 void wfd_ug_update_toolbar(struct ug_data *ugd);
387 * This function let the ug update the available and busy peers
389 * @param[in] data the pointer to the main data structure
391 void wfd_ug_update_available_peers(void *data);
394 * This function let the ug init the genlist
396 * @param[in] data the pointer to the main data structure
397 * @param[in] is_free_all_peers true to free all peer items
399 void wfd_ug_view_init_genlist(void *data, bool is_free_all_peers);
402 * This function let the ug delete dead peers
404 * @param[in] ugd the pointer to the main data structure
405 * @param[in] start_pos the pointer to start of peer list
406 * @param[in] cnt the pointer to the number of peets in list
408 void delete_not_alive_peers(struct ug_data *ugd, device_type_s **start_pos,
412 * This function let the ug mark up the dead peers
414 * @param[in] ugd the pointer to the main data structure
415 * @param[in] start_pos the pointer to start of peer list
417 void set_not_alive_peers(device_type_s *start_pos);
420 * This function let the ug update connected peers
422 * @param[in] data the pointer to the main data structure
424 void wfd_ug_update_connected_peers(void *data);
427 * This function let the ug update the multi-connect peers
429 * @param[in] data the pointer to the main data structure
431 void wfd_ug_view_update_multiconn_peers(void *data);
434 * This function let the ug update the failed peers
436 * @param[in] data the pointer to the main data structure
438 void wfd_ug_update_failed_peers(void *data);
441 * This function let the ug cancel progressbar stop timer
443 * @param[in] ugd the pointer to the main data structure
445 void wfd_cancel_progressbar_stop_timer(struct ug_data *ugd);
448 * This function let the ug cancel not-alive devices delete timer
450 * @param[in] ugd the pointer to the main data structure
452 void wfd_cancel_not_alive_delete_timer(struct ug_data *ugd);
455 * This function let the ug move ctxpopup to specified location
458 void _ctxpopup_move();
460 int _create_available_dev_genlist(void *data);
462 Evas_Object *_create_no_device_genlist(void *data);
464 Evas_Object *_create_no_device_multiconnect_genlist(struct ug_data *ugd);
467 * This function let the ug create rename popup
469 * @param[in] data the pointer to the main data structure
472 void _gl_rename_device_sel(void *data, Evas_Object *obj, void *event_info);
474 #ifdef WFD_ON_OFF_GENLIST
476 * This function let the ug create on off check
478 * @param[in] parent the pointer to the naviframe
480 void wfd_ug_create_on_off_check(struct ug_data *ugd);
483 * This function is called after select all button is checked to select all available devices
485 * @param[in] data the pointer to the main data structure
487 void wfd_genlist_select_all_check_changed_cb(void *data, Evas_Object *obj,
490 #endif /* __WFD_UG_VIEW_H__ */