summaryrefslogtreecommitdiff
path: root/ug-wifidirect/include/wfd_ug_view.h
blob: 7a6359b75a9c296e829d6056d93c84897a121fe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
/*
*  WiFi-Direct UG
*
* Copyright 2012  Samsung Electronics Co., Ltd

* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at

* http://www.tizenopensource.org/license

* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#ifndef __WFD_UG_VIEW_H__
#define __WFD_UG_VIEW_H__

#include <glib.h>
#include <syspopup_caller.h>

#define EDJDIR "/usr/ug/res/edje/ug-setting-wifidirect-efl"
#define WFD_UG_EDJ_PATH  EDJDIR"/wfd_ug.edj"
#define WFD_IMG_DIR "/usr/ug/res/images/ug-setting-wifidirect-efl"
#define TICKERNOTI_SYSPOPUP "tickernoti-syspopup"


/* Define icons */

#define WFD_ICON_DEVICE_COMPUTER			WFD_IMG_DIR"/A09_device_computer.png"
#define WFD_ICON_DEVICE_INPUT_DEVICE			WFD_IMG_DIR"/A09_device_input_device.png"
#define WFD_ICON_DEVICE_PRINTER				WFD_IMG_DIR"/A09_device_printer.png"
#define WFD_ICON_DEVICE_CAMERA				WFD_IMG_DIR"/A09_device_camera.png"
#define WFD_ICON_DEVICE_STORAGE				WFD_IMG_DIR"/A09_device_storage.png"
#define WFD_ICON_DEVICE_NETWORK_INFRA			WFD_IMG_DIR"/A09_device_network_infrastructure.png"
#define WFD_ICON_DEVICE_DISPLAY				WFD_IMG_DIR"/A09_device_display.png"
#define WFD_ICON_DEVICE_MULTIMEDIA_DEVICE		WFD_IMG_DIR"/A09_device_multimedia_devices.png"
#define WFD_ICON_DEVICE_GAMING_DEVICE			WFD_IMG_DIR"/A09_device_gaming_devices.png"
#define WFD_ICON_DEVICE_TELEPHONE			WFD_IMG_DIR"/A09_device_telephone.png"
#define WFD_ICON_DEVICE_AUDIO_DEVICE			WFD_IMG_DIR"/A09_device_audio_devices.png"

#define WFD_ICON_DEVICE_COMPUTER_CONNECT		WFD_IMG_DIR"/A09_device_computer_connect.png"
#define WFD_ICON_DEVICE_INPUT_DEVICE_CONNECT		WFD_IMG_DIR"/A09_device_input_device_connect.png"
#define WFD_ICON_DEVICE_PRINTER_CONNECT			WFD_IMG_DIR"/A09_device_printer_connect.png"
#define WFD_ICON_DEVICE_CAMERA_CONNECT			WFD_IMG_DIR"/A09_device_camera_connect.png"
#define WFD_ICON_DEVICE_STORAGE_CONNECT			WFD_IMG_DIR"/A09_device_storage_connect.png"
#define WFD_ICON_DEVICE_NETWORK_INFRA_CONNECT		WFD_IMG_DIR"/A09_device_network_infrastructure_connect.png"
#define WFD_ICON_DEVICE_DISPLAY_CONNECT			WFD_IMG_DIR"/A09_device_display_connect.png"
#define WFD_ICON_DEVICE_MULTIMEDIA_DEVICE_CONNECT	WFD_IMG_DIR"/A09_device_multimedia_devices_connect.png"
#define WFD_ICON_DEVICE_GAMING_DEVICE_CONNECT		WFD_IMG_DIR"/A09_device_gaming_devices_connect.png"
#define WFD_ICON_DEVICE_TELEPHONE_CONNECT		WFD_IMG_DIR"/A09_device_telephone_connect.png"
#define WFD_ICON_DEVICE_AUDIO_DEVICE_CONNECT		WFD_IMG_DIR"/A09_device_audio_devices_connect.png"

