Update spec
[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 package manifest file of a livebox.
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          = 0x00000001, /*!< LB key press */
56         CONTENT_EVENT_KEY_UP            = 0x00000002, /*!< LB key release */
57         CONTENT_EVENT_KEY_FOCUS_IN      = 0x00000008, /*!< LB key focused in */
58         CONTENT_EVENT_KEY_FOCUS_OUT     = 0x00000010, /*!< LB key focused out */
59         CONTENT_EVENT_KEY_SET           = 0x00000020, /*!< LB Key, start feeding event by master */
60         CONTENT_EVENT_KEY_UNSET         = 0x00000040, /*!< LB key, stop feeding event by master */
61
62         CONTENT_EVENT_KEY_MASK          = 0x80000000,
63         CONTENT_EVENT_MOUSE_MASK        = 0x20000000,
64         CONTENT_EVENT_PD_MASK           = 0x10000000,
65         CONTENT_EVENT_LB_MASK           = 0x40000000,
66
67         LB_MOUSE_DOWN                   = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_DOWN, /*!< Mouse down on the livebox */
68         LB_MOUSE_UP                     = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UP, /*!< Mouse up on the livebox */
69         LB_MOUSE_MOVE                   = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_MOVE, /*!< Move move on the livebox */
70         LB_MOUSE_ENTER                  = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_ENTER, /*!< Mouse enter to the livebox */
71         LB_MOUSE_LEAVE                  = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_LEAVE, /*!< Mouse leave from the livebox */
72         LB_MOUSE_SET                    = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_SET, /*!< Mouse event, start feeding event by master */
73         LB_MOUSE_UNSET                  = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UNSET, /*!< Mouse event, stop feeding event by master */
74
75         PD_MOUSE_DOWN                   = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_DOWN, /*!< Mouse down on the PD */
76         PD_MOUSE_UP                     = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UP, /*!< Mouse up on the PD */
77         PD_MOUSE_MOVE                   = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_MOVE, /*!< Mouse move on the PD */
78         PD_MOUSE_ENTER                  = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_ENTER, /*!< Mouse enter to the PD */
79         PD_MOUSE_LEAVE                  = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_LEAVE, /*!< Mouse leave from the PD */
80         PD_MOUSE_SET                    = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_SET, /*!< Mouse event, start feeding event by master */
81         PD_MOUSE_UNSET                  = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UNSET, /*!< Mouse event, stop feeding event by master */
82
83         LB_KEY_DOWN                     = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_DOWN, /*!< Key down on the livebox */
84         LB_KEY_UP                       = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_UP, /*!< Key up on the livebox */
85         LB_KEY_SET                      = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_SET, /*!< Key event, start feeding event by master */
86         LB_KEY_UNSET                    = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_UNSET, /*!< Key event, stop feeding event by master */
87         LB_KEY_FOCUS_IN                 = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_FOCUS_IN, /*!< Key event, focus in */
88         LB_KEY_FOCUS_OUT                = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_FOCUS_OUT, /*!< Key event, foucs out */
89
90         PD_KEY_DOWN                     = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_DOWN, /*!< Key down on the livebox */
91         PD_KEY_UP                       = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_UP, /*!< Key up on the livebox */
92         PD_KEY_SET                      = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_SET, /*!< Key event, start feeding event by master */
93         PD_KEY_UNSET                    = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_UNSET, /*!< Key event, stop feeding event by master */
94         PD_KEY_FOCUS_IN                 = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_FOCUS_IN, /*!< Key event, focus in */
95         PD_KEY_FOCUS_OUT                = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_FOCUS_OUT, /*!< Key event, focus out */
96
97         CONTENT_EVENT_MAX               = 0xFFFFFFFF
98 };
99
100 /*!
101  * \brief
102  * Accessibility event for buffer type Livebox or PD.
103  * These event set are sync'd with Tizen accessibility event set.
104  */
105 enum access_event_type {
106         ACCESS_EVENT_PD_MASK            = 0x10000000,
107         ACCESS_EVENT_LB_MASK            = 0x20000000,
108
109         ACCESS_EVENT_HIGHLIGHT          = 0x00000100, /*!< LB accessibility: Hightlight a object */
110         ACCESS_EVENT_HIGHLIGHT_NEXT     = 0x00000200, /*!< LB accessibility: Set highlight to next object */
111         ACCESS_EVENT_HIGHLIGHT_PREV     = 0x00000400, /*!< LB accessibility: Set highlight to prev object */
112         ACCESS_EVENT_UNHIGHLIGHT        = 0x00000800, /*!< LB accessibility unhighlight */
113         ACCESS_EVENT_ACTIVATE           = 0x00001000, /*!< LB accessibility activate */
114         ACCESS_EVENT_ACTION_DOWN        = 0x00010000, /*!< LB accessibility value changed */
115         ACCESS_EVENT_ACTION_UP          = 0x00020000, /*!< LB accessibility value changed */
116         ACCESS_EVENT_SCROLL_DOWN        = 0x00100000, /*!< LB accessibility scroll down */
117         ACCESS_EVENT_SCROLL_MOVE        = 0x00200000, /*!< LB accessibility scroll move */
118         ACCESS_EVENT_SCROLL_UP          = 0x00400000, /*!< LB accessibility scroll up */
119
120         LB_ACCESS_HIGHLIGHT             = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_HIGHLIGHT,        /*!< Access event - Highlight an object in the livebox */
121         LB_ACCESS_HIGHLIGHT_NEXT        = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_HIGHLIGHT_NEXT,   /*!< Access event - Move highlight to the next object in a livebox */
122         LB_ACCESS_HIGHLIGHT_PREV        = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_HIGHLIGHT_PREV,   /*!< Access event - Move highlight to the prev object in a livebox */
123         LB_ACCESS_UNHIGHLIGHT           = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_UNHIGHLIGHT,      /*!< Access event - Delete highlight from the livebox */
124         LB_ACCESS_ACTIVATE              = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_ACTIVATE,         /*!< Access event - Launch or activate the highlighted object */
125         LB_ACCESS_ACTION_DOWN           = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_ACTION_DOWN,      /*!< Access event - down */
126         LB_ACCESS_ACTION_UP             = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_ACTION_UP,        /*!< Access event - up */
127         LB_ACCESS_SCROLL_DOWN           = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_SCROLL_DOWN,      /*!< Access event - scroll down */
128         LB_ACCESS_SCROLL_MOVE           = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_SCROLL_MOVE,      /*!< Access event - scroll move */
129         LB_ACCESS_SCROLL_UP             = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_SCROLL_UP,        /*!< Access event - scroll up */
130
131         PD_ACCESS_HIGHLIGHT             = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_HIGHLIGHT,        /*!< Access event - Highlight an object in the PD */
132         PD_ACCESS_HIGHLIGHT_NEXT        = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_HIGHLIGHT_NEXT,   /*!< Access event - Move highlight to the next object in a PD */
133         PD_ACCESS_HIGHLIGHT_PREV        = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_HIGHLIGHT_PREV,   /*!< Access event - Move highlight to the prev object in a PD */
134         PD_ACCESS_UNHIGHLIGHT           = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_UNHIGHLIGHT,      /*!< Access event - Delet highlight from the PD */
135         PD_ACCESS_ACTIVATE              = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_ACTIVATE,         /*!< Access event - Launch or activate the highlighted object */
136         PD_ACCESS_ACTION_DOWN           = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_ACTION_DOWN,      /*!< Access event - down */
137         PD_ACCESS_ACTION_UP             = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_ACTION_UP,        /*!< Access event - up */
138         PD_ACCESS_SCROLL_DOWN           = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_SCROLL_DOWN,      /*!< Access event - scroll down */
139         PD_ACCESS_SCROLL_MOVE           = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_SCROLL_MOVE,      /*!< Access event - scroll move */
140         PD_ACCESS_SCROLL_UP             = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_SCROLL_UP         /*!< Access event - scroll up */
141 };
142
143 /*!
144  * \brief
145  * Livebox LB content type
146  */
147 enum livebox_lb_type {
148         LB_TYPE_IMAGE = 0x01, /*!< Contents of a livebox is based on the image file */
149         LB_TYPE_BUFFER = 0x02, /*!< Contents of a livebox is based on canvas buffer(shared) */
150         LB_TYPE_TEXT = 0x04, /*!< Contents of a livebox is based on formatted text file */
151         LB_TYPE_PIXMAP = 0x08, /*!< Contens of a livebox is shared by the pixmap(depends on X) */
152
153         LB_TYPE_INVALID = 0xFF
154 };
155
156 /*!
157  * \brief
158  * Livebox PD content type
159  */
160 enum livebox_pd_type {
161         PD_TYPE_BUFFER = 0x01, /*!< Contents of a PD is based on canvas buffer(shared) */
162         PD_TYPE_TEXT = 0x02, /*!< Contents of a PD is based on formatted text file */
163         PD_TYPE_PIXMAP = 0x04, /*!< Contents of a livebox is shared by the pixmap(depends on X) */
164
165         PD_TYPE_INVALID = 0xFF
166 };
167
168 /*!
169  * \brief
170  * Livebox event type.
171  * These event will be sent from the provider.
172  */
173 enum livebox_event_type { /*!< livebox_event_handler_set Event list */
174         LB_EVENT_LB_UPDATED, /*!< Contents of the given livebox is updated */
175         LB_EVENT_PD_UPDATED, /*!< Contents of the given pd is updated */
176
177         LB_EVENT_CREATED, /*!< A new livebox is created */
178         LB_EVENT_DELETED, /*!< A livebox is deleted */
179
180         LB_EVENT_GROUP_CHANGED, /*!< Group (Cluster/Sub-cluster) information is changed */
181         LB_EVENT_PINUP_CHANGED, /*!< PINUP status is changed */
182         LB_EVENT_PERIOD_CHANGED, /*!< Update period is changed */
183
184         LB_EVENT_LB_SIZE_CHANGED, /*!< Livebox size is changed */
185         LB_EVENT_PD_SIZE_CHANGED, /*!< PD size is changed */
186
187         LB_EVENT_PD_CREATED, /*!< If a PD is created even if you didn't call the livebox_create_pd API */
188         LB_EVENT_PD_DESTROYED, /*!< If a PD is destroyed even if you didn't call the livebox_destroy_pd API */
189
190         LB_EVENT_HOLD_SCROLL, /*!< If the screen should be freezed */
191         LB_EVENT_RELEASE_SCROLL, /*!< If the screen can be scrolled */
192
193         LB_EVENT_LB_UPDATE_BEGIN, /*!< Livebox LB content update is started */
194         LB_EVENT_LB_UPDATE_END, /*!< Livebox LB content update is finished */
195
196         LB_EVENT_PD_UPDATE_BEGIN, /*!< Livebox PD content update is started */
197         LB_EVENT_PD_UPDATE_END, /*!< Livebox PD content update is finished */
198
199         LB_EVENT_UPDATE_MODE_CHANGED, /*!< Livebox Update mode is changed */
200
201         LB_EVENT_REQUEST_CLOSE_PD, /*!< Livebox requests to close the PD */
202
203         LB_EVENT_IGNORED /*!< Request is ignored */
204 };
205
206 enum livebox_option_type {
207         LB_OPTION_MANUAL_SYNC,                  /*!< Sync manually */
208         LB_OPTION_FRAME_DROP_FOR_RESIZE,        /*!< Drop frames while resizing */
209         LB_OPTION_SHARED_CONTENT,               /*!< Use only one real instance for multiple fake instances if user creates it using same content */
210
211         LB_OPTION_ERROR = 0xFFFFFFFF            /*!< To specify the size of this enumeration type */
212 };
213
214 enum livebox_fault_type {
215         LB_FAULT_DEACTIVATED, /*!< Livebox is deactivated by its fault operation */
216         LB_FAULT_PROVIDER_DISCONNECTED /*!< Provider is disconnected */
217 };
218
219 /*!
220  * \brief
221  * Must be sync'd with the provider
222  */
223 enum livebox_visible_state {
224         LB_SHOW = 0x00, /*!< Livebox is shown. Default state */
225         LB_HIDE = 0x01, /*!< Livebox is hidden, Update timer will not be freezed. but you cannot receive any updates events. */
226
227         LB_HIDE_WITH_PAUSE = 0x02, /*!< Livebix is hidden, it will pause the update timer, but if a livebox updates its contents, update event will be triggered */
228
229         LB_VISIBLE_ERROR = 0xFFFFFFFF /*!< To specify the size of this enumeration type */
230 };
231
232 /*!
233  * \brief
234  * TEXT type livebox contents handling opertators.
235  */
236 struct livebox_script_operators {
237         int (*update_begin)(struct livebox *handle); /*!< Content parser is started */
238         int (*update_end)(struct livebox *handle); /*!< Content parser is finished */
239
240         /*!
241          * \brief
242          * Listed functions will be called when parser meets each typed content
243          */
244         int (*update_text)(struct livebox *handle, const char *id, const char *part, const char *data); /*!< Update text content */
245         int (*update_image)(struct livebox *handle, const char *id, const char *part, const char *data, const char *option); /*!< Update image content */
246         int (*update_script)(struct livebox *handle, const char *id, const char *part, const char *file, const char *group); /*!< Update script content */
247         int (*update_signal)(struct livebox *handle, const char *id, const char *emission, const char *signal); /*!< Update signal */
248         int (*update_drag)(struct livebox *handle, const char *id, const char *part, double dx, double dy); /*!< Update drag info */
249         int (*update_info_size)(struct livebox *handle, const char *id, int w, int h); /*!< Update content size */
250         int (*update_info_category)(struct livebox *handle, const char *id, const char *category); /*!< Update content category info */
251         int (*update_access)(struct livebox *handle, const char *id, const char *part, const char *text, const char *option); /*!< Update access information */
252         int (*operate_access)(struct livebox *handle, const char *id, const char *part, const char *operation, const char *option); /*!< Update access operation */
253         int (*update_color)(struct livebox *handle, const char *id, const char *part, const char *data, const char *option); /*!< Update color */
254 };
255
256 /*!
257  * \brief Prototype of the return callback of every async functions
258  * \details N/A
259  * \remarks N/A
260  * \param[in] handle Handle of the livebox instance
261  * \param[in] ret Result status of operation. LB_STATUS_XXX defined from liblivebox-service
262  * \param[in] data data for result callback
263  * \return void
264  * \pre N/A
265  * \post N/A
266  * \see livebox_add
267  * \see livebox_add_with_size
268  * \see livebox_del
269  * \see livebox_activate
270  * \see livebox_resize
271  * \see livebox_set_group
272  * \see livebox_set_period
273  * \see livebox_access_event
274  * \see livebox_set_pinup
275  * \see livebox_create_pd
276  * \see livebox_create_pd_with_position
277  * \see livebox_destroy_pd
278  * \see livebox_emit_text_signal
279  * \see livebox_acquire_pd_pixmap
280  * \see livebox_acquire_lb_pixmap
281  * \see livebox_set_update_mode
282  */
283 typedef void (*ret_cb_t)(struct livebox *handle, int ret, void *data);
284
285 /*!
286  * \brief Initialize the livebox system
287  * \details N/A
288  * \remarks
289  *   This API uses get/setenv APIs.
290  *   Those APIs are not thread-safe.
291  *   So you have to consider to use the livebox_init_with_options instead of this if you are developing multi-threaded viewer.
292  * \param[in] disp If you have X Display connection object already, you can re-use it. but you should care its life cycle.
293  *                 It must be alive before call the livebox_fini
294  * \return int
295  * \retval LB_STATUS_SUCCESS if success
296  * \pre N/A
297  * \post N/A
298  * \see livebox_fini
299  * \see livebox_init_with_options
300  */
301 extern int livebox_init(void *disp);
302
303 /*!
304  * \brief Initialize the livebox system with some options
305  * \details livebox_init function uses environment value to initiate some configurable values
306  *          But some application doesn't want to use the env value.
307  *          For them, this API will give a chance to set default options using given arguments
308  * \remarks N/A
309  * \param[in] disp if this display is NULL, the library will try to acquire a new connection with X
310  * \param[in] prevent_overwrite If the content of image type livebox is updated, don't overwrite it(1) or overwrite old file(0)
311  * \param[in] event_filter If the next event comes in this period, ignore it. It is too fast to processing it in time.
312  * \param[in] use_thread Use the receive thread.
313  * \return int Integer, Livebox status code
314  * \retval LB_STATUS_SUCCESS if success
315  * \pre N/A
316  * \post N/A
317  * \see livebox_init
318  * \see livebox_fini
319  */
320 extern int livebox_init_with_options(void *disp, int prevent_overwrite, double event_filter, int use_thread);
321
322 /*!
323  * \brief Finalize the livebox system
324  * \details N/A
325  * \remarks N/A
326  * \return int
327  * \retval LB_STATUS_SUCCES if success
328  * \retval LB_STATUS_ERROR_INVALID if livebox_init is not called.
329  * \pre N/A
330  * \post N/A
331  * \see livebox_init
332  * \see livebox_init_with_options
333  */
334 extern int livebox_fini(void);
335
336 /*!
337  * \brief Notify the status of client to the provider. "it is paused".
338  * \details N/A
339  * \remarks N/A
340  * \return int
341  * \retval LB_STATUS_SUCCESS if success
342  * \retval LB_STATUS_ERROR_FAULT if it failed to send state(paused) info
343  * \pre N/A
344  * \post N/A
345  * \see livebox_client_resumed
346  */
347 extern int livebox_client_paused(void);
348
349 /*!
350  * \brief Notify the status of client to the provider. "it is resumed".
351  * \details N/A
352  * \remarks N/A
353  * \return int
354  * \retval LB_STATUS_SUCCESS if success
355  * \retval LB_STATUS_ERROR_FAULT if it failed to send state(resumed) info
356  * \pre N/A
357  * \post N/A
358  * \see livebox_client_paused
359  */
360 extern int livebox_client_resumed(void);
361
362 /*!
363  * \brief Add a new livebox
364  * \details N/A
365  * \remarks
366  *    Even though you get the livebox handle from return value of this function,
367  *    it is not matured before return callback called.
368  *    You have to use the handle after get the return callback with "ret == LB_STATUS_SUCCESS"
369  * \param[in] pkgname Livebox Id
370  * \param[in] content Will be passed to the livebox instance.
371  * \param[in] cluster Main group
372  * \param[in] category Sub group
373  * \param[in] period Update period. if you set DEFAULT_PERIOD, the provider will use the default period which is described in the manifest.
374  * \param[in] cb After send the request to the provider, its result will be passed
375  * \param[in] data
376  * \return handle
377  * \retval NULL if it fails to add a new instance
378  * \retval handle livebox handle
379  * \pre N/A
380  * \post
381  * \see ret_cb_t
382  * \see livebox_add_with_size
383  */
384 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);
385
386 /*!
387  * \brief Add a new livebox
388  * \details
389  * If the screen size if "1280x720"
390  * Below size lists are used for default.
391  * Or you can find the default sizes in pixel from /usr/share/data-provider-master/resolution.ini
392  * Size types are defined from the liblivebox-service package. (livebox-service.h)
393  *
394  * Normal mode livebox
395  * 1x1=175x175, LB_SIZE_TYPE_1x1
396  * 2x1=354x175, LB_SIZE_TYPE_2x1
397  * 2x2=354x354, LB_SIZE_TYPE_2x2
398  * 4x1=712x175, LB_SIZE_TYPE_4x1
399  * 4x2=712x354, LB_SIZE_TYPE_4x2
400  * 4x4=712x712, LB_SIZE_TYPE_4x4
401  *
402  * Extended sizes
403  * 4x3=712x533, LB_SIZE_TYPE_4x3
404  * 4x5=712x891, LB_SIZE_TYPE_4x5
405  * 4x6=712x1070, LB_SIZE_TYPE_4x6
406  *
407  * Easy mode livebox
408  * 21x21=224x215, LB_SIZE_TYPE_EASY_1x1
409  * 23x21=680x215, LB_SIZE_TYPE_EASY_3x1
410  * 23x23=680x653, LB_SIZE_TYPE_EASY_3x3
411  *
412  * Special livebox
413  * 0x0=720x1280, LB_SIZE_TYPE_0x0
414  *
415  * \remarks
416  *    Even if you get the handle by return value of this function, it is not created instance.
417  *    So you have to deal it as not initialized handle.
418  *    Only it can be initialized after get the return callback with "ret == LB_STATUS_SUCCESS".
419  * \param[in] pkgname Livebox Id
420  * \param[in] content Will be passed to the livebox instance.
421  * \param[in] cluster Main group
422  * \param[in] category Sub group
423  * \param[in] period DEFAULT_PERIOD can be used for this. this argument will be used to specify the period of update content of livebox.
424  * \param[in] type Size type - which are defined from liblivebox-service package.
425  * \param[in] cb After the request is sent to the master provider, this callback will be called.
426  * \param[in] data This data will be passed to the callback.
427  * \return handle
428  * \retval handle Livebox handle but not yet initialized
429  * \retval NULL if it fails to create a handle
430  * \see ret_cb_t
431  * \see livebox_add
432  */
433 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);
434
435 /*!
436  * \brief Delete a livebox (deprecated)
437  * \details N/A
438  * \remarks
439  *    If you call this with uninitialized handle, the return callback will be called synchronously.
440  *    So before return from this function, the return callback will be called first.
441  * \param[in] handler Handler of a livebox instance
442  * \param[in] cb return callback
443  * \param[in] data user data for return callback
444  * \return int
445  * \retval LB_STATUS_ERROR_INVALID Invalid argument
446  * \retval LB_STATUS_ERROR_BUSY already in process
447  * \retval LB_STATUS_ERROR_FAULT failed to create a request packet
448  * \retval LB_STATUS_SUCCESS successfully sent, return callack will be called
449  * \pre N/A
450  * \post N/A
451  * \see ret_cb_t
452  */
453 extern int livebox_del(struct livebox *handler, ret_cb_t cb, void *data);
454
455 /*!
456  * \brief Delete a livebox (will be replaced with livebox_del)
457  * \details N/A
458  * \remarks
459  *    If you call this with uninitialized handle, the return callback will be called synchronously.
460  *    So before return from this function, the return callback will be called first.
461  * \param[in] handler Handler of a livebox instance
462  * \param[in] type Deletion type, LB_DELETE_PERMANENTLY or LB_DELETE_TEMPORARY
463  * \param[in] cb return callback
464  * \param[in] data user data for return callback
465  * \return int
466  * \retval LB_STATUS_ERROR_INVALID Invalid argument
467  * \retval LB_STATUS_ERROR_BUSY already in process
468  * \retval LB_STATUS_ERROR_FAULT failed to create a request packet
469  * \retval LB_STATUS_SUCCESS successfully sent, return callack will be called
470  * \pre N/A
471  * \post N/A
472  * \see ret_cb_t
473  */
474 extern int livebox_del_NEW(struct livebox *handler, int type, ret_cb_t cb, void *data);
475
476 /*!
477  * \brief Set a livebox events callback
478  * \details
479  *    To get the events push from the provider, register the event callback using this function
480  *    The callback will be called if there is any events from the provider.
481  * \remarks N/A
482  * \param[in] cb Event handler
483  * \param[in] data User data for the event handler
484  * \return int
485  * \retval LB_STATUS_SUCCESS if succeed to set event handler
486  * \retval LB_STATUS_ERROR_INVALID Invalid argument
487  * \retval LB_STATUS_ERROR_MEMORY Not enough memory
488  * \pre NULL
489  * \post NULL
490  * \see livebox_unset_event_handler
491  */
492 extern int livebox_set_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data), void *data);
493
494 /*!
495  * \brief Unset the livebox event handler
496  * \details N/A
497  * \remarks N/A
498  * \param[in] cb Event handler
499  * \return void * Event handler data
500  * \retval pointer of 'data' which is used with the livebox_set_event_handler
501  * \pre N/A
502  * \post N/A
503  * \see livebox_set_event_handler
504  */
505 extern void *livebox_unset_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data));
506
507 /*!
508  * \brief Live box fault event handler registeration function
509  *   argument list
510  *      event, pkgname, filename, funcname
511  * \details N/A
512  * \remarks N/A
513  * \param[in] cb Event handler
514  * \param[in] data Event handler data
515  * \return int
516  * \retval LB_STATUS_SUCCESS if succeed to set fault event handler
517  * \retval LB_STATUS_ERROR_INVALID Invalid argument
518  * \retval LB_STATUS_ERROR_MEMORY Not enough memory
519  * \pre N/A
520  * \post N/A
521  * \see livebox_unset_fault_handler
522  */
523 extern int livebox_set_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *), void *data);
524
525 /*!
526  * \brief Unset the live box fault event handler
527  * \details N/A
528  * \remarks N/A
529  * \param[in] cb Event handler
530  * \return void * Callback data which is set via livebox_set_fault_handler
531  * \retval pointer of 'data' which is used with the livebox_set_fault_handler
532  * \pre N/A
533  * \post N/A
534  * \see livebox_set_fault_handler
535  */
536 extern void *livebox_unset_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *));
537
538 /*!
539  * \brief Activate the faulted livebox.
540  * \details
541  *    Request result will be back via return callback.
542  * \remarks
543  *    Even though this function returns SUCCESS, it means just successfully sent a request to provider.
544  *    So you have to check the return callback. and its "ret" argument.
545  * \param[in] pkgname Package name which should be activated
546  * \param[in] cb Result callback
547  * \param[in] data Callback data
548  * \return int
549  * \retval LB_STATUS_SUCCESS Successfully sent a request
550  * \retval LB_STATUS_ERROR_INVALID Invalid argument
551  * \retval LB_STATUS_ERROR_FAULT Failed to make a request
552  * \pre N/A
553  * \post N/A
554  * \see ret_cb_t
555  */
556 extern int livebox_activate(const char *pkgname, ret_cb_t cb, void *data);
557
558 /*!
559  * \brief Resize the livebox
560  * \details
561  * Normal mode livebox size
562  * 1x1=175x175, LB_SIZE_TYPE_1x1
563  * 2x1=354x175, LB_SIZE_TYPE_2x1
564  * 2x2=354x354, LB_SIZE_TYPE_2x2
565  * 4x1=712x175, LB_SIZE_TYPE_4x1
566  * 4x2=712x354, LB_SIZE_TYPE_4x2
567  * 4x4=712x712, LB_SIZE_TYPE_4x4
568  *
569  * Extended livebox size
570  * 4x3=712x533, LB_SIZE_TYPE_4x3
571  * 4x5=712x891, LB_SIZE_TYPE_4x5
572  * 4x6=712x1070, LB_SIZE_TYPE_4x6
573  *
574  * Easy mode livebox size
575  * 21x21=224x215, LB_SIZE_TYPE_EASY_1x1
576  * 23x21=680x215, LB_SIZE_TYPE_EASY_3x1
577  * 23x23=680x653, LB_SIZE_TYPE_EASY_3x3
578  *
579  * Special mode livebox size
580  * 0x0=720x1280, LB_SIZE_TYPE_0x0
581  * \remarks
582  *    You have to check the return callback.
583  * \param[in] handler Handler of a livebox instance
584  * \param[in] type Type of a livebox size, LB_SIZE_TYPE_1x1, ...
585  * \param[in] cb Result callback of the resize operation.
586  * \param[in] data User data for return callback
587  * \return int
588  * \retval LB_STATUS_ERROR_INVALID Invalid argument
589  * \retval LB_STATUS_ERROR_BUSY Previous request of resize is in progress.
590  * \retval LB_STATUS_ERROR_ALREADY Already resized, there is no differences between current size and requested size.
591  * \retval LB_STATUS_ERROR_PERMISSION Permission denied, you only have view the content of this box.
592  * \retval LB_STATUS_ERROR_FAULT Failed to make a request
593  * \pre N/A
594  * \post N/A
595  * \see ret_cb_t
596  */
597 extern int livebox_resize(struct livebox *handler, int type, ret_cb_t cb, void *data);
598
599 /*!
600  * \brief Send the click event for a livebox.
601  * \details N/A
602  * \remarks N/A
603  * \param[in] handler Handler of a livebox instance
604  * \param[in] x Rational X of the content width.
605  * \param[in] y Rational Y of the content height.
606  * \return int
607  * \retval LB_STATUS_ERROR_INVALID Invalid argument
608  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
609  * \retval LB_STATUS_SUCCESS Successfully done
610  * \pre N/A
611  * \post N/A
612  * \see N/A
613  */
614 extern int livebox_click(struct livebox *handler, double x, double y);
615
616 /*!
617  * \brief Change the cluster/sub-cluster name of given livebox handler
618  * \details N/A
619  * \remarks N/A
620  * \param[in] handler Handler of a livebox instance
621  * \param[in] cluster New cluster of a livebox
622  * \param[in] category New category of a livebox
623  * \param[in] cb Result callback for changing the cluster/category of a livebox
624  * \param[in] data User data for the result callback
625  * \return int
626  * \retval LB_STATUS_SUCCESS Request is successfully sent. the return callback will be called.
627  * \retval LB_STATUS_ERROR_BUSY previous request is not finished yet.
628  * \retval LB_STATUS_ERROR_ALREADY group name is same with current one.
629  * \retval LB_STATUS_ERROR_PERMISSION you have no permission to change property of this livebox instance.
630  * \retval LB_STATUS_ERROR_FAULT Failed to make a request.
631  * \pre N/A
632  * \post N/A
633  * \see ret_cb_t
634  */
635 extern int livebox_set_group(struct livebox *handler, const char *cluster, const char *category, ret_cb_t cb, void *data);
636
637 /*!
638  * \brief Get the cluster and category(sub-cluster) name of given livebox (It is not I18N format, only english)
639  * \details N/A
640  * \remarks
641  *    You have to do not release the cluster & category.
642  *    It is allocated inside of given livebox instance, so you can only read it.
643  * \param[in] handler Handler of a livebox instance
644  * \param[out] cluster Storage(memory) for containing the cluster name
645  * \param[out] category Storage(memory) for containing the category name
646  * \return int
647  * \retval LB_STATUS_ERROR_INVALID Invalid argument
648  * \retval LB_STATUS_SUCCESS Successfully done
649  * \pre N/A
650  * \post N/A
651  * \see N/A
652  */
653 extern int livebox_get_group(struct livebox *handler, const char **cluster, const char **category);
654
655 /*!
656  * \brief Get the period of this livebox handler
657  * \details N/A
658  * \remarks
659  *    if this function returns 0.0f, it means the livebox has no update period.
660  *    or the handle is not valid.
661  *    This function only can be works after the return callback of livebox_create fucntion is called.
662  * \param[in] handler Handler of a livebox instance
663  * \return double
664  * \retval Current update period of a livebox
665  * \retval 0.0f it means the box has no update period, or it can returns 0.0 if the handles is not valid.
666  * \pre N/A
667  * \post N/A
668  * \see N/A
669  */
670 extern double livebox_period(struct livebox *handler);
671
672 /*!
673  * \brief Change the update period
674  * \details N/A
675  * \remarks N/A
676  * \param[in] handler Handler of a livebox instance
677  * \param[in] period New update period of a livebox
678  * \param[in] cb Result callback of changing the update period of this livebox
679  * \param[in] data User data for the result callback
680  * \return int
681  * \retval LB_STATUS_SUCCESS Successfully done
682  * \retval LB_STATUS_ERROR_INVALID Invalid argument
683  * \retval LB_STATUS_ERROR_BUSY
684  * \retval LB_STATUS_ERROR_ALREADY
685  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
686  * \pre N/A
687  * \post N/A
688  * \see ret_cb_t
689  */
690 extern int livebox_set_period(struct livebox *handler, double period, ret_cb_t cb, void *data);
691
692 /*!
693  * \brief Is this an text type livebox?
694  * \details N/A
695  * \remarks N/A
696  * \param[in] handler Handler of a livebox instance
697  * \return livebox_lb_type
698  * \retval LB_TYPE_IMAGE Contents of a livebox is based on the image file
699  * \retval LB_TYPE_BUFFER Contents of a livebox is based on canvas buffer(shared)
700  * \retval LB_TYPE_TEXT Contents of a livebox is based on formatted text file
701  * \retval LB_TYPE_PIXMAP Contens of a livebox is shared by the pixmap(depends on X)
702  * \retval LB_TYPE_INVALID
703  * \pre N/A
704  * \post N/A
705  * \see livebox_lb_type
706  */
707 extern enum livebox_lb_type livebox_lb_type(struct livebox *handler);
708
709 /*!
710  * \brief Is this livebox is created by a user?
711  * \details
712  *    If the livebox instance is created by system this will returns 0.
713  * \remarks N/A
714  * \param[in] handler Handler of a livebox instance
715  * \return int
716  * \retval LB_STATUS_ERROR_INVALID Invalid argument
717  * \retval 0 automatically created livebox by the provider
718  * \retval 1 created by user via livebox_add or livebox_add_with_size
719  * \pre N/A
720  * \post N/A
721  * \see livebox_add
722  * \see livebox_add_with_size
723  * \see livebox_set_event_handler
724  */
725 extern int livebox_is_user(struct livebox *handler);
726
727 /*!
728  * \brief Get the content information string of given livebox
729  * \details N/A
730  * \remarks N/A
731  * \param[in] handler Handler of a livebox instance
732  * \return const char *
733  * \retval content_info Livebox content info that can be used again via content_info argument of livebox_add or livebox_add_with_size.
734  * \pre N/A
735  * \post N/A
736  * \see livebox_add
737  * \see livebox_add_with_size
738  */
739 extern const char *livebox_content(struct livebox *handler);
740
741 /*!
742  * \brief Get the sub cluster title string of given livebox
743  * \details
744  *  This API is now used for accessibility.
745  *  Each box should set their content as a string to read by TTS.
746  *  So if the box has focus on the homescreen, the homescreen will read a text using this API.
747  * \remarks
748  *  The title which is returned by this, the TTS should read it.
749  *  But it is just recomended to a homescreen.
750  *  So read it or not is depends on implementation of the homescreen.
751  * \param[in] handler Handler of a livebox instance
752  * \return const char *
753  * \retval sub cluster name
754  * \retval NULL
755  * \pre N/A
756  * \post N/A
757  * \see N/A
758  */
759 extern const char *livebox_category_title(struct livebox *handler);
760
761 /*!
762  * \brief Get the filename of given livebox, if it is an IMAGE type livebox
763  * \details
764  *   If the box is developed as image format to represent its contents,
765  *   The homescreen should know its image file name.
766  * \remarks N/A
767  * \param[in] handler Handler of a livebox instance
768  * \return const char *
769  * \retval filename if the livebox type is image this function will give you a abspath of an image file (content is rendered)
770  * \retval NULL if this has no image file or type is not image file.
771  * \pre N/A
772  * \post N/A
773  * \see N/A
774  */
775 extern const char *livebox_filename(struct livebox *handler);
776
777 /*!
778  * \brief Get the package name of given livebox handler
779  * \details N/A
780  * \remarks N/A
781  * \param[in] handler Handler of a livebox instance
782  * \return const char *
783  * \retval pkgname package name
784  * \retval NULL if the handler is not valid
785  * \pre N/A
786  * \post N/A
787  * \see N/A
788  */
789 extern const char *livebox_pkgname(struct livebox *handler);
790
791 /*!
792  * \brief Get the priority of a current content.
793  * \details N/A
794  * \remarks N/A
795  * \param[in] handler Handler of a livebox instance
796  * \return double
797  * \retval 0.0f handler is NULL
798  * \retval -1.0f Handler is not valid (not yet initialized)
799  * \retval real number between 0.0 and 1.0
800  * \pre N/A
801  * \post N/A
802  * \see N/A
803  */
804 extern double livebox_priority(struct livebox *handler);
805
806 /*!
807  * \brief Acquire the buffer of given livebox (Only for the buffer type)
808  * \details N/A
809  * \remarks N/A
810  * \param[in] handler Handler of a livebox instance
811  * \return void *
812  * \retval address of a FB
813  * \retval NULL if it fails to get fb address
814  * \pre N/A
815  * \post N/A
816  * \see N/A
817  */
818 extern void *livebox_acquire_fb(struct livebox *handler);
819
820 /*!
821  * \brief Release the buffer of a livebox (Only for the buffer type)
822  * \details N/A
823  * \remarks N/A
824  * \param[in] buffer
825  * \return int
826  * \retval LB_STATUS_ERROR_INVALID Invalid argument
827  * \retval LB_STATUS_SUCCESS Successfully done
828  * \pre N/A
829  * \post N/A
830  * \see livebox_acquire_fb
831  */
832 extern int livebox_release_fb(void *buffer);
833
834 /*!
835  * \brief Get the reference count of Livebox buffer (Only for the buffer type)
836  * \details N/A
837  * \remarks N/A
838  * \param[in] buffer
839  * \return int
840  * \retval LB_STATUS_ERROR_INVALID Invalid argument
841  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
842  * \retval refcnt positive integer including ZERO
843  * \pre N/A
844  * \post N/A
845  * \see livebox_pdfb_refcnt
846  */
847 extern int livebox_fb_refcnt(void *buffer);
848
849 /*!
850  * \brief Acquire the buffer of a PD frame (Only for the buffer type)
851  * \details N/A
852  * \remarks N/A
853  * \param[in] handler Handler of a livebox instance
854  * \return int
855  * \retval NULL
856  * \retval adress of buffer of PD
857  * \pre N/A
858  * \post N/A
859  * \see livebox_release_pdfb
860  */
861 extern void *livebox_acquire_pdfb(struct livebox *handler);
862
863 /*!
864  * \brief Release the acquired buffer of the PD Frame (Only for the buffer type)
865  * \details N/A
866  * \remarks N/A
867  * \param[in] buffer
868  * \return int
869  * \retval LB_STATUS_ERROR_INVALID Invalid argument
870  * \retval LB_STATUS_SUCCESS Successfully done
871  * \pre N/A
872  * \post N/A
873  * \see livebox_acquire_pdfb
874  */
875 extern int livebox_release_pdfb(void *buffer);
876
877 /*!
878  * \brief Reference count of given PD buffer (Only for the buffer type)
879  * \details N/A
880  * \remarks N/A
881  * \param[in] buffer
882  * \return int
883  * \retval LB_STATUS_ERROR_INVALID Invalid argument
884  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
885  * \retval reference count
886  * \pre N/A
887  * \post N/A
888  * \see livebox_fb_refcnt
889  */
890 extern int livebox_pdfb_refcnt(void *buffer);
891
892 /*!
893  * \brief Get the size of the Livebox
894  * \details N/A
895  * \remarks N/A
896  * \param[in] handler Handler of a livebox instance
897  * \return int
898  * \retval LB_SIZE_TYPE_NxM
899  * \retval LB_SIZE_TYPE_INVALID
900  * \pre N/A
901  * \post N/A
902  * \see N/A
903  */
904 extern int livebox_size(struct livebox *handler);
905
906 /*!
907  * \brief Get the size of the Progressive Disclosure
908  * \details N/A
909  * \remarks N/A
910  * \param[in] handler Handler of a livebox instance
911  * \param[out] w
912  * \param[out] h
913  * \return int
914  * \retval LB_STATUS_ERROR_INVALID Invalid argument
915  * \retval LB_STATUS_SUCCESS Successfully done
916  * \pre N/A
917  * \post N/A
918  * \see N/A
919  */
920 extern int livebox_get_pdsize(struct livebox *handler, int *w, int *h);
921
922 /*!
923  * \brief List of supported sizes of given handler
924  * \details N/A
925  * \remarks N/A
926  * \param[in] handler Handler of a livebox instance
927  * \param[out] cnt
928  * \param[out] size_list
929  * \return int
930  * \retval LB_STATUS_ERROR_INVALID Invalid argument
931  * \retval LB_STATUS_SUCCESS Successfully done
932  * \pre N/A
933  * \post N/A
934  * \see N/A
935  */
936 extern int livebox_get_supported_sizes(struct livebox *handler, int *cnt, int *size_list);
937
938 /*!
939  * \brief BUFFER SIZE of the livebox if it is a buffer type
940  * \details N/A
941  * \remarks N/A
942  * \param[in] handler Handler of a livebox instance
943  * \return int
944  * \retval LB_STATUS_ERROR_INVALID Invalid argument
945  * \retval size of livebox buffer
946  * \pre N/A
947  * \post N/A
948  * \see N/A
949  */
950 extern int livebox_lbfb_bufsz(struct livebox *handler);
951
952 /*!
953  * \brief BUFFER SIZE of the progiressive disclosure if it is a buffer type
954  * \details N/A
955  * \remarks N/A
956  * \param[in] handler Handler of a livebox instance
957  * \return int
958  * \retval LB_STATUS_ERROR_INVALID Invalid argument
959  * \retval size of PD buffer
960  * \pre N/A
961  * \post N/A
962  * \see N/A
963  */
964 extern int livebox_pdfb_bufsz(struct livebox *handler);
965
966 /*!
967  * \brief Send the content event (for buffer type) to provider(livebox)
968  * \details N/A
969  * \remarks DEPRECATED
970  *  Use the livebox_mouse_event function instead of this.
971  * \param[in] handler Handler of a livebox instance
972  * \param[in] type Event type
973  * \param[in] x coordinates of X axis
974  * \param[in] y coordinates of Y axis
975  * \return int
976  * \retval LB_STATUS_ERROR_INVALID Invalid argument
977  * \retval LB_STATUS_ERROR_BUSY Previous operaion is not finished yet
978  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
979  * \retval LB_STATUS_SUCCESS Successfully sent
980  * \pre N/A
981  * \post N/A
982  * \see livebox_mouse_event
983  * \see livebox_access_event
984  * \see livebox_key_event
985  */
986 extern int livebox_content_event(struct livebox *handler, enum content_event_type type, double x, double y);
987
988 /*!
989  * \brief Send the content event (for buffer type) to provider(livebox)
990  * \details N/A
991  * \remarks N/A
992  * \param[in] handler Handler of a livebox instance
993  * \param[in] type Event type
994  * \param[in] x coordinates of X axis
995  * \param[in] y coordinates of Y axis
996  * \return int
997  * \retval LB_STATUS_ERROR_INVALID Invalid argument
998  * \retval LB_STATUS_ERROR_BUSY Previous operation is not finished yet
999  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1000  * \retval LB_STATUS_SUCCESS Successfully sent
1001  * \pre N/A
1002  * \post N/A
1003  * \see livebox_content_event
1004  * \see livebox_access_event
1005  * \see livebox_key_event
1006  */
1007 extern int livebox_mouse_event(struct livebox *handler, enum content_event_type type, double x, double y);
1008
1009 /*!
1010  * \brief Send the access event(for buffer type) to provider(livebox).
1011  * \details N/A
1012  * \remarks N/A
1013  * \param[in] handler Handler of a livebox instance
1014  * \param[in] type Event type
1015  * \param[in] x coordinates of X axsis
1016  * \param[in] y coordinates of Y axsis
1017  * \param[in] cb Result callback function
1018  * \param[in] data Callback data
1019  * \return int
1020  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1021  * \retval LB_STATUS_ERROR_BUSY Previous operation is not finished yet
1022  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1023  * \retval LB_STATUS_SUCCESS Successfully sent
1024  * \pre N/A
1025  * \post N/A
1026  * \see livebox_mouse_event
1027  * \see livebox_key_event
1028  */
1029 extern int livebox_access_event(struct livebox *handler, enum access_event_type type, double x, double y, ret_cb_t cb, void *data);
1030
1031 /*!
1032  * \brief Send the key event(for buffer type) to provider(livebox).
1033  * \details N/A
1034  * \remarks N/A
1035  * \param[in] handler Handler of a livebox instance
1036  * \param[in] type Key event type
1037  * \param[in] keycode Code of key
1038  * \param[in] cb Result callback
1039  * \param[in] data Callback data
1040  * \return int
1041  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1042  * \retval LB_STATUS_ERROR_BUSY Previous operation is not finished yet
1043  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1044  * \retval LB_STATUS_SUCCESS Successfully sent
1045  * \pre N/A
1046  * \post N/A
1047  * \see livebox_mouse_event
1048  * \see livebox_access_event
1049  */
1050 extern int livebox_key_event(struct livebox *handler, enum content_event_type type, unsigned int keycode, ret_cb_t cb, void *data);
1051
1052 /*!
1053  * \brief Do pin up or not.
1054  * \details
1055  *   If the livebox supports the pinup feature,
1056  *   you can freeze the update of given livebox.
1057  *   But it is different with pause.
1058  *   The box will be updated and it will decide wheter update its content or not when the pinup is on.
1059  * \remarks N/A
1060  * \param[in] handler Handler of a livebox instance
1061  * \param[in] flag Pinup value
1062  * \param[in] cb Result callback
1063  * \param[in] data Callback data
1064  * \return int
1065  * \retval LB_STATUS_ERROR_INVALID Invalid parameters
1066  * \see ret_cb_t
1067  * \see livebox_set_visibility
1068  * \see livebox_is_pinned_up
1069  */
1070 extern int livebox_set_pinup(struct livebox *handler, int flag, ret_cb_t cb, void *data);
1071
1072 /*!
1073  * \brief Check the PIN-UP status of given handler
1074  * \details N/A
1075  * \remarks N/A
1076  * \param[in] handler Handler of a livebox instance
1077  * \return int
1078  * \retval LB_STATUS_ERROR_INVALID Invalid parameters
1079  * \retval 1 box is pinned up
1080  * \retval 0 box is not pinned up
1081  * \see livebox_set_pinup
1082  */
1083 extern int livebox_is_pinned_up(struct livebox *handler);
1084
1085 /*!
1086  * \brief Check the PINUP feature availability of the given handler
1087  * \details N/A
1088  * \remarks N/A
1089  * \param[in] handler Handler of a livebox instance
1090  * \return int
1091  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1092  * \retval 1 if the box support Pinup feature
1093  * \retval 0 if the box does not support the Pinup feature
1094  * \pre N/A
1095  * \post N/A
1096  * \see livebox_is_pinned_up
1097  * \see livebox_set_pinup
1098  */
1099 extern int livebox_has_pinup(struct livebox *handler);
1100
1101 /*!
1102  * \brief Check the PD existence of given handler
1103  * \details N/A
1104  * \remarks N/A
1105  * \param[in] handler Handler of a livebox instance
1106  * \return int
1107  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1108  * \retval 1 if the box support the PD
1109  * \retval 0 if the box has no PD
1110  * \pre N/A
1111  * \post N/A
1112  * \see N/A
1113  */
1114 extern int livebox_has_pd(struct livebox *handler);
1115
1116 /*!
1117  * \brief Create the PD of given handler
1118  * \details N/A
1119  * \remarks N/A
1120  * \param[in] handler Handler of a livebox instance
1121  * \param[in] cb Result callback
1122  * \param[in] data Callback data
1123  * \return int
1124  * \retval LB_STATUS_SUCCESS Successfully done
1125  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1126  * \retval LB_STATUS_ERROR_BUSY Previous operation is not finished yet
1127  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1128  * \pre N/A
1129  * \post N/A
1130  * \see ret_cb_t
1131  * \see livebox_create_pd_with_position
1132  * \see livebox_move_pd
1133  * \see livebox_destroy_pd
1134  */
1135 extern int livebox_create_pd(struct livebox *handler, ret_cb_t cb, void *data);
1136
1137 /*!
1138  * \brief Create the PD of given handler with the relative position from livebox
1139  * \details N/A
1140  * \remarks N/A
1141  * \param[in] handler Handler of a livebox instance
1142  * \param[in] x 0.0 ~ 1.0
1143  * \param[in] y 0.0 ~ 1.0
1144  * \param[in] cb Result callback
1145  * \param[in] data Callback data
1146  * \return int
1147  * \retval LB_STATUS_SUCCESS Successfully done
1148  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1149  * \retval LB_STATUS_ERROR_BUSY Previous operation is not finished yet
1150  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1151  * \pre N/A
1152  * \post N/A
1153  * \see livebox_create_pd
1154  * \see livebox_destroy_pd
1155  * \see livebox_move_pd
1156  */
1157 extern int livebox_create_pd_with_position(struct livebox *handler, double x, double y, ret_cb_t cb, void *data);
1158
1159 /*!
1160  * \brief PD position is updated.
1161  * \details N/A
1162  * \remarks N/A
1163  * \param[in] handler Handler of a livebox instance
1164  * \param[in] x 0.0 ~ 1.0
1165  * \param[in] y 0.0 ~ 1.0
1166  * \return int
1167  * \retval LB_STATUS_SUCCESS if succeed to send request for updating position of the PD.
1168  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1169  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1170  * \pre N/A
1171  * \post N/A
1172  * \see N/A
1173  */
1174 extern int livebox_move_pd(struct livebox *handler, double x, double y);
1175
1176 /*!
1177  * \brief Destroy the PD of given handler if it is created.
1178  * \details N/A
1179  * \remarks N/A
1180  * \param[in] handler Handler of a livebox instance
1181  * \param[in] cb
1182  * \param[in] data
1183  * \return int
1184  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1185  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1186  * \retval LB_STATUS_SUCCESS Successfully done
1187  * \pre N/A
1188  * \post N/A
1189  * \see ret_cb_t
1190  */
1191 extern int livebox_destroy_pd(struct livebox *handler, ret_cb_t cb, void *data);
1192
1193 /*!
1194  * \brief Check the create status of given livebox handler
1195  * \details N/A
1196  * \remarks N/A
1197  * \param[in] handler Handler of a livebox instance
1198  * \return int
1199  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1200  * \retval 0 PD is not created
1201  * \retval 1 PD is created
1202  */
1203 extern int livebox_pd_is_created(struct livebox *handler);
1204
1205 /*!
1206  * \brief Check the content type of the progressive disclosure of given handler
1207  * \details N/A
1208  * \remarks N/A
1209  * \param[in] handler Handler of a livebox instance
1210  * \return int
1211  * \retval PD_TYPE_BUFFER Contents of a PD is based on canvas buffer(shared)
1212  * \retval PD_TYPE_TEXT Contents of a PD is based on formatted text file
1213  * \retval PD_TYPE_PIXMAP Contents of a livebox is shared by the pixmap(depends on X)
1214  * \retval PD_TYPE_INVALID
1215  * \pre N/A
1216  * \post N/A
1217  * \see livebox_pd_type
1218  */
1219 extern enum livebox_pd_type livebox_pd_type(struct livebox *handler);
1220
1221 /*!
1222  * \brief Check the existence of a livebox about given package name
1223  * \details N/A
1224  * \remarks N/A
1225  * \param[in] pkgname
1226  * \return int
1227  * \retval 1 if the box is exists
1228  * \retval 0 if the box is not exists
1229  * \pre N/A
1230  * \post N/A
1231  * \see N/A
1232  */
1233 extern int livebox_is_exists(const char *pkgname);
1234
1235 /*!
1236  * \brief Set function table for parsing the text content of a livebox
1237  * \details N/A
1238  * \remarks N/A
1239  * \param[in] handler Handler of a livebox instance
1240  * \param[in] ops
1241  * \return int
1242  * \retval LB_STATUS_SUCCESS Successfully done
1243  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1244  * \see livebox_set_pd_text_handler
1245  */
1246 extern int livebox_set_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
1247
1248 /*!
1249  * \brief Set function table for parsing the text content of a Progressive Disclosure
1250  * \details N/A
1251  * \remarks N/A
1252  * \param[in] handler Handler of a livebox instance
1253  * \param[in] ops
1254  * \return int
1255  * \retval LB_STATUS_SUCCESS Successfully done
1256  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1257  * \see livebox_set_text_handler
1258  */
1259 extern int livebox_set_pd_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
1260
1261 /*!
1262  * \brief Emit a text signal to given livebox only if it is a text type.
1263  * \details N/A
1264  * \remarks N/A
1265  * \param[in] handler Handler of a livebox instance
1266  * \param[in] emission Emission string
1267  * \param[in] source Source string
1268  * \param[in] sx start X
1269  * \param[in] sy start Y
1270  * \param[in] ex end X
1271  * \param[in] ey end Y
1272  * \param[in] cb Result callback
1273  * \param[in] data Callback data
1274  * \return int
1275  * \retval LB_STATUS_ERROR_INVALID Invalid parameters
1276  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1277  * \retval LB_STATUS_SUCCESS Successfully emitted
1278  * \see ret_cb_t
1279  */
1280 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);
1281
1282 /*!
1283  * \brief Set a private data pointer to carry it using given handler
1284  * \details N/A
1285  * \remarks N/A
1286  * \param[in] handler Handler of a livebox instance
1287  * \param[in] data data pointer
1288  * \return int
1289  * \retval LB_STATUS_SUCCESS Successfully registered
1290  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1291  * \pre N/A
1292  * \post N/A
1293  * \see livebox_get_data
1294  */
1295 extern int livebox_set_data(struct livebox *handler, void *data);
1296
1297 /*!
1298  * \brief Get private data pointer which is carried by given handler
1299  * \details N/A
1300  * \remarks N/A
1301  * \param[in] handler Handler of a livebox instance
1302  * \return void *
1303  * \retval data pointer
1304  * \retval NULL if there is not data
1305  * \pre N/A
1306  * \post N/A
1307  * \see livebox_set_data
1308  */
1309 extern void *livebox_get_data(struct livebox *handler);
1310
1311 /*!
1312  * \brief Subscribe the event for liveboxes only in given cluster and sub-cluster
1313  * \details
1314  *   If you wrote a view-only client.
1315  *   you can receive the event of specific liveboxes which are grouped in given cluster/category
1316  *   But you cannot modify their attributes (such as size, ...).
1317  * \remarks N/A
1318  * \param[in] cluster   "*" can be used for subscribe all cluster's liveboxes event.
1319  *                      If you use the "*", value in the category will be ignored.
1320  * \param[in] category  "*" can be used for subscribe liveboxes events of all category(sub-cluster) in given "cluster"
1321  * \return int
1322  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1323  * \retval LB_STATUS_SUCCESS Successfully requested
1324  * \pre N/A
1325  * \post N/A
1326  * \see livebox_unsubscribe_group
1327  */
1328 extern int livebox_subscribe_group(const char *cluster, const char *category);
1329
1330 /*!
1331  * \brief Unsubscribe the event for the liveboxes, but you will receive already added liveboxes event.
1332  * \details N/A
1333  * \remarks N/A
1334  * \param[in] cluster   "*" can be used for subscribe all cluster's liveboxes event.
1335  *                      If you use the "*", value in the category will be ignored.
1336  * \param[in] category  "*" can be used for subscribe all sub-cluster's liveboxes event in given "cluster"
1337  * \return int
1338  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1339  * \retval LB_STATUS_SUCCESS Successfully requested
1340  * \pre N/A
1341  * \post N/A
1342  * \see livebox_subscribe_group
1343  */
1344 extern int livebox_unsubscribe_group(const char *cluster, const char *category);
1345
1346 /*!
1347  * \brief Refresh the group(cluster/sub-cluser(aka. category))
1348  * \details
1349  *    This function will trigger the update of all liveboxes in given cluster/category group
1350  * \remarks
1351  *    Basically default livebox system doesn't use the cluster/category concept.
1352  *    But you can use it. so if you decide to use it then you can trigger the update of all liveboxes in given group.
1353  * \param[in] cluster Cluster ID
1354  * \param[in] category Sub-cluster ID
1355  * \param[in] force 1 if the boxes should be updated even if they are paused
1356  * \return int
1357  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1358  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1359  * \retval LB_STATUS_SUCCESS Successfully requested
1360  * \pre N/A
1361  * \post N/A
1362  * \see livebox_refresh
1363  */
1364 extern int livebox_refresh_group(const char *cluster, const char *category, int force);
1365
1366 /*!
1367  * \brief Refresh a livebox
1368  * \details N/A
1369  * \remarks N/A
1370  * \param[in] handler Handler of a livebox instance
1371  * \param[in] force 1 if the box should be updated even if it is paused
1372  * \return int
1373  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1374  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1375  * \retval LB_STATUS_SUCCESS Successfully requested
1376  * \pre N/A
1377  * \post N/A
1378  * \see livebox_refresh_group
1379  */
1380 extern int livebox_refresh(struct livebox *handler, int force);
1381
1382 /*!
1383  * \brief Pixmap Id of a livebox content
1384  * \details
1385  *   This function doesn't guarantees the life-cycle of the pixmap.
1386  *   If the service provider destroy the pixmap, you will not know about it.
1387  *   So you should validate it before access it.
1388  * \remarks N/A
1389  * \param[in] handler Handler of a livebox instance
1390  * \return int
1391  * \retval 0 if the pixmap is not created
1392  * \retval pixmap Pixmap Id need to be casted to (unsigned int) type
1393  * \pre N/A
1394  * \post N/A
1395  * \see livebox_pd_pixmap
1396  */
1397 extern int livebox_lb_pixmap(const struct livebox *handler);
1398
1399 /*!
1400  * \brief Pixmap Id of a PD content
1401  * \details
1402  *   This function doesn't guarantees the life-cycle of the pixmap.
1403  *   If the service provider destroy the pixmap, you will not know about it.
1404  *   So you should validate it before access it.
1405  * \remarks N/A
1406  * \param[in] handler Handler of a livebox instance
1407  * \return int
1408  * \retval 0 if the pixmap is not created
1409  * \retval pixmap Pixmap Id need to be casted to (unsigned int) type
1410  * \pre N/A
1411  * \post N/A
1412  * \see livebox_lb_pixmap
1413  */
1414 extern int livebox_pd_pixmap(const struct livebox *handler);
1415
1416 /*!
1417  * \brief Acquire the pixmap of PD
1418  * \details
1419  *   After acquire the pixmap of PD, it will not be destroyed
1420  *   So if the new update is comming with new pixmap Id, you should release old pixmap manually
1421  * \remarks N/A
1422  * \param[in] handler Handler of a livebox instance.
1423  * \param[in] cb Result callback for acquiring request
1424  * \param[in] data Callback Data
1425  * \return int
1426  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1427  * \retval LB_STATUS_ERROR_FAULT Failed to send a request to the service provider or there is critical error that is unrecoverable
1428  * \retval LB_STATUS_SUCCESS Successfully requested to acquire the pixmap of PD
1429  * \pre N/A
1430  * \post N/A
1431  * \see livebox_release_pd_pixmap
1432  * \see livebox_acquire_lb_pixmap
1433  * \see ret_cb_t
1434  */
1435 extern int livebox_acquire_pd_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
1436
1437 /*!
1438  * \brief Release the acquired pixmap ID
1439  * \details N/A
1440  * \remarks N/A
1441  * \param[in] handler Handler of a livebox instance, This can be NULL, only if the handler is deleted.
1442  * \param[in] pixmap Pixmap Id to release it
1443  * \return int
1444  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1445  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1446  * \retval LB_STATUS_SUCCESS Successfully released (request is sent)
1447  * \pre N/A
1448  * \post N/A
1449  * \see livebox_acquire_pd_pixmap
1450  * \see livebox_release_lb_pixmap
1451  */
1452 extern int livebox_release_pd_pixmap(struct livebox *handler, int pixmap);
1453
1454 /*!
1455  * \brief Getting the PIXMAP of a livebox
1456  * \details
1457  *   Even if the render process release the pixmap, the pixmap will be kept before released by livebox_release_lb_pixmap
1458  *   You should release the pixmap manually.
1459  * \remarks N/A
1460  * \param[in] handler Handler of a livebox instance
1461  * \param[in] cb Callback function which will be called with result of acquiring lb pixmap
1462  * \param[in] data Callback data
1463  * \return int
1464  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1465  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1466  * \retval LB_STATUS_SUCCESS Successfully requested
1467  * \pre
1468  *   Livebox service system should support the PIXMAP type buffer.
1469  *   The livebox should be designed to use the buffer (script type)
1470  * \post N/A
1471  * \see livebox_release_lb_pixmap
1472  * \see livebox_acquire_pd_pixmap
1473  * \see ret_cb_t
1474  */
1475 extern int livebox_acquire_lb_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
1476
1477 /*!
1478  * \brief Release the pixmap of a livebox
1479  * \details
1480  *   After the client gets new pixmap or no more need to keep current pixmap, use this to release it.
1481  *   If there is no user for given pixmap, the pixmap will be destroyed.
1482  * \remarks N/A
1483  * \param[in] handler Handler of a livebox instance, This can be NULL, only if the handler is deleted.
1484  * \param[in] pixmap Pixmap Id of given livebox handler
1485  * \return int
1486  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1487  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1488  * \retval LB_STATUS_SUCCESS Successfully done
1489  * \pre
1490  *   The pixmap should be acquired by livebox_acquire_lb_pixmap
1491  * \post N/A
1492  * \see livebox_acquire_lb_pixmap
1493  * \see livebox_release_pd_pixmap
1494  */
1495 extern int livebox_release_lb_pixmap(struct livebox *handler, int pixmap);
1496
1497 /*!
1498  * \brief Update the visible state of a livebox
1499  * \details N/A
1500  * \remarks N/A
1501  * \param[in] handler Handler of a livebox instance
1502  * \param[in] state Configure the current visible state of a livebox
1503  * \return int
1504  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1505  * \retval LB_STATUS_ERROR_BUSY
1506  * \retval LB_STATUS_ERROR_PERMISSION
1507  * \retval LB_STATUS_ERROR_ALREADY
1508  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1509  * \retval LB_STATUS_SUCCESS Successfully done
1510  * \pre N/A
1511  * \post N/A
1512  * \see N/A
1513  */
1514 extern int livebox_set_visibility(struct livebox *handler, enum livebox_visible_state state);
1515
1516 /*!
1517  * \brief Current visible state of a livebox
1518  * \details N/A
1519  * \remarks N/A
1520  * \param[in] handler Handler of a livebox instance
1521  * \return livebox_visible_state
1522  * \retval LB_SHOW Livebox is showed. Default state
1523  * \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
1524  * \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
1525  * \retval LB_VISIBLE_ERROR To enlarge the size of this enumeration type
1526  * \pre N/A
1527  * \post N/A
1528  * \see N/A
1529  */
1530 extern enum livebox_visible_state livebox_visibility(struct livebox *handler);
1531
1532 /*!
1533  * \brief Set the update mode of current livebox
1534  * \details N/A
1535  * \remarks N/A
1536  *        if you set 1 for active update mode, you should get buffer without updated event from provider.
1537  *        But is passive mode, you have to update content of a box when you get updated event.
1538  *        Default is Passive mode.
1539  * \param[in] handler Handler of a livebox instance
1540  * \param[in] active_update 1 means active update, 0 means passive update (default)
1541  * \param[in] cb Result callback function
1542  * \param[in] data Callback data
1543  * \return int
1544  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1545  * \retval LB_STATUS_ERROR_BUSY
1546  * \retval LB_STATUS_ERROR_PERMISSION
1547  * \retval LB_STATUS_ERROR_ALREADY
1548  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1549  * \retval LB_STATUS_SUCCESS Successfully done
1550  * \pre N/A
1551  * \post N/A
1552  * \see ret_cb_t
1553  */
1554 extern int livebox_set_update_mode(struct livebox *handler, int active_update, ret_cb_t cb, void *data);
1555
1556 /*!
1557  * \brief Is this box in the active update mode?
1558  * \details N/A
1559  * \remarks N/A
1560  * \param[in] handler Handler of a livebox instance
1561  * \return int
1562  * \retval 0 if passive mode
1563  * \retval 1 if active mode or error code
1564  * \pre N/A
1565  * \post N/A
1566  * \see N/A
1567  */
1568 extern int livebox_is_active_update(struct livebox *handler);
1569
1570 /*!
1571  * \brief Sync manually
1572  * \details N/A
1573  * \remarks N/A
1574  * param[in] handler Handler of a livebox instance
1575  * \return void
1576  * \retval LB_STATUS_SUCCESS If success
1577  * \retval LB_STATUS_ERROR_INVALID Invalid handle
1578  * \pre N/A
1579  * \post N/A
1580  * \see livebox_set_manual_sync
1581  * \see livebox_manual_sync
1582  * \see livebox_sync_lb_fb
1583  */
1584 extern int livebox_sync_pd_fb(struct livebox *handler);
1585
1586 /*!
1587  * \brief Sync manually
1588  * \details N/A
1589  * \remarks N/A
1590  * \param[in] handler Handler of a livebox instance
1591  * \return void
1592  * \retval LB_STATUS_SUCCESS If success
1593  * \retval LB_STATUS_ERROR_INVALID Invalid handle
1594  * \pre N/A
1595  * \post N/A
1596  * \see livebox_set_manual_sync
1597  * \see livebox_manual_sync
1598  * \see livebox_sync_pd_fb
1599  */
1600 extern int livebox_sync_lb_fb(struct livebox *handler);
1601
1602 /*!
1603  * \brief Getting the alternative icon of given livebox instance.
1604  * \details If the box should be represented as a shortcut icon, this function will get the alternative icon.
1605  * \remarks N/A
1606  * \param[in] handler Handler of a livebox instance
1607  * \return const char *
1608  * \retval address Absolute path of an alternative icon file
1609  * \retval NULL Livebox has no alternative icon file
1610  * \pre N/A
1611  * \post N/A
1612  * \see livebox_alt_name
1613  */
1614 extern const char *livebox_alt_icon(struct livebox *handler);
1615
1616 /*!
1617  * \brief Getting the alternative name of given livebox instance.
1618  * \details If the box should be represented as a shortcut name, this function will get the alternative name.
1619  * \remarks N/A
1620  * \param[in] handler Handler of a livebox instance
1621  * \return const char *
1622  * \retval name Alternative name of a livebox
1623  * \retval NULL Livebox has no alternative name
1624  * \pre N/A
1625  * \post N/A
1626  * \see livebox_alt_icon
1627  */
1628 extern const char *livebox_alt_name(struct livebox *handler);
1629
1630 /*!
1631  * \brief Get the lock for frame buffer.
1632  * \details
1633  *   This function should be used to prevent from rendering to the frame buffer while reading it.
1634  *   And the locking area should be short and must be released ASAP
1635  *   Or the render thread will be hang'd.
1636  * \remarks
1637  * \param[in] handler Handler of a livebox instance
1638  * \param[in] is_pd 1 for PD or 0
1639  * \return int
1640  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1641  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1642  * \retval LB_STATUS_SUCCESS Successfully done
1643  * \pre N/A
1644  * \post N/A
1645  * \see livebox_release_fb_lock
1646  */
1647 extern int livebox_acquire_fb_lock(struct livebox *handler, int is_pd);
1648
1649 /*!
1650  * \brief Release the lock of frame buffer
1651  * \details
1652  *   This function should be called ASAP after acquire a lock of FB.
1653  *   Or the render process will be blocked.
1654  * \remarks N/A
1655  * \param[in] handler Handler of a livebox instance
1656  * \param[in] is_pd 1 for PD or 0
1657  * \return int
1658  * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1659  * \retval LB_STATUS_ERROR_INVALID Invalid argument
1660  * \retval LB_STATUS_SUCCESS Successfully done
1661  * \pre N/A
1662  * \post N/A
1663  * \see livebox_acquire_fb_lock
1664  */
1665 extern int livebox_release_fb_lock(struct livebox *handler, int is_pd);
1666
1667 /*!
1668  * \brief Set options for controlling livebox sub-system.
1669  * \details
1670  *   LB_OPTION_FRAME_DROP_FOR_RESIZE
1671  *     While resizing the box, viewer doesn't want to know the updated frames of old size content anymore,
1672  *     In that case, turn this on, the provider will not send the updated event to the viewer about old content.
1673  *     So the viewer can reduce its burden to update unnecessary frames
1674  *   LB_OPTION_MANUAL_SYNC
1675  *     If you don't want updates frame automatically,
1676  *     Only you want reload the frames by your hands,(manually)
1677  *     Turn it on.
1678  *     After turnned it on, you should sync it using
1679  *       livebox_sync_pd_fb
1680  *       livebox_sync_lb_pfb
1681  *   LB_OPTION_SHARED_CONTENT
1682  *     If this option is turnned on, even though you create a new livebox,
1683  *     If there are already added same instance has same content, the instance will not be created again
1684  *     Instead of creating a new instance, viewer will provides old instance with new handle.
1685  * \remarks N/A
1686  * \param[in] option option which will be affected by this call
1687  * \param[in] state new value for given option
1688  * \return int
1689  * \retval LB_STATUS_ERROR_INVALID Unknown option
1690  * \retval LB_STATUS_ERROR_FAULT Failed to change the state of option
1691  * \retval LB_STATUS_SUCCESS Successfully changed
1692  * \pre N/A
1693  * \post N/A
1694  * \see livebox_get_option
1695  * \see livebox_sync_pd_fb
1696  * \see livebox_sync_lb_fb
1697  */
1698 extern int livebox_set_option(enum livebox_option_type option, int state);
1699
1700 /*!
1701  * \brief Get options livebox sub-system
1702  * \details N/A
1703  * \remarks N/A
1704  * \param[in] option type of option
1705  * \return int
1706  * \retval LB_STATUS_ERROR_INVALID invalid option
1707  * \retval LB_STATUS_ERROR_FAULT Failed to get option
1708  * \retval >=0 Value of given option. must has to be >=0
1709  * \pre N/A
1710  * \post N/A
1711  * \see livebox_set_option
1712  */
1713 extern int livebox_option(enum livebox_option_type option);
1714
1715
1716 /*!
1717  * \brief Set a handler for launching an app for auto-launch feature
1718  * \details If a user clicks a box, and the box uses auto-launch option, the launcher_handler will be called.
1719  * \remarks N/A
1720  * \param[in] launch_handler Handler for launching an app manually
1721  * \param[in] data Callback data which will be given a data for launch_handler
1722  * \return int
1723  * \retval
1724  * \pre N/A
1725  * \post N/A
1726  * \see N/A
1727  */
1728 extern int livebox_set_auto_launch_handler(int (*launch_handler)(struct livebox *handler, const char *appid, void *data), void *data);
1729
1730 /*!
1731  * \}
1732  */
1733
1734 #ifdef __cplusplus
1735 }
1736 #endif
1737
1738 #endif