Apply force option to trigger the updates forcely
[platform/framework/web/livebox-viewer.git] / include / livebox.h
1 /*
2  * Copyright 2013  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://floralicense.org/license/
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __LIVEBOX_H
18 #define __LIVEBOX_H
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 /*!
25  * \addtogroup CAPI_LIVEBOX_VIEWER_MODULE
26  * \{
27  */
28
29 /*!
30  * \brief
31  * Structure for a Livebox instance
32  */
33 struct livebox;
34
35 /*!
36  * \brief
37  * Use the default update period which is defined in the livebox package manifest.
38  */
39 #define DEFAULT_PERIOD -1.0f
40
41 /*!
42  * \brief
43  * Mouse & Key event for buffer type Livebox or PD
44  * Viewer should send these events to livebox.
45  */
46 enum content_event_type {
47         CONTENT_EVENT_MOUSE_DOWN        = 0x00000001, /*!< LB mouse down event for livebox */
48         CONTENT_EVENT_MOUSE_UP          = 0x00000002, /*!< LB mouse up event for livebox */
49         CONTENT_EVENT_MOUSE_MOVE        = 0x00000004, /*!< LB mouse move event for livebox */
50         CONTENT_EVENT_MOUSE_ENTER       = 0x00000008, /*!< LB mouse enter event for livebox */
51         CONTENT_EVENT_MOUSE_LEAVE       = 0x00000010, /*!< LB mouse leave event for livebox */
52         CONTENT_EVENT_MOUSE_SET         = 0x00000020, /*!< LB mouse set auto event for livebox */
53         CONTENT_EVENT_MOUSE_UNSET       = 0x00000040, /*!< LB mouse unset auto event for livebox */
54
55         CONTENT_EVENT_KEY_DOWN          = 0x00100000, /*!< LB key press */
56         CONTENT_EVENT_KEY_UP            = 0x00200000, /*!< LB key release */
57
58         CONTENT_EVENT_KEY_MASK          = 0x80000000,
59         CONTENT_EVENT_MOUSE_MASK        = 0x20000000,
60         CONTENT_EVENT_PD_MASK           = 0x10000000,
61         CONTENT_EVENT_LB_MASK           = 0x40000000,
62
63         LB_MOUSE_DOWN                   = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_DOWN, /*!< Mouse down on the livebox */
64         LB_MOUSE_UP                     = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UP, /*!< Mouse up on the livebox */
65         LB_MOUSE_MOVE                   = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_MOVE, /*!< Move move on the livebox */
66         LB_MOUSE_ENTER                  = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_ENTER, /*!< Mouse enter to the livebox */
67         LB_MOUSE_LEAVE                  = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_LEAVE, /*!< Mouse leave from the livebox */
68         LB_MOUSE_SET                    = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_SET,
69         LB_MOUSE_UNSET                  = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UNSET,
70
71         PD_MOUSE_DOWN                   = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_DOWN, /*!< Mouse down on the PD */
72         PD_MOUSE_UP                     = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UP, /*!< Mouse up on the PD */
73         PD_MOUSE_MOVE                   = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_MOVE, /*!< Mouse move on the PD */
74         PD_MOUSE_ENTER                  = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_ENTER, /*!< Mouse enter to the PD */
75         PD_MOUSE_LEAVE                  = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_LEAVE, /*!< Mouse leave from the PD */
76         PD_MOUSE_SET                    = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_SET,
77         PD_MOUSE_UNSET                  = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UNSET,
78
79         LB_KEY_DOWN                     = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_DOWN, /*!< Key down on the livebox */
80         LB_KEY_UP                       = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_UP, /*!< Key up on the livebox */
81
82         PD_KEY_DOWN                     = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_DOWN, /*!< Key down on the livebox */
83         PD_KEY_UP                       = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_UP, /*!< Key up on the livebox */
84
85         CONTENT_EVENT_MAX               = 0xFFFFFFFF
86 };
87
88 /*!
89  * \brief
90  * Accessibility event for buffer type Livebox or PD.
91  * These event set are sync'd with Tizen accessibility event set.
92  */
93 enum access_event_type {
94         ACCESS_EVENT_PD_MASK            = 0x10000000,
95         ACCESS_EVENT_LB_MASK            = 0x20000000,
96
97         ACCESS_EVENT_HIGHLIGHT          = 0x00000100, /*!< LB accessibility: Hightlight a object */
98         ACCESS_EVENT_HIGHLIGHT_NEXT     = 0x00000200, /*!< LB accessibility: Set highlight to next object */
99         ACCESS_EVENT_HIGHLIGHT_PREV     = 0x00000400, /*!< LB accessibility: Set highlight to prev object */
100         ACCESS_EVENT_UNHIGHLIGHT        = 0x00000800, /*!< LB accessibility unhighlight */
101         ACCESS_EVENT_ACTIVATE           = 0x00001000, /*!< LB accessibility activate */
102         ACCESS_EVENT_ACTION_DOWN        = 0x00010000, /*!< LB accessibility value changed */
103         ACCESS_EVENT_ACTION_UP          = 0x00020000, /*!< LB accessibility value changed */
104         ACCESS_EVENT_SCROLL_DOWN        = 0x00100000, /*!< LB accessibility scroll down */
105         ACCESS_EVENT_SCROLL_MOVE        = 0x00200000, /*!< LB accessibility scroll move */
106         ACCESS_EVENT_SCROLL_UP          = 0x00400000, /*!< LB accessibility scroll up */
107
108         LB_ACCESS_HIGHLIGHT             = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_HIGHLIGHT,        /*!< Access event - Highlight an object in the livebox */
109         LB_ACCESS_HIGHLIGHT_NEXT        = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_HIGHLIGHT_NEXT,   /*!< Access event - Move highlight to the next object in a livebox */
110         LB_ACCESS_HIGHLIGHT_PREV        = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_HIGHLIGHT_PREV,   /*!< Access event - Move highlight to the prev object in a livebox */
111         LB_ACCESS_UNHIGHLIGHT           = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_UNHIGHLIGHT,      /*!< Access event - Delete highlight from the livebox */
112         LB_ACCESS_ACTIVATE              = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_ACTIVATE,         /*!< Access event - Launch or activate the highlighted object */
113         LB_ACCESS_ACTION_DOWN           = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_ACTION_DOWN,      /*!< Access event - down */
114         LB_ACCESS_ACTION_UP             = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_ACTION_UP,        /*!< Access event - up */
115         LB_ACCESS_SCROLL_DOWN           = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_SCROLL_DOWN,      /*!< Access event - scroll down */
116         LB_ACCESS_SCROLL_MOVE           = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_SCROLL_MOVE,      /*!< Access event - scroll move */
117         LB_ACCESS_SCROLL_UP             = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_SCROLL_UP,        /*!< Access event - scroll up */
118
119         PD_ACCESS_HIGHLIGHT             = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_HIGHLIGHT,
120         PD_ACCESS_HIGHLIGHT_NEXT        = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_HIGHLIGHT_NEXT,
121         PD_ACCESS_HIGHLIGHT_PREV        = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_HIGHLIGHT_PREV,
122         PD_ACCESS_UNHIGHLIGHT           = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_UNHIGHLIGHT,
123         PD_ACCESS_ACTIVATE              = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_ACTIVATE,
124         PD_ACCESS_ACTION_DOWN           = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_ACTION_DOWN,
125         PD_ACCESS_ACTION_UP             = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_ACTION_UP,
126         PD_ACCESS_SCROLL_DOWN           = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_SCROLL_DOWN,
127         PD_ACCESS_SCROLL_MOVE           = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_SCROLL_MOVE,
128         PD_ACCESS_SCROLL_UP             = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_SCROLL_UP
129 };
130
131 /*!
132  * \brief
133  * Livebox LB content type
134  */
135 enum livebox_lb_type {
136         LB_TYPE_IMAGE = 0x01, /*!< Contents of a livebox is based on the image file */
137         LB_TYPE_BUFFER = 0x02, /*!< Contents of a livebox is based on canvas buffer(shared) */
138         LB_TYPE_TEXT = 0x04, /*!< Contents of a livebox is based on formatted text file */
139         LB_TYPE_PIXMAP = 0x08, /*!< Contens of a livebox is shared by the pixmap(depends on X) */
140
141         LB_TYPE_INVALID = 0xFF
142 };
143
144 /*!
145  * \brief
146  * Livebox PD content type
147  */
148 enum livebox_pd_type {
149         PD_TYPE_BUFFER = 0x01, /*!< Contents of a PD is based on canvas buffer(shared) */
150         PD_TYPE_TEXT = 0x02, /*!< Contents of a PD is based on formatted text file */
151         PD_TYPE_PIXMAP = 0x04, /*!< Contents of a livebox is shared by the pixmap(depends on X) */
152
153         PD_TYPE_INVALID = 0xFF
154 };
155
156 /*!
157  * \brief
158  * Livebox event type.
159  * These event will be sent from the provider.
160  */
161 enum livebox_event_type { /*!< livebox_event_handler_set Event list */
162         LB_EVENT_LB_UPDATED, /*!< Contents of the given livebox is updated */
163         LB_EVENT_PD_UPDATED, /*!< Contents of the given pd is updated */
164
165         LB_EVENT_CREATED, /*!< A new livebox is created */
166         LB_EVENT_DELETED, /*!< A livebox is deleted */
167
168         LB_EVENT_GROUP_CHANGED, /*!< Group (Cluster/Sub-cluster) information is changed */
169         LB_EVENT_PINUP_CHANGED, /*!< PINUP status is changed */
170         LB_EVENT_PERIOD_CHANGED, /*!< Update period is changed */
171
172         LB_EVENT_LB_SIZE_CHANGED, /*!< Livebox size is changed */
173         LB_EVENT_PD_SIZE_CHANGED, /*!< PD size is changed */
174
175         LB_EVENT_PD_CREATED, /*!< If a PD is created even if you didn't call the livebox_create_pd API */
176         LB_EVENT_PD_DESTROYED, /*!< If a PD is destroyed even if you didn't call the livebox_destroy_pd API */
177
178         LB_EVENT_HOLD_SCROLL, /*!< If the screen should be freezed */
179         LB_EVENT_RELEASE_SCROLL, /*!< If the screen can be scrolled */
180
181         LB_EVENT_LB_UPDATE_BEGIN, /*!< Livebox LB content update is started */
182         LB_EVENT_LB_UPDATE_END, /*!< Livebox LB content update is finished */
183
184         LB_EVENT_PD_UPDATE_BEGIN, /*!< Livebox PD content update is started */
185         LB_EVENT_PD_UPDATE_END, /*!< Livebox PD content update is finished */
186
187         LB_EVENT_UPDATE_MODE_CHANGED, /*!< Livebox Update mode is changed */
188
189         LB_EVENT_IGNORED /*!< Request is ignored */
190 };
191
192 enum livebox_fault_type {
193         LB_FAULT_DEACTIVATED, /*!< Livebox is deactivated by its fault operation */
194         LB_FAULT_PROVIDER_DISCONNECTED /*!< Provider is disconnected */
195 };
196
197 /*!
198  * \brief
199  * Must be sync'd with the provider
200  */
201 enum livebox_visible_state {
202         LB_SHOW = 0x00, /*!< Livebox is showed. Default state */
203         LB_HIDE = 0x01, /*!< Livebox is hide, Update timer is not be freezed. but you cannot receive any updates events. you should refresh(reload) the content of a livebox when you make this show again */
204
205         LB_HIDE_WITH_PAUSE = 0x02, /*!< Livebix is hide, it will paused the update timer, but if a livebox update its contents, update event will come to you */
206
207         LB_VISIBLE_ERROR = 0xFFFFFFFF /* To enlarge the size of this enumeration type */
208 };
209
210 /*!
211  * \brief
212  * TEXT type livebox contents handling opertators.
213  */
214 struct livebox_script_operators {
215         int (*update_begin)(struct livebox *handle); /*!< Content parser is started */
216         int (*update_end)(struct livebox *handle); /*!< Content parser is stopped */
217
218         /*!
219          * \brief
220          * Listed functions will be called when parser meets each typed component
221          */
222         int (*update_text)(struct livebox *handle, const char *id, const char *part, const char *data); /*!< Update text content */
223         int (*update_image)(struct livebox *handle, const char *id, const char *part, const char *data, const char *option); /*!< Update image content */
224         int (*update_script)(struct livebox *handle, const char *id, const char *part, const char *file, const char *group); /*!< Update script content */
225         int (*update_signal)(struct livebox *handle, const char *id, const char *emission, const char *signal); /*!< Update signal */
226         int (*update_drag)(struct livebox *handle, const char *id, const char *part, double dx, double dy); /*!< Update drag info */
227         int (*update_info_size)(struct livebox *handle, const char *id, int w, int h); /*!< Update content size */
228         int (*update_info_category)(struct livebox *handle, const char *id, const char *category); /*!< Update content category info */
229         int (*update_access)(struct livebox *handle, const char *id, const char *part, const char *text, const char *option); /*!< Update access information */
230         int (*operate_access)(struct livebox *handle, const char *id, const char *part, const char *operation, const char *option); /*!< Update access operation */
231 };
232
233 /*!
234  * \brief Prototype of the return callback of every async functions
235  * \details N/A
236  * \remarks N/A
237  * \param[in] handle Handle of the livebox instance
238  * \param[in] ret Result status of operation. LB_STATUS_XXX defined from liblivebox-service
239  * \param[in] data data for result callback
240  * \return void
241  * \pre N/A
242  * \post N/A
243  * \see livebox_add
244  * \see livebox_add_with_size
245  * \see livebox_del
246  * \see livebox_activate
247  * \see livebox_resize
248  * \see livebox_set_group
249  * \see livebox_set_period
250  * \see livebox_access_event
251  * \see livebox_set_pinup
252  * \see livebox_create_pd
253  * \see livebox_create_pd_with_position
254  * \see livebox_destroy_pd
255  * \see livebox_emit_text_signal
256  * \see livebox_acquire_pd_pixmap
257  * \see livebox_acquire_lb_pixmap
258  * \see livebox_set_update_mode
259  */
260 typedef void (*ret_cb_t)(struct livebox *handle, int ret, void *data);
261
262 /*!
263  * \brief Initialize the livebox system
264  * \details N/A
265  * \remarks N/A
266  * \param[in] disp If you have X Display connection object, you can re-use it. but you should care its life cycle.
267  *                 It must be alive before call the livebox_fini
268  * \return int
269  * \retval LB_STATUS_SUCCESS if success
270  * \pre N/A
271  * \post N/A
272  * \see livebox_fini
273  */
274 extern int livebox_init(void *disp);
275
276 /*!
277  * \brief Initialize the livebox system with some options
278  * \details livebox_init function uses environment value to initiate some configurable values
279  *          But some application doesn't want to use the env value.
280  *          For them, this API will give a chance to set default options using given arguments
281  * \remarks N/A
282  * \param[in] disp
283  * \param[in] prevent_overwrite
284  * \param[in] event_filter
285  * \return int
286  * \retval LB_STATUS_SUCCESS if success
287  * \pre N/A
288  * \post N/A
289  * \see livebox_init
290  * \see livebox_fini
291  */
292 extern int livebox_init_with_options(void *disp, int prevent_overwrite, double event_filter);
293
294 /*!
295  * \brief Finalize the livebox system
296  * \details N/A
297  * \remarks N/A
298  * \return int
299  * \retval LB_STATUS_SUCCES if success
300  * \retval LB_STATUS_ERROR_INVALID if livebox_init is not called.
301  * \pre N/A
302  * \post N/A
303  * \see livebox_init
304  */
305 extern int livebox_fini(void);
306
307 /*!
308  * \brief Client is paused.
309  * \details N/A
310  * \remarks N/A
311  * \return int
312  * \retval LB_STATUS_SUCCESS if success
313  * \retval LB_STATUS_ERROR_FAULT if it failed to send state(paused) info
314  * \pre N/A
315  * \post N/A
316  * \see livebox_client_resumed
317  */
318 extern int livebox_client_paused(void);
319
320 /*!
321  * \brief Client is rfesumed.
322  * \details N/A
323  * \remarks N/A
324  * \return int
325  * \retval LB_STATUS_SUCCESS if success
326  * \retval LB_STATUS_ERROR_FAULT if it failed to send state(resumed) info
327  * \pre N/A
328  * \post N/A
329  * \see livebox_client_paused
330  */
331 extern int livebox_client_resumed(void);
332
333 /*!
334  * \brief Add a new livebox
335  * \details N/A
336  * \remarks
337  *    Even though you get the livebox handle from return value of this function,
338  *    it is not matured before return callback called.
339  *    You have to use the handle after get the return callback with "ret == LB_STATUS_SUCCESS"
340  * \param[in] pkgname Livebox Id
341  * \param[in] content Will be passed to the livebox instance.
342  * \param[in] cluster Main group
343  * \param[in] category Sub group
344  * \param[in] period Update period. if you set DEFAULT_PERIOD, the provider will use the default period which is described in the manifest.
345  * \param[in] cb After send the request to the provider, its result will be passed
346  * \param[in] data
347  * \return handle
348  * \retval NULL if it fails to add a new instance
349  * \retval handle livebox handle
350  * \pre N/A
351  * \post
352  * \see ret_cb_t
353  * \see livebox_add_with_size
354  */
355 extern struct livebox *livebox_add(const char *pkgname, const char *content, const char *cluster, const char *category, double period, ret_cb_t cb, void *data);
356
357 /*!
358  * \brief Add a new livebox
359  * \details
360  * Normal mode livebox
361  * 1x1=175x175
362  * 2x1=354x175
363  * 2x2=354x354
364  * 4x1=712x175
365  * 4x2=712x354
366  * 4x4=712x712
367  *
368  * Extended sizes
369  * 4x3=712x533
370  * 4x5=712x891
371  * 4x6=712x1070
372  *
373  * Easy mode livebox
374  * 21x21=224x215
375  * 23x21=680x215
376  * 23x23=680x653
377  *
378  * Special livebox
379  * 0x0=720x1280
380  * \remarks
381  *    Even if you get the handle by return value of this function, it is not created instance.
382  *    So you have to deal it as not initialized handle.
383  *    Only it can be initialized after get the return callback with "ret == LB_STATUS_SUCCESS".
384  * \param[in] pkgname Livebox Id
385  * \param[in] content Will be passed to the livebox instance.
386  * \param[in] cluster Main group
387  * \param[in] category Sub group
388  * \param[in] period DEFAULT_PERIOD can be used for this. this argument will be used to specify the period of update content of livebox.
389  * \param[in] type Size type - which are defined from liblivebox-service package.
390  * \param[in] cb After the request is sent to the master provider, this callback will be called.
391  * \param[in] data This data will be passed to the callback.
392  * \return handle
393  * \retval handle Livebox handle but not yet initialized
394  * \retval NULL if it fails to create a handle
395  * \see ret_cb_t
396  * \see livebox_add
397  */
398 extern struct livebox *livebox_add_with_size(const char *pkgname, const char *content, const char *cluster, const char *category, double period, int type, ret_cb_t cb, void *data);
399
400 /*!
401  * \brief Delete a livebox
402  * \details N/A
403  * \remarks
404  *    If you call this with uninitialized handle, the return callback will be called synchronously.
405  *    So before return from this function, the return callback will be called first.
406  * \param[in] handler Handle of a livebox instance
407  * \param[in] cb return callback
408  * \param[in] data user data for return callback
409  * \return int
410  * \retval LB_STATUS_ERROR_INVALID Invalid argument
411  * \retval LB_STATUS_ERROR_BUSY already in process
412  * \retval LB_STATUS_ERROR_FAULT failed to create a request packet
413  * \retval LB_STATUS_SUCCESS successfully sent, return callack will be called
414  * \pre N/A
415  * \post N/A
416  * \see ret_cb_t
417  */
418 extern int livebox_del(struct livebox *handler, ret_cb_t cb, void *data);
419
420 /*!
421  * \brief Set a livebox events callback
422  * \details
423  *    To get the events push from the provider, register the event callback using this function
424  *    The callback will be called if there is any events from the provider.
425  * \remarks N/A
426  * \param[in] cb Event handler
427  * \param[in] data User data for the event handler
428  * \return int
429  * \retval LB_STATUS_SUCCESS if succeed to set event handler
430  * \retval LB_STATUS_ERROR_INVALID Invalid argument
431  * \retval LB_STATUS_ERROR_MEMORY Not enough memory
432  * \pre NULL
433  * \post NULL
434  * \see livebox_unset_event_handler
435  */
436 extern int livebox_set_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data), void *data);
437
438 /*!
439  * \brief Unset the livebox event handler
440  * \details N/A
441  * \remarks N/A
442  * \param[in] cb
443  * \return void *
444  * \retval pointer of 'data' which is used with the livebox_set_event_handler
445  * \pre N/A
446  * \post N/A
447  * \see livebox_set_event_handler
448  */
449 extern void *livebox_unset_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data));
450
451 /*!
452  * \brief Live box fault event handler registeration function
453  *   argument list
454  *      event, pkgname, filename, funcname
455  * \details N/A
456  * \remarks N/A
457  * \param[in] cb
458  * \param[in] data
459  * \return int
460  * \retval LB_STATUS_SUCCESS if succeed to set fault event handler
461  * \retval LB_STATUS_ERROR_INVALID Invalid argument
462  * \retval LB_STATUS_ERROR_MEMORY Not enough memory
463  * \pre N/A
464  * \post N/A
465  * \see livebox_unset_fault_handler
466  */
467 extern int livebox_set_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *), void *data);
468
469 /*!
470  * \brief Unset the live box fault event handler
471  * \details N/A
472  * \remarks N/A
473  * \param[in] cb
474  * \return void *
475  * \retval pointer of 'data' which is used with the livebox_set_fault_handler
476  * \pre N/A
477  * \post N/A
478  * \see livebox_set_fault_handler
479  */
480 extern void *livebox_unset_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *));
481
482 /*!
483  * \brief Activate the faulted livebox.
484  * \details
485  *    Request result will be back via return callback.
486  * \remarks
487  *    Even though this function returns SUCCESS, it means just successfully sent a request to provider.
488  *    So you have to check the return callback. and its "ret" argument.
489  * \param[in] pkgname
490  * \param[in] cb
491  * \param[in] data
492  * \return int
493  * \retval LB_STATUS_SUCCESS Successfully sent a request
494  * \retval LB_STATUS_ERROR_INVALID Invalid argument
495  * \retval LB_STATUS_ERROR_FAULT Failed to make a request
496  * \pre N/A
497  * \post N/A
498  * \see ret_cb_t
499  */
500 extern int livebox_activate(const char *pkgname, ret_cb_t cb, void *data);
501
502 /*!
503  * \brief Resize the livebox
504  * \details
505  * Normal mode livebox size
506  * 1x1=175x175
507  * 2x1=354x175
508  * 2x2=354x354
509  * 4x1=712x175
510  * 4x2=712x354
511  * 4x4=712x712
512  *
513  * Extended livebox size
514  * 4x3=712x533
515  * 4x5=712x891
516  * 4x6=712x1070
517  *
518  * Easy mode livebox size
519  * 21x21=224x215
520  * 23x21=680x215
521  * 23x23=680x653
522  *
523  * Special mode livebox size
524  * 0x0=720x1280
525  * \remarks
526  *    You have to check the return callback.
527  * \param[in] handler Handler of a livebox
528  * \param[in] type Type of a livebox size, LB_SIZE_TYPE_1x1, ...
529  * \param[in] cb Result callback of the resize operation.
530  * \param[in] data User data for return callback
531  * \return int
532  * \retval LB_STATUS_ERROR_INVALID Invalid argument
533  * \retval LB_STATUS_ERROR_BUSY Previous request of resize is in progress.
534  * \retval LB_STATUS_ERROR_ALREADY Already resized, there is no differences between current size and requested size.
535  * \retval LB_STATUS_ERROR_PERMISSION Permission denied, you only have view the content of this box.
536  * \retval LB_STATUS_ERROR_FAULT Failed to make a request
537  * \pre N/A
538  * \post N/A
539  * \see ret_cb_t
540  */
541 extern int livebox_resize(struct livebox *handler, int type, ret_cb_t cb, void *data);
542
543 /*!
544  * \brief Send the click event for a livebox.
545  * \details N/A
546  * \remarks N/A
547  * \param[in] handler Handler of a livebox
548  * \param[in] x Rational X of the content width.
549  * \param[in] y Rational Y of the content height.
550  * \return int
551  * \retval LB_STATUS_ERROR_INVALID
552  * \retval LB_STATUS_ERROR_FAULT
553  * \retval LB_STATUS_SUCCESS
554  * \pre N/A
555  * \post N/A
556  * \see N/A
557  */
558 extern int livebox_click(struct livebox *handler, double x, double y);
559
560 /*!
561  * \brief Change the cluster/sub-cluster name of given livebox handler
562  * \details N/A
563  * \remarks N/A
564  * \param[in] handler Handler of a livebox
565  * \param[in] cluster New cluster of a livebox
566  * \param[in] category New category of a livebox
567  * \param[in] cb Result callback for changing the cluster/category of a livebox
568  * \param[in] data User data for the result callback
569  * \return int
570  * \retval LB_STATUS_SUCCESS Request is successfully sent. the return callback will be called.
571  * \retval LB_STATUS_ERROR_BUSY previous request is not finished yet.
572  * \retval LB_STATUS_ERROR_ALREADY group name is same with current one.
573  * \retval LB_STATUS_ERROR_PERMISSION you have no permission to change property of this livebox instance.
574  * \retval LB_STATUS_ERROR_FAULT Failed to make a request.
575  * \pre N/A
576  * \post N/A
577  * \see ret_cb_t
578  */
579 extern int livebox_set_group(struct livebox *handler, const char *cluster, const char *category, ret_cb_t cb, void *data);
580
581 /*!
582  * \brief Get the cluster and category(sub-cluster) name of given livebox (It is not I18N format, only english)
583  * \details N/A
584  * \remarks
585  *    You have to do not release the cluster & category.
586  *    It is allocated inside of given livebox instance, so you can only read it.
587  * \param[in] handler Handler of a livebox
588  * \param[out] cluster Storage(memory) for containing the cluster name
589  * \param[out] category Storage(memory) for containing the category name
590  * \return int
591  * \retval LB_STATUS_ERROR_INVALID
592  * \retval LB_STATUS_SUCCESS
593  * \pre N/A
594  * \post N/A
595  * \see N/A
596  */
597 extern int livebox_get_group(struct livebox *handler, char ** const cluster, char ** const category);
598
599 /*!
600  * \brief Get the period of this livebox handler
601  * \details N/A
602  * \remarks
603  *    if this function returns 0.0f, it means the livebox has no update period.
604  *    or the handle is not valid.
605  *    This function only can be works after the return callback of livebox_create fucntion is called.
606  * \param[in] handler Handler of a livebox
607  * \return double
608  * \retval Current update period of a livebox
609  * \retval 0.0f it means the box has no update period, or it can returns 0.0 if the handles is not valid.
610  * \pre N/A
611  * \post N/A
612  * \see N/A
613  */
614 extern double livebox_period(struct livebox *handler);
615
616 /*!
617  * \brief Change the update period
618  * \details N/A
619  * \remarks N/A
620  * \param[in] handler Handler of a livebox
621  * \param[in] period New update period of a livebox
622  * \param[in] cb Result callback of changing the update period of this livebox
623  * \param[in] data User data for the result callback
624  * \return int
625  * \retval LB_STATUS_SUCCESS
626  * \retval LB_STATUS_ERROR_INVALID
627  * \retval LB_STATUS_ERROR_BUSY
628  * \retval LB_STATUS_ERROR_ALREADY
629  * \retval LB_STATUS_ERROR_FAULT
630  * \pre N/A
631  * \post N/A
632  * \see ret_cb_t
633  */
634 extern int livebox_set_period(struct livebox *handler, double period, ret_cb_t cb, void *data);
635
636 /*!
637  * \brief Is this an text type livebox?
638  * \details N/A
639  * \remarks N/A
640  * \param[in] handler
641  * \return livebox_lb_type
642  * \retval LB_TYPE_IMAGE Contents of a livebox is based on the image file
643  * \retval LB_TYPE_BUFFER Contents of a livebox is based on canvas buffer(shared)
644  * \retval LB_TYPE_TEXT Contents of a livebox is based on formatted text file
645  * \retval LB_TYPE_PIXMAP Contens of a livebox is shared by the pixmap(depends on X)
646  * \retval LB_TYPE_INVALID
647  * \pre N/A
648  * \post N/A
649  * \see livebox_lb_type
650  */
651 extern enum livebox_lb_type livebox_lb_type(struct livebox *handler);
652
653 /*!
654  * \brief Is this livebox is created by a user?
655  * \details
656  *    If the livebox instance is created by system this will returns 0.
657  * \remarks N/A
658  * \param[in] handler
659  * \return int
660  * \retval LB_STATUS_ERROR_INVALID Invalid argument
661  * \retval 0 automatically created livebox by the provider
662  * \retval 1 created by user via livebox_add or livebox_add_with_size
663  * \pre N/A
664  * \post N/A
665  * \see livebox_add
666  * \see livebox_add_with_size
667  * \see livebox_set_event_handler
668  */
669 extern int livebox_is_user(struct livebox *handler);
670
671 /*!
672  * \brief Get the content information string of given livebox
673  * \details N/A
674  * \remarks N/A
675  * \param[in] handler
676  * \return char *
677  * \retval content_info Livebox content info that can be used again via content_info argument of livebox_add or livebox_add_with_size.
678  * \pre N/A
679  * \post N/A
680  * \see livebox_add
681  * \see livebox_add_with_size
682  */
683 extern const char *livebox_content(struct livebox *handler);
684
685 /*!
686  * \brief Get the sub cluster title string of given livebox
687  * \details N/A
688  * \remarks N/A
689  * \param[in] handler
690  * \return const char *
691  * \retval sub cluster name
692  * \retval NULL
693  * \pre N/A
694  * \post N/A
695  * \see N/A
696  */
697 extern const char *livebox_category_title(struct livebox *handler);
698
699 /*!
700  * \brief Get the filename of given livebox, if it is an IMAGE type livebox
701  * \details N/A
702  * \remarks N/A
703  * \param[in] handler
704  * \return const char *
705  * \retval filename if the livebox type is image this function will give you a abspath of an image file (content is rendered)
706  * \retval NULL if this has no image file or type is not image file.
707  * \pre N/A
708  * \post N/A
709  * \see N/A
710  */
711 extern const char *livebox_filename(struct livebox *handler);
712
713 /*!
714  * \brief Get the package name of given livebox handler
715  * \details N/A
716  * \remarks N/A
717  * \param[in] handler
718  * \return const char *
719  * \retval pkgname package name
720  * \retval NULL if the handler is not valid
721  * \pre N/A
722  * \post N/A
723  * \see N/A
724  */
725 extern const char *livebox_pkgname(struct livebox *handler);
726
727 /*!
728  * \brief Get the priority of a current content.
729  * \details N/A
730  * \remarks N/A
731  * \param[in] handler
732  * \return double
733  * \retval 0.0f handler is NULL
734  * \retval -1.0f Handler is not valid (not yet initialized)
735  * \retval real number between 0.0 and 1.0
736  * \pre N/A
737  * \post N/A
738  * \see N/A
739  */
740 extern double livebox_priority(struct livebox *handler);
741
742 /*!
743  * \brief Acquire the buffer of given livebox (Only for the buffer type)
744  * \details N/A
745  * \remarks N/A
746  * \param[in] handler
747  * \return void *
748  * \retval address of a FB
749  * \retval NULL if it fails to get fb address
750  * \pre N/A
751  * \post N/A
752  * \see N/A
753  */
754 extern void *livebox_acquire_fb(struct livebox *handler);
755
756 /*!
757  * \brief Release the buffer of a livebox (Only for the buffer type)
758  * \details N/A
759  * \remarks N/A
760  * \param[in] buffer
761  * \return int
762  * \retval LB_STATUS_ERROR_INVALID
763  * \retval LB_STATUS_SUCCESS
764  * \pre N/A
765  * \post N/A
766  * \see livebox_acquire_fb
767  */
768 extern int livebox_release_fb(void *buffer);
769
770 /*!
771  * \brief Get the reference count of Livebox buffer (Only for the buffer type)
772  * \details N/A
773  * \remarks N/A
774  * \param[in] buffer
775  * \return int
776  * \retval LB_STATUS_ERROR_INVALID
777  * \retval LB_STATUS_ERROR_FAULT
778  * \retval refcnt positive integer including ZERO
779  * \pre N/A
780  * \post N/A
781  * \see livebox_pdfb_refcnt
782  */
783 extern int livebox_fb_refcnt(void *buffer);
784
785 /*!
786  * \brief Acquire the buffer of a PD frame (Only for the buffer type)
787  * \details N/A
788  * \remarks N/A
789  * \param[in] handler
790  * \return int
791  * \retval NULL
792  * \retval adress of buffer of PD
793  * \pre N/A
794  * \post N/A
795  * \see livebox_release_pdfb
796  */
797 extern void *livebox_acquire_pdfb(struct livebox *handler);
798
799 /*!
800  * \brief Release the acquired buffer of the PD Frame (Only for the buffer type)
801  * \details N/A
802  * \remarks N/A
803  * \param[in] buffer
804  * \return int
805  * \retval LB_STATUS_ERROR_INVALID
806  * \retval LB_STATUS_SUCCESS
807  * \pre N/A
808  * \post N/A
809  * \see livebox_acquire_pdfb
810  */
811 extern int livebox_release_pdfb(void *buffer);
812
813 /*!
814  * \brief Reference count of given PD buffer (Only for the buffer type)
815  * \details N/A
816  * \remarks N/A
817  * \param[in] buffer
818  * \return int
819  * \retval LB_STATUS_ERROR_INVALID
820  * \retval LB_STATUS_ERROR_FAULT
821  * \retval reference count
822  * \pre N/A
823  * \post N/A
824  * \see livebox_fb_refcnt
825  */
826 extern int livebox_pdfb_refcnt(void *buffer);
827
828 /*!
829  * \brief Get the size of the Livebox
830  * \details N/A
831  * \remarks N/A
832  * \param[in] handler
833  * \return int
834  * \retval LB_SIZE_TYPE_NxM
835  * \retval LB_SIZE_TYPE_INVALID
836  * \pre N/A
837  * \post N/A
838  * \see N/A
839  */
840 extern int livebox_size(struct livebox *handler);
841
842 /*!
843  * \brief Get the size of the Progressive Disclosure
844  * \details N/A
845  * \remarks N/A
846  * \param[in] handler
847  * \param[out] w
848  * \param[out] h
849  * \return int
850  * \retval LB_STATUS_ERROR_INVALID
851  * \retval LB_STATUS_SUCCESS
852  * \pre N/A
853  * \post N/A
854  * \see N/A
855  */
856 extern int livebox_get_pdsize(struct livebox *handler, int *w, int *h);
857
858 /*!
859  * \brief List of supported sizes of given handler
860  * \details N/A
861  * \remarks N/A
862  * \param[in] handler
863  * \param[out] cnt
864  * \param[out] size_list
865  * \return int
866  * \retval LB_STATUS_ERROR_INVALID
867  * \retval LB_STATUS_SUCCESS
868  * \pre N/A
869  * \post N/A
870  * \see N/A
871  */
872 extern int livebox_get_supported_sizes(struct livebox *handler, int *cnt, int *size_list);
873
874 /*!
875  * \brief BUFFER SIZE of the livebox if it is a buffer type
876  * \details N/A
877  * \remarks N/A
878  * \param[in] handler
879  * \return int
880  * \retval LB_STATUS_ERROR_INVALID
881  * \retval size of livebox buffer
882  * \pre N/A
883  * \post N/A
884  * \see N/A
885  */
886 extern int livebox_lbfb_bufsz(struct livebox *handler);
887
888 /*!
889  * \brief BUFFER SIZE of the progiressive disclosure if it is a buffer type
890  * \details N/A
891  * \remarks N/A
892  * \param[in] handler
893  * \return int
894  * \retval LB_STATUS_ERROR_INVALID
895  * \retval size of PD buffer
896  * \pre N/A
897  * \post N/A
898  * \see N/A
899  */
900 extern int livebox_pdfb_bufsz(struct livebox *handler);
901
902 /*!
903  * \brief Send the content event (for buffer type) to provider(livebox)
904  * \details N/A
905  * \remarks N/A
906  * \param[in] handler
907  * \param[in] type
908  * \param[in] x
909  * \param[in] y
910  * \return int
911  * \retval LB_STATUS_ERROR_INVALID
912  * \retval LB_STATUS_ERROR_BUSY
913  * \retval LB_STATUS_ERROR_FAULT
914  * \retval LB_STATUS_SUCCESS
915  * \pre N/A
916  * \post N/A
917  * \see livebox_access_event
918  */
919 extern int livebox_content_event(struct livebox *handler, enum content_event_type type, double x, double y);
920
921 /*!
922  * \brief Send the access event(for buffer type) to provider(livebox).
923  * \details N/A
924  * \remarks N/A
925  * \param[in] handler
926  * \param[in] type
927  * \param[in] x
928  * \param[in] y
929  * \param[in] cb
930  * \param[in] data
931  * \return int
932  * \retval LB_STATUS_ERROR_INVALID
933  * \retval LB_STATUS_ERROR_BUSY
934  * \retval LB_STATUS_ERROR_FAULT
935  * \retval LB_STATUS_SUCCESS
936  * \pre N/A
937  * \post N/A
938  * \see livebox_content_event
939  */
940 extern int livebox_access_event(struct livebox *handler, enum access_event_type type, double x, double y, ret_cb_t cb, void *data);
941
942 /*!
943  * \brief Do pin up or not.
944  * \details N/A
945  * \remarks N/A
946  * \param[in] handler
947  * \param[in] flag
948  * \param[in] cb
949  * \param[in] data
950  * \return int
951  * \retval LB_STATUS_ERROR_INVALID
952  * \retval 1 box is pinned up
953  * \retval 0 box is not pinned up
954  * \see ret_cb_t
955  */
956 extern int livebox_set_pinup(struct livebox *handler, int flag, ret_cb_t cb, void *data);
957
958 /*!
959  * \brief Check the PIN-UP status of given handler
960  * \details N/A
961  * \remarks N/A
962  * \param[in] handler
963  * \return int
964  */
965 extern int livebox_is_pinned_up(struct livebox *handler);
966
967 /*!
968  * \brief Check the PINUP feature availability of the given handler
969  * \details N/A
970  * \remarks N/A
971  * \param[in] handler
972  * \return int
973  * \retval LB_STATUS_ERROR_INVALID
974  * \retval 1 if the box support Pinup feature
975  * \retval 0 if the box does not support the Pinup feature
976  * \pre N/A
977  * \post N/A
978  * \see N/A
979  */
980 extern int livebox_has_pinup(struct livebox *handler);
981
982 /*!
983  * \brief Check the PD existence of given handler
984  * \details N/A
985  * \remarks N/A
986  * \param[in] handler
987  * \return int
988  * \retval LB_STATUS_ERROR_INVALID
989  * \retval 1 if the box support the PD
990  * \retval 0 if the box has no PD
991  * \pre N/A
992  * \post N/A
993  * \see N/A
994  */
995 extern int livebox_has_pd(struct livebox *handler);
996
997 /*!
998  * \brief Create the PD of given handler
999  * \details N/A
1000  * \remarks N/A
1001  * \param[in] handler
1002  * \param[in] cb
1003  * \param[in] data
1004  * \return int
1005  * \retval LB_STATUS_SUCCESS
1006  * \retval LB_STATUS_ERROR_INVALID
1007  * \retval LB_STATUS_ERROR_BUSY
1008  * \retval LB_STATUS_ERROR_FAULT
1009  * \pre N/A
1010  * \post N/A
1011  * \see ret_cb_t
1012  */
1013 extern int livebox_create_pd(struct livebox *handler, ret_cb_t cb, void *data);
1014
1015 /*!
1016  * \brief Create the PD of given handler with the relative position from livebox
1017  * \details N/A
1018  * \remarks N/A
1019  * \param[in] handler
1020  * \param[in] x 0.0 ~ 1.0
1021  * \param[in] y 0.0 ~ 1.0
1022  * \param[in] cb
1023  * \param[in] data
1024  * \return int
1025  * \retval LB_STATUS_SUCCESS
1026  * \retval LB_STATUS_ERROR_INVALID
1027  * \retval LB_STATUS_ERROR_BUSY
1028  * \retval LB_STATUS_ERROR_FAULT
1029  * \pre N/A
1030  * \post N/A
1031  * \see N/A
1032  */
1033 extern int livebox_create_pd_with_position(struct livebox *handler, double x, double y, ret_cb_t cb, void *data);
1034
1035 /*!
1036  * \brief PD position is updated.
1037  * \details N/A
1038  * \remarks N/A
1039  * \param[in] handler
1040  * \param[in] x 0.0 ~ 1.0
1041  * \param[in] y 0.0 ~ 1.0
1042  * \return int
1043  * \retval LB_STATUS_SUCCESS if succeed to send request for updating position of the PD.
1044  * \retval LB_STATUS_ERROR_FAULT
1045  * \retval LB_STATUS_ERROR_INVALID
1046  * \pre N/A
1047  * \post N/A
1048  * \see N/A
1049  */
1050 extern int livebox_move_pd(struct livebox *handler, double x, double y);
1051
1052 /*!
1053  * \brief Destroy the PD of given handler if it is created.
1054  * \details N/A
1055  * \remarks N/A
1056  * \param[in] handler
1057  * \param[in] cb
1058  * \param[in] data
1059  * \return int
1060  * \retval LB_STATUS_ERROR_INVALID
1061  * \retval LB_STATUS_ERROR_FAULT
1062  * \retval LB_STATUS_SUCCESS
1063  * \pre N/A
1064  * \post N/A
1065  * \see ret_cb_t
1066  */
1067 extern int livebox_destroy_pd(struct livebox *handler, ret_cb_t cb, void *data);
1068
1069 /*!
1070  * \brief Check the create status of given livebox handler
1071  * \details N/A
1072  * \remarks N/A
1073  * \param[in] handler
1074  * \return int
1075  * \retval LB_STATUS_ERROR_INVALID
1076  * \retval 0 PD is not created
1077  * \retval 1 PD is created
1078  */
1079 extern int livebox_pd_is_created(struct livebox *handler);
1080
1081 /*!
1082  * \brief Check the content type of the progressive disclosure of given handler
1083  * \details N/A
1084  * \remarks N/A
1085  * \param[in] handler
1086  * \return int
1087  * \retval PD_TYPE_BUFFER Contents of a PD is based on canvas buffer(shared)
1088  * \retval PD_TYPE_TEXT Contents of a PD is based on formatted text file
1089  * \retval PD_TYPE_PIXMAP Contents of a livebox is shared by the pixmap(depends on X)
1090  * \retval PD_TYPE_INVALID
1091  * \pre N/A
1092  * \post N/A
1093  * \see livebox_pd_type
1094  */
1095 extern enum livebox_pd_type livebox_pd_type(struct livebox *handler);
1096
1097 /*!
1098  * \brief Check the existence of a livebox about given package name
1099  * \details N/A
1100  * \remarks N/A
1101  * \param[in] pkgname
1102  * \return int
1103  * \retval 1 if the box is exists
1104  * \retval 0 if the box is not exists
1105  * \pre N/A
1106  * \post N/A
1107  * \see N/A
1108  */
1109 extern int livebox_is_exists(const char *pkgname);
1110
1111 /*!
1112  * \brief Set function table for parsing the text content of a livebox
1113  * \details N/A
1114  * \remarks N/A
1115  * \param[in] handler
1116  * \param[in] ops
1117  * \return int
1118  * \retval LB_STATUS_SUCCESS
1119  * \retval LB_STATUS_ERROR_INVALID
1120  * \see livebox_set_pd_text_handler
1121  */
1122 extern int livebox_set_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
1123
1124 /*!
1125  * \brief Set function table for parsing the text content of a Progressive Disclosure
1126  * \details N/A
1127  * \remarks N/A
1128  * \param[in] handler
1129  * \param[in] ops
1130  * \return int
1131  * \retval LB_STATUS_SUCCESS
1132  * \retval LB_STATUS_ERROR_INVALID
1133  * \see livebox_set_text_handler
1134  */
1135 extern int livebox_set_pd_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
1136
1137 /*!
1138  * \brief Emit a text signal to given livebox only if it is a text type.
1139  * \details N/A
1140  * \remarks N/A
1141  * \param[in] handler
1142  * \param[in] emission
1143  * \param[in] source
1144  * \param[in] sx
1145  * \param[in] sy
1146  * \param[in] ex
1147  * \param[in] ey
1148  * \param[in] cb
1149  * \param[in] data
1150  * \return int
1151  * \retval LB_STATUS_ERROR_INVALID
1152  * \retval LB_STATUS_ERROR_FAULT
1153  * \retval LB_STATUS_SUCCESS
1154  * \see ret_cb_t
1155  */
1156 extern int livebox_emit_text_signal(struct livebox *handler, const char *emission, const char *source, double sx, double sy, double ex, double ey, ret_cb_t cb, void *data);
1157
1158 /*!
1159  * \brief Set a private data pointer to carry it using given handler
1160  * \details N/A
1161  * \remarks N/A
1162  * \param[in] handler
1163  * \param[in] data
1164  * \return int
1165  * \retval LB_STATUS_SUCCESS
1166  * \retval LB_STATUS_ERROR_INVALID
1167  * \pre N/A
1168  * \post N/A
1169  * \see livebox_get_data
1170  */
1171 extern int livebox_set_data(struct livebox *handler, void *data);
1172
1173 /*!
1174  * \brief Get private data pointer which is carried by given handler
1175  * \details N/A
1176  * \remarks N/A
1177  * \param[in] handler
1178  * \return void *
1179  * \retval data pointer
1180  * \pre N/A
1181  * \post N/A
1182  * \see livebox_set_data
1183  */
1184 extern void *livebox_get_data(struct livebox *handler);
1185
1186 /*!
1187  * \brief Subscribe the event for liveboxes only in given cluster and sub-cluster
1188  * \details N/A
1189  * \remarks N/A
1190  * \param[in] cluster   "*" can be used for subscribe all cluster's liveboxes event.
1191  *                      If you use the "*", value in the category will be ignored.
1192  * \param[in] category  "*" can be used for subscribe liveboxes events of all category(sub-cluster) in given "cluster"
1193  * \return int
1194  * \retval LB_STATUS_ERROR_FAULT
1195  * \retval LB_STATUS_SUCCESS
1196  * \pre N/A
1197  * \post N/A
1198  * \see livebox_unsubscribe_group
1199  */
1200 extern int livebox_subscribe_group(const char *cluster, const char *category);
1201
1202 /*!
1203  * \brief Unsubscribe the event for the liveboxes, but you will receive already added liveboxes event.
1204  * \details N/A
1205  * \remarks N/A
1206  * \param[in] cluster   "*" can be used for subscribe all cluster's liveboxes event.
1207  *                      If you use the "*", value in the category will be ignored.
1208  * \param[in] category  "*" can be used for subscribe all sub-cluster's liveboxes event in given "cluster"
1209  * \return int
1210  * \retval LB_STATUS_ERROR_FAULT
1211  * \retval LB_STATUS_SUCCESS
1212  * \pre N/A
1213  * \post N/A
1214  * \see livebox_subscribe_group
1215  */
1216 extern int livebox_unsubscribe_group(const char *cluster, const char *category);
1217
1218 /*!
1219  * \brief Refresh the group(cluster/sub-cluser(aka. category))
1220  * \details N/A
1221  * \remarks N/A
1222  * \param[in] cluster Cluster ID
1223  * \param[in] category Sub-cluster ID
1224  * \param[in] force 1 if the boxes should be updated even if they are paused
1225  * \return int
1226  * \retval LB_STATUS_ERROR_INVALID
1227  * \retval LB_STATUS_ERROR_FAULT
1228  * \retval LB_STATUS_SUCCESS
1229  * \pre N/A
1230  * \post N/A
1231  * \see N/A
1232  */
1233 extern int livebox_refresh_group(const char *cluster, const char *category, int force);
1234
1235 /*!
1236  * \brief Refresh a livebox
1237  * \details N/A
1238  * \remarks N/A
1239  * \param[in] handler
1240  * \param[in] force 1 if the box should be updated even if it is paused
1241  * \return int
1242  * \retval LB_STATUS_ERROR_INVALID
1243  * \retval LB_STATUS_ERROR_FAULT
1244  * \retval LB_STATUS_SUCCESS
1245  * \pre N/A
1246  * \post N/A
1247  * \see N/A
1248  */
1249 extern int livebox_refresh(struct livebox *handler, int force);
1250
1251 /*!
1252  * \brief Pixmap Id of a livebox content
1253  * \details N/A
1254  * \remarks N/A
1255  * \param[in] handler
1256  * \return int
1257  * \retval 0 if the pixmap is not created
1258  * \retval pixmap Pixmap Id need to be casted to (unsigned int) type
1259  * \pre N/A
1260  * \post N/A
1261  * \see livebox_pd_pixmap
1262  */
1263 extern int livebox_lb_pixmap(const struct livebox *handler);
1264
1265 /*!
1266  * \brief Pixmap Id of a PD content
1267  * \details N/A
1268  * \remarks N/A
1269  * \param[in] handler
1270  * \return int
1271  * \retval 0 if the pixmap is not created
1272  * \retval pixmap Pixmap Id need to be casted to (unsigned int) type
1273  * \pre N/A
1274  * \post N/A
1275  * \see livebox_lb_pixmap
1276  */
1277 extern int livebox_pd_pixmap(const struct livebox *handler);
1278
1279 /*!
1280  * \brief
1281  * \details N/A
1282  * \remarks N/A
1283  * \param[in] handler
1284  * \param[in] cb
1285  * \param[in] data
1286  * \return int
1287  * \retval LB_STATUS_ERROR_INVALID
1288  * \retval LB_STATUS_ERROR_FAULT
1289  * \retval LB_STATUS_SUCCESS
1290  * \pre N/A
1291  * \post N/A
1292  * \see livebox_release_pd_pixmap
1293  * \see livebox_acquire_lb_pixmap
1294  * \see ret_cb_t
1295  */
1296 extern int livebox_acquire_pd_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
1297
1298 /*!
1299  * \brief Release the acquired pixmap ID
1300  * \details N/A
1301  * \remarks N/A
1302  * \param[in] handler
1303  * \param[in] pixmap
1304  * \return int
1305  * \retval LB_STATUS_ERROR_INVALID
1306  * \retval LB_STATUS_ERROR_FAULT
1307  * \retval LB_STATUS_SUCCESS
1308  * \pre N/A
1309  * \post N/A
1310  * \see livebox_acquire_pd_pixmap
1311  * \see livebox_release_lb_pixmap
1312  */
1313 extern int livebox_release_pd_pixmap(struct livebox *handler, int pixmap);
1314
1315 /*!
1316  * \brief
1317  * \details N/A
1318  * \remarks N/A
1319  * \param[in] handler
1320  * \param[in] cb
1321  * \param[in] data
1322  * \return int
1323  * \retval LB_STATUS_ERROR_INVALID
1324  * \retval LB_STATUS_ERROR_FAULT
1325  * \retval LB_STATUS_SUCCESS
1326  * \pre N/A
1327  * \post N/A
1328  * \see livebox_release_lb_pixmap
1329  * \see livebox_acquire_pd_pixmap
1330  * \see ret_cb_t
1331  */
1332 extern int livebox_acquire_lb_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
1333
1334 /*!
1335  * \brief
1336  * \details N/A
1337  * \remarks N/A
1338  * \param[in] handler
1339  * \param[in] pixmap
1340  * \return int
1341  * \retval LB_STATUS_ERROR_INVALID
1342  * \retval LB_STATUS_ERROR_FAULT
1343  * \retval LB_STATUS_SUCCESS
1344  * \pre N/A
1345  * \post N/A
1346  * \see livebox_acquire_lb_pixmap
1347  * \see livebox_release_pd_pixmap
1348  */
1349 extern int livebox_release_lb_pixmap(struct livebox *handler, int pixmap);
1350
1351 /*!
1352  * \brief Update the visible state of a livebox
1353  * \details N/A
1354  * \remarks N/A
1355  * \param[in] handler Handler of a livebox
1356  * \param[in] state Configure the current visible state of a livebox
1357  * \return int
1358  * \retval LB_STATUS_ERROR_INVALID
1359  * \retval LB_STATUS_ERROR_BUSY
1360  * \retval LB_STATUS_ERROR_PERMISSION
1361  * \retval LB_STATUS_ERROR_ALREADY
1362  * \retval LB_STATUS_ERROR_FAULT
1363  * \retval LB_STATUS_SUCCESS
1364  * \pre N/A
1365  * \post N/A
1366  * \see N/A
1367  */
1368 extern int livebox_set_visibility(struct livebox *handler, enum livebox_visible_state state);
1369
1370 /*!
1371  * \brief Current visible state of a livebox
1372  * \details N/A
1373  * \remarks N/A
1374  * \param[in] handler Handler of a livebox
1375  * \return livebox_visible_state
1376  * \retval LB_SHOW Livebox is showed. Default state
1377  * \retval LB_HIDE Livebox is hide, Update timer is not be freezed. but you cannot receive any updates events. you should refresh(reload) the content of a livebox when you make this show again
1378  * \retval LB_HIDE_WITH_PAUSE Livebix is hide, it will paused the update timer, but if a livebox update its contents, update event will come to you
1379  * \retval LB_VISIBLE_ERROR To enlarge the size of this enumeration type
1380  * \pre N/A
1381  * \post N/A
1382  * \see N/A
1383  */
1384 extern enum livebox_visible_state livebox_visibility(struct livebox *handler);
1385
1386 /*!
1387  * \brief Set the update mode of current livebox
1388  * \details N/A
1389  * \remarks N/A
1390  *        if you set 1 for active update mode, you should get buffer without updated event from provider.
1391  *        But is passive mode, you have to update content of a box when you get updated event.
1392  *        Default is Passive mode.
1393  * \param[in] handler Handler of a livebox
1394  * \param[in] active_update 1 means active update, 0 means passive update (default)
1395  * \param[in] cb Result callback function
1396  * \param[in] data Callback data
1397  * \return int
1398  * \retval LB_STATUS_ERROR_INVALID
1399  * \retval LB_STATUS_ERROR_BUSY
1400  * \retval LB_STATUS_ERROR_PERMISSION
1401  * \retval LB_STATUS_ERROR_ALREADY
1402  * \retval LB_STATUS_ERROR_FAULT
1403  * \retval LB_STATUS_SUCCESS
1404  * \see ret_cb_t
1405  */
1406 extern int livebox_set_update_mode(struct livebox *handler, int active_update, ret_cb_t cb, void *data);
1407
1408 /*!
1409  * \brief Is this box in the active update mode?
1410  * \details N/A
1411  * \remarks N/A
1412  * \param[in] handler HAndler of a livebox
1413  * \return int
1414  * \retval 0 if passive mode
1415  * \retval 1 if active mode or error code
1416  * \see N/A
1417  */
1418 extern int livebox_is_active_update(struct livebox *handler);
1419
1420 /*!
1421  * \brief Use the manual sync for S/W buffer
1422  * \details N/A
1423  * \remarks N/A
1424  * param[in] flag
1425  * \return void
1426  * \see livebox_manual_sync
1427  * \see livebox_sync_pd_fb
1428  * \see livebox_sync_lb_fb
1429  */
1430 extern void livebox_set_manual_sync(int flag);
1431
1432 /*!
1433  * \brief Get current mode
1434  * \details N/A
1435  * \remarks N/A
1436  * \return int
1437  * \retval 0 if auto sync
1438  * \retval 1 if manual sync
1439  * \see livebox_set_manual_sync
1440  * \see livebox_sync_pd_fb
1441  * \see livebox_sync_lb_fb
1442  */
1443 extern int livebox_manual_sync(void);
1444
1445 /*!
1446  * \brief Use the frame drop while resizing contents
1447  * \details N/A
1448  * \remarks N/A
1449  * \param[in] flag
1450  * \return void
1451  * \see livebox_frame_drop_for_resizing
1452  */
1453 extern void livebox_set_frame_drop_for_resizing(int flag);
1454
1455 /*!
1456  * \brief Get current mode
1457  * \details N/A
1458  * \remarks N/A
1459  * \return int
1460  * \retval 0 if disabled
1461  * \retval 1 if enabled
1462  * \see livebox_set_frame_drop_for_resizing
1463  */
1464 extern int livebox_frame_drop_for_resizing(void);
1465
1466 /*!
1467  * \brief Sync manually
1468  * \details N/A
1469  * \remarks N/A
1470  * param[in] handler
1471  * \return void
1472  * \retval 0 if success
1473  * \see livebox_set_manual_sync
1474  * \see livebox_manual_sync
1475  * \see livebox_sync_lb_fb
1476  */
1477 extern int livebox_sync_pd_fb(struct livebox *handler);
1478
1479 /*!
1480  * \brief Sync manually
1481  * \details N/A
1482  * \remarks N/A
1483  * param[in] handler
1484  * \return void
1485  * \retval 0 if success
1486  * \see livebox_set_manual_sync
1487  * \see livebox_manual_sync
1488  * \see livebox_sync_pd_fb
1489  */
1490 extern int livebox_sync_lb_fb(struct livebox *handler);
1491
1492 /*!
1493  * \}
1494  */
1495
1496 #ifdef __cplusplus
1497 }
1498 #endif
1499
1500 #endif