#define WFD_ICON_CONNECTED				WFD_IMG_DIR"/A09_Connect.png"


enum {
	HEAD_TEXT_TYPE_DIRECT,
	HEAD_TEXT_TYPE_DEACTIVATING,
	HEAD_TEXT_TYPE_ACTIVATING,
	HEAD_TEXT_TYPE_ACTIVATED,
	HEAD_TEXT_TYPE_SCANING,
};

enum {
	/* User confirm */
	POPUP_TYPE_WIFI_OFF,
	POPUP_TYPE_HOTSPOT_OFF,

	/* Activation */
	POPUP_TYPE_ACTIVATE_FAIL,
	POPUP_TYPE_DEACTIVATE_FAIL,

	/* Connection */
	POPUP_TYPE_LINK_TIMEOUT,
	POPUP_TYPE_AUTH_FAIL,
	POPUP_TYPE_LINK_FAIL,
	POPUP_TYPE_UNKNOWN_ERROR,

	POPUP_TYPE_TERMINATE,

	/* Disconnect */
	POP_TYPE_DISCONNECT,

	/* Disconnect All*/
	POP_TYPE_DISCONNECT_ALL,

	/* Scan again */
	POP_TYPE_SCAN_AGAIN,

	/* multi connect */
	POP_TYPE_MULTI_CONNECT_POPUP,

	/* Busy device */
	POP_TYPE_BUSY_DEVICE_POPUP,

	/* Automaticlly turn off */
	POP_TYPE_AUTOMATIC_TURN_OFF,
};

struct ug_data *wfd_get_ug_data();

/**
 *	This function let the ug create the main view
 *	@return   void
 *	@param[in] data the pointer to the main data structure
 */
void create_wfd_ug_view(void *data);

/**
 *	This function let the ug destroy the main view
 *	@return   void
 *	@param[in] data the pointer to the main data structure
 */
void destroy_wfd_ug_view(void *data);

/**
 *	This function let the ug update the genlist item
 *	@return   void
 *	@param[in] obj the pointer to genlist item
 */
void wfd_ug_view_refresh_glitem(void *obj);

/**
 *	This function let the ug refresh the attributes of button
 *	@return   void
 *	@param[in] obj the pointer to the button
 *	@param[in] text the pointer to the text of button
 *	@param[in] enable whether the button is disabled
 */
void wfd_ug_view_refresh_button(void *obj, const char *text, int enable);

/**
 *	This function let the ug update the peers
 *	@return   void
 *	@param[in] data the pointer to the main data structure
 */
void wfd_ug_view_update_peers(void *data);

/**
 *	This function let the ug free the peers
 *	@return   void
 *	@param[in] data the pointer to the main data structure
 */
void wfd_ug_view_free_peers(void *data);

/**
 *	This function let the ug create a action popup
 *	@return   void
 *	@param[in] data the pointer to the main data structure
 *	@param[in] message the pointer to the text of popup
 *	@param[in] popup_type the message type
 */
void wfd_ug_act_popup(void *data, const char *message, int popup_type);

/**
 *	This function let the ug remove the action popup
 *	@return   void
 *	@param[in] data the pointer to the main data structure
 */
void wfg_ug_act_popup_remove(void *data);

/**
 *	This function let the ug create a warning popup
 *	@return   void
 *	@param[in] data the pointer to the main data structure
 *	@param[in] message the pointer to the text of popup
 *	@param[in] popup_type the message type
 */
void wfd_ug_warn_popup(void *data, const char *message, int popup_type);

/**
 *	This function let the ug change the text of multi button
 *	@return   If success, return 0, else return -1
 *	@param[in] data the pointer to the main data structure
 */
int _change_multi_button_title(void *data);

/**
 *	This function let the ug create about view
 *	@return   void
 *	@param[in] ugd the pointer to the main data structure
 */
