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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
|
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://floralicense.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 __WIDGET_SERVICE_H
#define __WIDGET_SERVICE_H
#include <tizen_type.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @file widget-service.h
* @brief This file declares API of libwidget-service library
* @since_tizen 2.3.1
*/
/**
* @addtogroup CAPI_WIDGET_SERVICE_MODULE
* @{
*/
/**
* @brief Enumeration for list of supporting widget size types.
* @since_tizen 2.3.1
*/
typedef enum widget_size_type {
WIDGET_SIZE_TYPE_1x1 = 0x0001, /**< 175x175 based on 720x1280 resolution */
WIDGET_SIZE_TYPE_2x1 = 0x0002, /**< 354x175 based on 720x1280 resolution */
WIDGET_SIZE_TYPE_2x2 = 0x0004, /**< 354x354 based on 720x1280 resolution */
WIDGET_SIZE_TYPE_4x1 = 0x0008, /**< 712x175 based on 720x1280 resolution */
WIDGET_SIZE_TYPE_4x2 = 0x0010, /**< 712x354 based on 720x1280 resolution */
WIDGET_SIZE_TYPE_4x3 = 0x0020, /**< 712x533 based on 720x1280 resolution */
WIDGET_SIZE_TYPE_4x4 = 0x0040, /**< 712x712 based on 720x1280 resolution */
WIDGET_SIZE_TYPE_4x5 = 0x0080, /**< 712x891 based on 720x1280 resolution */
WIDGET_SIZE_TYPE_4x6 = 0x0100, /**< 712x1070 based on 720x1280 resolution */
WIDGET_SIZE_TYPE_EASY_1x1 = 0x1000, /**< 224x215 based on 720x1280 resolution */
WIDGET_SIZE_TYPE_EASY_3x1 = 0x2000, /**< 680x215 based on 720x1280 resolution */
WIDGET_SIZE_TYPE_EASY_3x3 = 0x4000, /**< 680x653 based on 720x1280 resolution */
WIDGET_SIZE_TYPE_FULL = 0x0800, /**< 720x1280 based on 720x1280 resolution */
WIDGET_SIZE_TYPE_UNKNOWN = 0xFFFF
} widget_size_type_e;
/**
* @brief Destroy type of widget instance
* @since_tizen 2.3.1
*/
typedef enum widget_destroy_type {
WIDGET_DESTROY_TYPE_DEFAULT = 0x00, /**< Deleted */
WIDGET_DESTROY_TYPE_UPGRADE = 0x01, /**< Deleted for upgrading */
WIDGET_DESTROY_TYPE_UNINSTALL = 0x02, /**< Deleted by uninstalling */
WIDGET_DESTROY_TYPE_TERMINATE = 0x03, /**< Deleted for reboot device */
WIDGET_DESTROY_TYPE_FAULT = 0x04, /**< Deleted by system-fault */
WIDGET_DESTROY_TYPE_TEMPORARY = 0x05, /**< Temporarly deleted, will be created again */
WIDGET_DESTROY_TYPE_UNKNOWN = 0x06 /**< Undefined reason */
} widget_destroy_type_e; /**< Delete type */
/**
* @brief Enumeration for widget event type.
* @details These events will be sent from the provider.
* @since_tizen 2.3.1
*/
typedef enum widget_event_type {
WIDGET_EVENT_WIDGET_UPDATED = 0, /**< Contents of the given widget is updated */
WIDGET_EVENT_WIDGET_EXTRA_UPDATED = 1,
WIDGET_EVENT_CREATED = 4, /**< A new widget is created */
WIDGET_EVENT_DELETED = 5, /**< A widget is deleted */
WIDGET_EVENT_PERIOD_CHANGED = 8, /**< Update period is changed */
WIDGET_EVENT_WIDGET_SIZE_CHANGED = 9, /**< widget size is changed */
WIDGET_EVENT_EXTRA_INFO_UPDATED = 21, /**< Extra information is updated */
WIDGET_EVENT_IGNORED = 0xFF /**< Request is ignored */
} widget_event_type_e;
/**
* @brief Text signal & Content event uses this data structure.
* @since_tizen 2.3.1
*/
typedef struct widget_event_info {
struct _pointer {
double x; /**< X value of current mouse(touch) position */
double y; /**< Y value of current mouse(touch) position */
int down; /**< Is it pressed(1) or not(0) */
} pointer;
struct _part {
double sx; /**< Pressed object's left top X */
double sy; /**< Pressed object's left top Y */
double ex; /**< Pressed object's right bottom X */
double ey; /**< Pressed object's right bottom Y */
} part;
} *widget_event_info_s;
/**
* @brief Names of text signals
* @since_tizen 2.3.1
* @see #widget_text_signal_s
*/
#define WIDGET_TEXT_SIGNAL_NAME_EDIT_MODE_ON "edit,on" /**< Text signal for edit mode on*/
#define WIDGET_TEXT_SIGNAL_NAME_EDIT_MODE_OFF "edit,off" /**< Text signal for edit mode off*/
/**
* @brief Text signal information
* @since_tizen 2.3.1
* @see #WIDGET_TEXT_SIGNAL_NAME_EDIT_MODE_ON
* @see #WIDGET_TEXT_SIGNAL_NAME_EDIT_MODE_OFF
* @see #widget_event_info_s
*/
typedef struct widget_text_signal {
const char *signal_name; /**< A name of a text signal */
const char *source; /**< A source name of this text signal */
struct {
double sx; /**< X-axis value of left-top corner for this text signal */
double sy; /**< Y-axis value of left-top corner for this text signal */
double ex; /**< X-axis value of right-bottom corner for this text signal */
double ey; /**< Y-axis value of right-bottom corner for this text signal */
} geometry; /**< Region information of this text signal */
} *widget_text_signal_s;
/**
* @brief Gets the pixel size of given size type.
* @details
* Size types would be\n
* #WIDGET_SIZE_TYPE_1x1\n
* #WIDGET_SIZE_TYPE_2x1\n
* #WIDGET_SIZE_TYPE_2x2\n
* #WIDGET_SIZE_TYPE_4x1\n
* #WIDGET_SIZE_TYPE_4x2\n
* #WIDGET_SIZE_TYPE_4x3\n
* #WIDGET_SIZE_TYPE_4x4\n
* #WIDGET_SIZE_TYPE_4x5\n
* #WIDGET_SIZE_TYPE_4x6\n
* #WIDGET_SIZE_TYPE_FULL\n
* #WIDGET_SIZE_TYPE_EASY_1x1\n
* #WIDGET_SIZE_TYPE_EASY_3x1\n
* #WIDGET_SIZE_TYPE_EASY_3x3.
* @since_tizen 2.3.1
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @param[in] type Size type
* @param[out] width Pixel size width
* @param[out] height Pixel size height
* @return 0 on success, otherwise a negative error value
* @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
* @retval #WIDGET_ERROR_NONE Successfully done
* @see widget_size_type()
* @see widget_service_get_size_type()
*/
extern int widget_service_get_size(widget_size_type_e type, int *width, int *height);
/**
* @brief Gets the size type for given pixel size.
* @details
* Returnable size types are\n
* #WIDGET_SIZE_TYPE_1x1\n
* #WIDGET_SIZE_TYPE_2x1\n
* #WIDGET_SIZE_TYPE_2x2\n
* #WIDGET_SIZE_TYPE_4x1\n
* #WIDGET_SIZE_TYPE_4x2\n
* #WIDGET_SIZE_TYPE_4x3\n
* #WIDGET_SIZE_TYPE_4x4\n
* #WIDGET_SIZE_TYPE_4x5\n
* #WIDGET_SIZE_TYPE_4x6\n
* #WIDGET_SIZE_TYPE_FULL\n
* #WIDGET_SIZE_TYPE_EASY_1x1\n
* #WIDGET_SIZE_TYPE_EASY_3x1\n
* #WIDGET_SIZE_TYPE_EASY_3x3\n
* or\n
* #WIDGET_SIZE_TYPE_UNKNOWN for error.
* @since_tizen 2.3.1
* @param[in] width Pixel size width
* @param[in] height Pixel size height
* @param[out] size_type Widget size type\n
* @return 0 on success, otherwise a negative error value
* @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid parameter was given.
* @see widget_size_type()
* @see widget_service_get_size()
*/
extern int widget_service_get_size_type(int width, int height, widget_size_type_e *size_type);
/**
* @brief Gets the need of mouse event for the given widget.
* @details This function gets need of mouse event for the given widget from database.\n
* The value of mouse event requirement means... \n
* true : The widget requires mouse event. A viewer must has to feed the mouse event to the widget instance\n
* false : The widget doesn't require mouse event.\n
* @since_tizen 2.3.1
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @param[in] widget_id widget app id
* @param[in] size_type widget size type
* @param[out] need_of_mouse_event the need of mouse event
* @return 0 on success, otherwise a negative error value
* @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid parameter was given.
* @retval #WIDGET_ERROR_IO_ERROR Some error occurs on opening DB file.
* @see widget_size_type_e
* @see widget_service_get_need_of_touch_effect()
* @see widget_service_get_need_of_frame()
*/
extern int widget_service_get_need_of_mouse_event(const char *widget_id, widget_size_type_e size_type, bool *need_of_mouse_event);
/**
* @brief Gets the need of touch effect for the given widget.
* @details This API gets the need of touch effect for the given widget from database.\n
* The value of the need of touch effect means... \n
* true : A viewer is required to make the touch effect when a user click the widget, but it is just recommendation.\n
* false : A viewer is not required to make the touch effect, the box will make touch effect itself.
* @since_tizen 2.3.1
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @param[in] widget_id appid of widget provider
* @param[in] size_type Size type
* @param[out] need_of_touch_event the need of touch effect
* @return 0 on success, otherwise a negative error value
* @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid parameter was given.
* @retval #WIDGET_ERROR_IO_ERROR Some error occurs on opening DB file.
* @see widget_size_type_e
* @see widget_service_get_need_of_mouse_event()
* @see widget_service_get_need_of_frame()
*/
extern int widget_service_get_need_of_touch_effect(const char *widget_id, widget_size_type_e size_type, bool *need_of_touch_event);
/**
* @brief Gets the need of decoration frame for the given widget.
* @details This API gets the need of decoration frame for the given widget from database.\n
* The value of the need of touch effect means... \n
* true : the viewer should make decoration frame on outside of the widget.
* false : no need to amke decoration frame.
* @since_tizen 2.3.1
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @param[in] widget_id widget app id
* @param[in] size_type Size type
* @return 0 on success, otherwise a negative error value
* @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid parameter was given.
* @retval #WIDGET_ERROR_IO_ERROR Some error occurs on opening DB file.
* @see widget_service_get_need_of_mouse_event()
* @see widget_service_get_need_of_touch_effect()
*/
extern int widget_service_get_need_of_frame(const char *widget_id, widget_size_type_e size_type, bool *need_of_frame);
/**
* @brief Triggers the update event for given widget instance.
* @since_tizen 2.3.1
* @param[in] widgetid appid of widget provider
* @param[in] instance_id Set @c NULL if you don't know what the Id is. Then every instance of given pkgname will be triggered its update event
* @param[in] content New content information, Default @c NULL
* @param[in] force 1 if you want to update your widget even if the provider is paused or 0. 0 is default
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.provider
* @return 0 on success, otherwise a negative error value
* @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
* @retval #WIDGET_ERROR_CANCELED Provider is paused, so this update request is canceld.(ignored), if you want to make update forcely, use force=1
* @retval #WIDGET_ERROR_MEMORY Memory is not enough to make request
* @retval #WIDGET_ERROR_FAULT Failed to create a request packet
* @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
* @retval #WIDGET_ERROR_NONE Successfully requested
* @see widget_service_trigger_update()
*/
extern int widget_service_trigger_update(const char *widgetid, const char *instance_id, const char *content, int force);
/**
* @brief Changes the update period of given widget instance.
* @since_tizen 2.3.1
* @param[in] widgetid appid of widget provider
* @param[in] instance_id widget instance id
* @param[in] period New update period in sec
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.provider
* @return 0 on success, otherwise a negative error value
* @retval #WIDGET_ERROR_NONE Successfully changed(requested)
* @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
* @retval #WIDGET_ERROR_FAULT Failed to create a request packet
* @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
* @retval #WIDGET_ERROR_MEMORY Not enough memory
*/
extern int widget_service_change_period(const char *widgetid, const char *instance_id, double period);
/**
* @brief Callback function for getting result of widget_service_get_widget_list
* @since_tizen 2.3.1
* @param[in] pkgid package id
* @param[in] widgetid widget app id
* @param[in] is_prime will be sent as 1 if the widget is a default widget
* @param[in] data user data
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @return WIDGET_ERROR_NONE to continue with the next iteration of the loop, other error values to break out of the loop
* @see #widget_service_get_pkglist
*/
typedef int (*widget_list_cb)(const char *pkgid, const char *widgetid, int is_prime, void *data);
/**
* @brief Gets a list of all widgets.
* @since_tizen 2.3.1
* @param[in] cb Callback function
* @param[in] data user data for callback function
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @return 0 on success, otherwise a negative error value
* @retval #WIDGET_ERROR_IO_ERROR Failed to access DB
* @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
* @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
* @retval count Count of widget packages
* @see #widget_service_get_widget_list_by_pkgid
* @see #widget_list_cb
*/
extern int widget_service_get_widget_list(widget_list_cb cb, void *data);
/**
* @brief Gets the MAIN application Id of given widget package Id.
* @since_tizen 2.3.1
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @remarks Result string should be freed by free()
* @param[in] widgetid widget Package Id
* @return char * type
* @retval @c NULL If it fails to get main application Id (UI-APPID), get_last_result() will returns reason of failure.
* @retval appid Main application Id
* @see #get_last_result
*/
extern char *widget_service_get_main_app_id(const char *widgetid);
/**
* @brief Callback function for getting result of widget_service_get_widget_list_by_pkgid
* @since_tizen 2.3.1
* @param[in] widgetid widget app id
* @param[in] is_prime will be sent as 1 if the widget is a default widget
* @param[in] data user data
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @return WIDGET_ERROR_NONE to continue with the next iteration of the loop, other error values to break out of the loop
* @see #widget_service_get_widget_list_by_pkgid
*/
typedef int (*widget_list_by_pkgid_cb)(const char *widgetid, int is_prime, void *data);
/**
* @brief Gets a list of widgets included in the given package id
* @since_tizen 2.3.1
* @param[in] pkgid Package Id (Not the UI App Id)
* @param[in] cb Callback function
* @param[in] data Callback data
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @return 0 on success, otherwise a negative error value
* @retval int Count of widget packages
* @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
* @retval #WIDGET_ERROR_IO_ERROR Failed to access DB
* @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
* @see #widget_service_get_widget_list
* @see #widget_list_by_pkgid_cb
*/
extern int widget_service_get_widget_list_by_pkgid(const char *pkgid, widget_list_by_pkgid_cb cb, void *data);
/**
* @brief Gets the id of a widget by the given id of package or UI app.
* If there are two or more widgets in the package, this function returns the id of the primary widget.
* @since_tizen 2.3.1
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @remarks Result string should be freed by free()
* @param[in] id Package Id or UI App Id
* @return char * type
* @retval @c NULL Failed to get primary widgetid, get_last_result() will returns reason of failure.
* @retval widgetid Primary widget Id. which is allocated in the heap
* @pre Must be released returned string by manually.
* @see widget_service_package_id()
*/
extern char *widget_service_get_widget_id(const char *id);
/**
* @brief Gets the appId of setup app which is specified by given widget Id's manifest.
* @details
* This setup app should be launched before adding the widget to get the content_info.\n
* This function should be called before add a widget.\n
* To determine the content information string.
* @since_tizen 2.3.1
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @remarks Result string should be freed by free()
* @param[in] widgetid appid of widget provider
* @return char * type
* @retval @c NULL There is no setup application or error occurred, you can check it using get_last_result()
* @retval appid AppId if exists or @c NULL
* @post Returned string must be free'd manually.
* @see get_last_result()
*/
extern char *widget_service_get_app_id_of_setup_app(const char *widgetid);
/**
* @brief Gets the package id of the given widget.
* @since_tizen 2.3.1
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @remarks Result string should be freed by free()
* @param[in] widgetid appid of widget provider
* @return char * type
* @retval appid String which is allocated in the heap
* @retval @c NULL Invalid appid, get_last_result() will returns reason of failure if it fails.
* @post Returned string must be free'd manually.
* @see widget_service_widget_id()
*/
extern char *widget_service_get_package_id(const char *widgetid);
/**
* @brief Gets the name of the given widget.
* @since_tizen 2.3.1
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @remarks Result string should be freed by free()
* @param[in] widgetid appid of widget provider
* @param[in] lang Locale(en-us, ko-kr, ...), if it is @c NULL, function will use the system locale automatically
* @return char * type
* @retval name If it fails to get name
* @retval @c NULL Allocated heap address, get_last_result() will returns reason of failure if it fails.
* @post Returned string must be free'd by manually.
* @see widget_service_i18n_icon()
* @see widget_service_preview()
*/
extern char *widget_service_get_name(const char *widgetid, const char *lang);
/**
* @brief Gets the preview image path of given size type.
* @details This function will return the preview image path.
* @since_tizen 2.3.1
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @remarks Result string should be freed by free()
* @param[in] widgetid appid of widget provider
* @param[in] size_type widget size type
* @return char * type
* @retval path Preview image path
* @retval @c NULL There is no preview image file, get_last_result() will returns reason of failure if it fails.
* @post Returned string must be free'd manually.
* @see #widget_service_get_icon
* @see #widget_service_get_name
*/
extern char *widget_service_get_preview_image_path(const char *widgetid, int size_type);
/**
* @brief Gets icon path of given widget package.
* @details The user should free the returned string with free().
* @since_tizen 2.3.1
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @remarks Result string should be freed by free()
* @param[in] pkgid package id of widget provider
* @param[in] lang Locale(en-us, ko-kr, ...), if it is @c NULL, function will use the system locale automatically
* @return char * type
* @retval name Allocated heap address
* @retval @c NULL Fails to get path of an icon, get_last_result() will returns reason of failure if it fails.
* @post Returned string must be free'd manually.
* @see #widget_service_get_name
* @see #widget_service_get_preview
*/
extern char *widget_service_get_icon(const char *pkgid, const char *lang);
/**
* @brief Gets the "nodisplay" value.
* @since_tizen 2.3.1
* @privilege %http://tizen.org/privilege/widget.viewer
* @param[in] widgetid appid of widget provider
* @privlevel public
* @return the "nodisplay" value of given widget.
* @retval 1 The box should not be listed by the widget list app
* @retval 0 Box should be listed, get_last_result() will returns reason of failure if it fails.
* @pre widget tag includes "nodisplay" attribute.
*/
extern int widget_service_get_nodisplay(const char *widgetid);
/**
* @brief Gets the supported size list.
* @since_tizen 2.3.1
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @param[in] widgetid appid of widget provider
* @param[out] cnt Count of array w and h
* @param[out] w Width array
* @param[out] h Height array
* @return 0 on success, otherwise a negative error value
* @retval #WIDGET_ERROR_NONE If succeed to get supported size list
* @retval #WIDGET_ERROR_IO_ERROR Failed to access DB
* @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
* @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
* @see widget_service_get_supported_size_types()
*/
extern int widget_service_get_supported_sizes(const char *widgetid, int *cnt, int **w, int **h);
/**
* @brief Callback function for getting result of widget_service_get_widget_instance_list
* @since_tizen 2.3.1
* @param[in] widget_id widget app id
* @param[in] widget_instance_id widget instance id
* @param[in] data user data
* @return WIDGET_ERROR_NONE to continue with the next iteration of the loop, other error values to break out of the loop
* @see #widget_service_get_widget_instance_list
*/
typedef int (*widget_instance_list_cb)(const char *widget_id, const char *instance_id, void *data);
/**
* @brief Gets widget instances of given widget_id.
* @since_tizen 2.3.1
* @param[in] widget_id widget app id
* @param[in] cb Callback function
* @param[in] data user data for callback function
* @return 0 on success, otherwise a negative error value
* @retval #WIDGET_ERROR_IO_ERROR Failed to access DB
* @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
* @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
* @see #widget_instance_list_cb
*/
extern int widget_service_get_widget_instance_list(const char *widget_id, widget_instance_list_cb cb, void *data);
/**
* @brief Enumerations for life cycle widget
* @since_tizen 2.3.1
* @see widget_lifecycle_event_cb
*/
typedef enum widget_lifecycle_event {
WIDGET_LIFE_CYCLE_EVENT_CREATE = 1,
WIDGET_LIFE_CYCLE_EVENT_DESTROY = 2,
WIDGET_LIFE_CYCLE_EVENT_PAUSE = 3,
WIDGET_LIFE_CYCLE_EVENT_RESUME = 4,
WIDGET_LIFE_CYCLE_EVENT_MAX = 5
} widget_lifecycle_event_e;
/**
* @brief Called when a widget is created or destroyed
* @since_tizen 2.3.
* @param[in] widget_id widget app id
* @param[in] lifecycle_event type of event
* @param[in] widget_instance_id widget instance id
* @param[in] data user data
* @return 0 on success, otherwise a negative error value
* @see #widget_service_set_lifecycle_event_cb
*/
typedef int (*widget_lifecycle_event_cb)(const char *widget_id, widget_lifecycle_event_e lifecycle_event, const char *widget_instance_id, void *data);
/**
* @brief Registers event handler callback function for life-cycle events of widgets
* @since_tizen 2.3.1
* @param[in] widget_id widget app id
* @param[in] cb Callback function
* @param[in] data user data
* @return 0 on success, otherwise a negative error value
* @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
* @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
* @see #widget_lifecycle_event_cb
* @see #widget_service_unset_lifecycle_event_cb
*/
extern int widget_service_set_lifecycle_event_cb(const char *widget_id, widget_lifecycle_event_cb cb, void *data);
/**
* @brief Unregisters event handler callback function for life-cycle events of widgets
* @since_tizen 2.3.1
* @param[in] widget_id widget app id
* @param[out] user_data user callback data
* @return 0 on success, otherwise a negative error value
* @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
* @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
* @see #widget_service_set_lifecycle_event_cb
*/
extern int widget_service_unset_lifecycle_event_cb(const char *widget_id, void **user_data);
/**
* @brief Gets content of the widget instance
* @since_tizen 2.3.1
* @param[in] widget_instance_id widget instance id
* @param[out] content content information of the given widget instance
* @return 0 on success, otherwise a negative error value
* @retval #WIDGET_ERROR_IO_ERROR Failed to access DB
* @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
* @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
*/
extern int widget_service_get_content_of_widget_instance(const char *widget_id, const char *widget_instance_id, char **content);
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif
/* End of a file */
|