void _wifid_create_about_view(struct ug_data *ugd);

/**
 *	This function let the ug create the view for multi connection
 *	@return   void
 *	@param[in] ugd the pointer to the main data structure
 */
void _wifid_create_multiconnect_view(struct ug_data *ugd);

/**
 *	This function let the ug call it when click 'back' button
 *	@return   void
 *	@param[in] data the pointer to the main data structure
 *	@param[in] obj the pointer to the evas object
 *	@param[in] event_info the pointer to the event information
 */
void _back_btn_cb(void *data, Evas_Object * obj, void *event_info);

/**
 *	This function let the ug call it when click 'scan' button
 *	@return   void
 *	@param[in] data the pointer to the main data structure
 *	@param[in] obj the pointer to the evas object
 *	@param[in] event_info the pointer to the event information
 */
void _scan_btn_cb(void *data, Evas_Object * obj, void *event_info);

/**
 *	This function let the ug call it when click 'multi connect' button
 *	@return   void
 *	@param[in] data the pointer to the main data structure
 *	@param[in] obj the pointer to the evas object
 *	@param[in] event_info the pointer to the event information
 */
void _wifid_create_multibutton_cb(void *data, Evas_Object *obj, void *event_info);

/**
 *	This function let the ug get the found peers
 *	@return   If success, return 0, else return -1
 *	@param[in] ugd the pointer to the main data structure
 */
int wfd_ug_get_discovered_peers(struct ug_data *ugd);

/**
 *	This function let the ug get the connected peers
 *	@return   If success, return 0, else return -1
 *	@param[in] ugd the pointer to the main data structure
 */
int wfd_ug_get_connected_peers(struct ug_data *ugd);

/**
 *	This function let the ug get the device status
 *	@return  If success, return 0-3(available: 0, connected: 1, busy: 2, connected failed: 3), else return -1
 *	@param[in] ugd the pointer to the main data structure
 *	@param[in] device the pointer to the number of connected failed devices
 */
int wfd_get_device_status(void *data, device_type_s *device);

/**
 *	This function let the ug refresh current status of wi-fi direct
 *	@return   If success, return 0, else return -1
 *	@param[in] data the pointer to the main data structure
 */
int wfd_refresh_wifi_direct_state(void *data);

/**
 *	This function let the ug free the selected peers in multi connect view
 *	@return   void
 *	@param[in] data the pointer to the main data structure
 */
void wfd_free_multi_selected_peers(void *data);

/**
 *	This function let the ug stop to connect to selected peer
 *	@return   If success, return 0, else return -1
 *	@param[in] data the pointer to the main data structure
 */
int wfd_stop_multi_connect(void *data);

/**
 *	This function let the ug connect to the next selected peer automatically
 *	@return   If stop the timer, return false, else return true
 *	@param[in] data the pointer to the main data structure
 */
gboolean wfd_multi_connect_next_cb(void *data);

/**
 *	This function let the ug add a dialogue separator
 *	@return   the separator item
 *	@param[in] genlist the pointer to the genlist
 *	@param[in] separator_style the style of separator
 */
Elm_Object_Item *wfd_add_dialogue_separator(Evas_Object *genlist, const char *separator_style);

/**
 *	This function let the ug fee the multi connect devices
 *	@return   0
 *	@param[in] data the pointer to the main data structure
 */
int wfd_free_multiconnect_device(struct ug_data *ugd);

/**
 *	This function let the ug update the multi connect devices
 *	@return   0
 *	@param[in] data the pointer to the main data structure
 */
int wfd_update_multiconnect_device(struct ug_data *ugd);

/**
 *	This function let the ug create the view for multi connection
 *	@return   void
 *	@param[in] ugd the pointer to the main data structure
 */
void wfd_create_multiconnect_view(struct ug_data *ugd);


#endif  /* __WFD_UG_VIEW_H__ */