2 * Copyright 2013 Samsung Electronics Co., Ltd
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
8 * http://floralicense.org/license/
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.
25 * \addtogroup CAPI_LIVEBOX_VIEWER_MODULE
31 * Structure for a Livebox instance
37 * Use the default update period which is defined in the package manifest file of a livebox.
39 #define DEFAULT_PERIOD -1.0f
43 * Mouse & Key event for buffer type Livebox or PD
44 * Viewer should send these events to livebox.
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 */
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 */
62 CONTENT_EVENT_KEY_MASK = 0x80000000,
63 CONTENT_EVENT_MOUSE_MASK = 0x20000000,
64 CONTENT_EVENT_PD_MASK = 0x10000000,
65 CONTENT_EVENT_LB_MASK = 0x40000000,
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 */
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 */
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 */
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 */
97 CONTENT_EVENT_MAX = 0xFFFFFFFF
102 * Accessibility event for buffer type Livebox or PD.
103 * These event set are sync'd with Tizen accessibility event set.
105 enum access_event_type {
106 ACCESS_EVENT_PD_MASK = 0x10000000,
107 ACCESS_EVENT_LB_MASK = 0x20000000,
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 */
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 */
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 */
145 * Livebox LB content type
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) */
153 LB_TYPE_INVALID = 0xFF
158 * Livebox PD content type
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) */
165 PD_TYPE_INVALID = 0xFF
170 * Livebox event type.
171 * These event will be sent from the provider.
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 */
177 LB_EVENT_CREATED, /*!< A new livebox is created */
178 LB_EVENT_DELETED, /*!< A livebox is deleted */
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 */
184 LB_EVENT_LB_SIZE_CHANGED, /*!< Livebox size is changed */
185 LB_EVENT_PD_SIZE_CHANGED, /*!< PD size is changed */
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 */
190 LB_EVENT_HOLD_SCROLL, /*!< If the screen should be freezed */
191 LB_EVENT_RELEASE_SCROLL, /*!< If the screen can be scrolled */
193 LB_EVENT_LB_UPDATE_BEGIN, /*!< Livebox LB content update is started */
194 LB_EVENT_LB_UPDATE_END, /*!< Livebox LB content update is finished */
196 LB_EVENT_PD_UPDATE_BEGIN, /*!< Livebox PD content update is started */
197 LB_EVENT_PD_UPDATE_END, /*!< Livebox PD content update is finished */
199 LB_EVENT_UPDATE_MODE_CHANGED, /*!< Livebox Update mode is changed */
201 LB_EVENT_REQUEST_CLOSE_PD, /*!< Livebox requests to close the PD */
203 LB_EVENT_IGNORED /*!< Request is ignored */
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 */
211 LB_OPTION_ERROR = 0xFFFFFFFF /*!< To specify the size of this enumeration type */
214 enum livebox_fault_type {
215 LB_FAULT_DEACTIVATED, /*!< Livebox is deactivated by its fault operation */
216 LB_FAULT_PROVIDER_DISCONNECTED /*!< Provider is disconnected */
221 * Must be sync'd with the provider
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. */
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 */
229 LB_VISIBLE_ERROR = 0xFFFFFFFF /*!< To specify the size of this enumeration type */
234 * TEXT type livebox contents handling opertators.
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 */
242 * Listed functions will be called when parser meets each typed content
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 */
257 * \brief Prototype of the return callback of every async functions
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
267 * \see livebox_add_with_size
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
283 typedef void (*ret_cb_t)(struct livebox *handle, int ret, void *data);
286 * \brief Initialize the livebox system
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
295 * \retval LB_STATUS_SUCCESS if success
299 * \see livebox_init_with_options
301 extern int livebox_init(void *disp);
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
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
320 extern int livebox_init_with_options(void *disp, int prevent_overwrite, double event_filter, int use_thread);
323 * \brief Finalize the livebox system
327 * \retval LB_STATUS_SUCCES if success
328 * \retval LB_STATUS_ERROR_INVALID if livebox_init is not called.
332 * \see livebox_init_with_options
334 extern int livebox_fini(void);
337 * \brief Notify the status of client to the provider. "it is paused".
341 * \retval LB_STATUS_SUCCESS if success
342 * \retval LB_STATUS_ERROR_FAULT if it failed to send state(paused) info
345 * \see livebox_client_resumed
347 extern int livebox_client_paused(void);
350 * \brief Notify the status of client to the provider. "it is resumed".
354 * \retval LB_STATUS_SUCCESS if success
355 * \retval LB_STATUS_ERROR_FAULT if it failed to send state(resumed) info
358 * \see livebox_client_paused
360 extern int livebox_client_resumed(void);
363 * \brief Add a new livebox
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
377 * \retval NULL if it fails to add a new instance
378 * \retval handle livebox handle
382 * \see livebox_add_with_size
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);
387 * \brief Add a new livebox
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)
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
403 * 4x3=712x533, LB_SIZE_TYPE_4x3
404 * 4x5=712x891, LB_SIZE_TYPE_4x5
405 * 4x6=712x1070, LB_SIZE_TYPE_4x6
408 * 21x21=224x215, LB_SIZE_TYPE_EASY_1x1
409 * 23x21=680x215, LB_SIZE_TYPE_EASY_3x1
410 * 23x23=680x653, LB_SIZE_TYPE_EASY_3x3
413 * 0x0=720x1280, LB_SIZE_TYPE_0x0
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.
428 * \retval handle Livebox handle but not yet initialized
429 * \retval NULL if it fails to create a handle
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);
436 * \brief Delete a livebox (deprecated)
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
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
453 extern int livebox_del(struct livebox *handler, ret_cb_t cb, void *data);
456 * \brief Delete a livebox (will be replaced with livebox_del)
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
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
474 extern int livebox_del_NEW(struct livebox *handler, int type, ret_cb_t cb, void *data);
477 * \brief Set a livebox events callback
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.
482 * \param[in] cb Event handler
483 * \param[in] data User data for the event handler
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
490 * \see livebox_unset_event_handler
492 extern int livebox_set_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data), void *data);
495 * \brief Unset the livebox event handler
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
503 * \see livebox_set_event_handler
505 extern void *livebox_unset_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data));
508 * \brief Live box fault event handler registeration function
510 * event, pkgname, filename, funcname
513 * \param[in] cb Event handler
514 * \param[in] data Event handler data
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
521 * \see livebox_unset_fault_handler
523 extern int livebox_set_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *), void *data);
526 * \brief Unset the live box fault event handler
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
534 * \see livebox_set_fault_handler
536 extern void *livebox_unset_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *));
539 * \brief Activate the faulted livebox.
541 * Request result will be back via return callback.
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
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
556 extern int livebox_activate(const char *pkgname, ret_cb_t cb, void *data);
559 * \brief Resize the livebox
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
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
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
579 * Special mode livebox size
580 * 0x0=720x1280, LB_SIZE_TYPE_0x0
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
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
597 extern int livebox_resize(struct livebox *handler, int type, ret_cb_t cb, void *data);
600 * \brief Send the click event for a livebox.
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.
607 * \retval LB_STATUS_ERROR_INVALID Invalid argument
608 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
609 * \retval LB_STATUS_SUCCESS Successfully done
614 extern int livebox_click(struct livebox *handler, double x, double y);
617 * \brief Change the cluster/sub-cluster name of given livebox handler
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
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.
635 extern int livebox_set_group(struct livebox *handler, const char *cluster, const char *category, ret_cb_t cb, void *data);
638 * \brief Get the cluster and category(sub-cluster) name of given livebox (It is not I18N format, only english)
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
647 * \retval LB_STATUS_ERROR_INVALID Invalid argument
648 * \retval LB_STATUS_SUCCESS Successfully done
653 extern int livebox_get_group(struct livebox *handler, const char **cluster, const char **category);
656 * \brief Get the period of this livebox handler
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
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.
670 extern double livebox_period(struct livebox *handler);
673 * \brief Change the update period
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
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
690 extern int livebox_set_period(struct livebox *handler, double period, ret_cb_t cb, void *data);
693 * \brief Is this an text type livebox?
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
705 * \see livebox_lb_type
707 extern enum livebox_lb_type livebox_lb_type(struct livebox *handler);
710 * \brief Is this livebox is created by a user?
712 * If the livebox instance is created by system this will returns 0.
714 * \param[in] handler Handler of a livebox instance
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
722 * \see livebox_add_with_size
723 * \see livebox_set_event_handler
725 extern int livebox_is_user(struct livebox *handler);
728 * \brief Get the content information string of given livebox
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.
737 * \see livebox_add_with_size
739 extern const char *livebox_content(struct livebox *handler);
742 * \brief Get the sub cluster title string of given livebox
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.
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
759 extern const char *livebox_category_title(struct livebox *handler);
762 * \brief Get the filename of given livebox, if it is an IMAGE type livebox
764 * If the box is developed as image format to represent its contents,
765 * The homescreen should know its image file name.
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.
775 extern const char *livebox_filename(struct livebox *handler);
778 * \brief Get the package name of given livebox handler
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
789 extern const char *livebox_pkgname(struct livebox *handler);
792 * \brief Get the priority of a current content.
795 * \param[in] handler Handler of a livebox instance
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
804 extern double livebox_priority(struct livebox *handler);
807 * \brief Acquire the buffer of given livebox (Only for the buffer type)
810 * \param[in] handler Handler of a livebox instance
812 * \retval address of a FB
813 * \retval NULL if it fails to get fb address
818 extern void *livebox_acquire_fb(struct livebox *handler);
821 * \brief Release the buffer of a livebox (Only for the buffer type)
826 * \retval LB_STATUS_ERROR_INVALID Invalid argument
827 * \retval LB_STATUS_SUCCESS Successfully done
830 * \see livebox_acquire_fb
832 extern int livebox_release_fb(void *buffer);
835 * \brief Get the reference count of Livebox buffer (Only for the buffer type)
840 * \retval LB_STATUS_ERROR_INVALID Invalid argument
841 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
842 * \retval refcnt positive integer including ZERO
845 * \see livebox_pdfb_refcnt
847 extern int livebox_fb_refcnt(void *buffer);
850 * \brief Acquire the buffer of a PD frame (Only for the buffer type)
853 * \param[in] handler Handler of a livebox instance
856 * \retval adress of buffer of PD
859 * \see livebox_release_pdfb
861 extern void *livebox_acquire_pdfb(struct livebox *handler);
864 * \brief Release the acquired buffer of the PD Frame (Only for the buffer type)
869 * \retval LB_STATUS_ERROR_INVALID Invalid argument
870 * \retval LB_STATUS_SUCCESS Successfully done
873 * \see livebox_acquire_pdfb
875 extern int livebox_release_pdfb(void *buffer);
878 * \brief Reference count of given PD buffer (Only for the buffer type)
883 * \retval LB_STATUS_ERROR_INVALID Invalid argument
884 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
885 * \retval reference count
888 * \see livebox_fb_refcnt
890 extern int livebox_pdfb_refcnt(void *buffer);
893 * \brief Get the size of the Livebox
896 * \param[in] handler Handler of a livebox instance
898 * \retval LB_SIZE_TYPE_NxM
899 * \retval LB_SIZE_TYPE_INVALID
904 extern int livebox_size(struct livebox *handler);
907 * \brief Get the size of the Progressive Disclosure
910 * \param[in] handler Handler of a livebox instance
914 * \retval LB_STATUS_ERROR_INVALID Invalid argument
915 * \retval LB_STATUS_SUCCESS Successfully done
920 extern int livebox_get_pdsize(struct livebox *handler, int *w, int *h);
923 * \brief List of supported sizes of given handler
926 * \param[in] handler Handler of a livebox instance
928 * \param[out] size_list
930 * \retval LB_STATUS_ERROR_INVALID Invalid argument
931 * \retval LB_STATUS_SUCCESS Successfully done
936 extern int livebox_get_supported_sizes(struct livebox *handler, int *cnt, int *size_list);
939 * \brief BUFFER SIZE of the livebox if it is a buffer type
942 * \param[in] handler Handler of a livebox instance
944 * \retval LB_STATUS_ERROR_INVALID Invalid argument
945 * \retval size of livebox buffer
950 extern int livebox_lbfb_bufsz(struct livebox *handler);
953 * \brief BUFFER SIZE of the progiressive disclosure if it is a buffer type
956 * \param[in] handler Handler of a livebox instance
958 * \retval LB_STATUS_ERROR_INVALID Invalid argument
959 * \retval size of PD buffer
964 extern int livebox_pdfb_bufsz(struct livebox *handler);
967 * \brief Send the content event (for buffer type) to provider(livebox)
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
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
982 * \see livebox_mouse_event
983 * \see livebox_access_event
984 * \see livebox_key_event
986 extern int livebox_content_event(struct livebox *handler, enum content_event_type type, double x, double y);
989 * \brief Send the content event (for buffer type) to provider(livebox)
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
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
1003 * \see livebox_content_event
1004 * \see livebox_access_event
1005 * \see livebox_key_event
1007 extern int livebox_mouse_event(struct livebox *handler, enum content_event_type type, double x, double y);
1010 * \brief Send the access event(for buffer type) to provider(livebox).
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
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
1026 * \see livebox_mouse_event
1027 * \see livebox_key_event
1029 extern int livebox_access_event(struct livebox *handler, enum access_event_type type, double x, double y, ret_cb_t cb, void *data);
1032 * \brief Send the key event(for buffer type) to provider(livebox).
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
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
1047 * \see livebox_mouse_event
1048 * \see livebox_access_event
1050 extern int livebox_key_event(struct livebox *handler, enum content_event_type type, unsigned int keycode, ret_cb_t cb, void *data);
1053 * \brief Do pin up or not.
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.
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
1065 * \retval LB_STATUS_ERROR_INVALID Invalid parameters
1067 * \see livebox_set_visibility
1068 * \see livebox_is_pinned_up
1070 extern int livebox_set_pinup(struct livebox *handler, int flag, ret_cb_t cb, void *data);
1073 * \brief Check the PIN-UP status of given handler
1076 * \param[in] handler Handler of a livebox instance
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
1083 extern int livebox_is_pinned_up(struct livebox *handler);
1086 * \brief Check the PINUP feature availability of the given handler
1089 * \param[in] handler Handler of a livebox instance
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
1096 * \see livebox_is_pinned_up
1097 * \see livebox_set_pinup
1099 extern int livebox_has_pinup(struct livebox *handler);
1102 * \brief Check the PD existence of given handler
1105 * \param[in] handler Handler of a livebox instance
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
1114 extern int livebox_has_pd(struct livebox *handler);
1117 * \brief Create the PD of given handler
1120 * \param[in] handler Handler of a livebox instance
1121 * \param[in] cb Result callback
1122 * \param[in] data Callback data
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
1131 * \see livebox_create_pd_with_position
1132 * \see livebox_move_pd
1133 * \see livebox_destroy_pd
1135 extern int livebox_create_pd(struct livebox *handler, ret_cb_t cb, void *data);
1138 * \brief Create the PD of given handler with the relative position from livebox
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
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
1153 * \see livebox_create_pd
1154 * \see livebox_destroy_pd
1155 * \see livebox_move_pd
1157 extern int livebox_create_pd_with_position(struct livebox *handler, double x, double y, ret_cb_t cb, void *data);
1160 * \brief PD position is updated.
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
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
1174 extern int livebox_move_pd(struct livebox *handler, double x, double y);
1177 * \brief Destroy the PD of given handler if it is created.
1180 * \param[in] handler Handler of a livebox instance
1184 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1185 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1186 * \retval LB_STATUS_SUCCESS Successfully done
1191 extern int livebox_destroy_pd(struct livebox *handler, ret_cb_t cb, void *data);
1194 * \brief Check the create status of given livebox handler
1197 * \param[in] handler Handler of a livebox instance
1199 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1200 * \retval 0 PD is not created
1201 * \retval 1 PD is created
1203 extern int livebox_pd_is_created(struct livebox *handler);
1206 * \brief Check the content type of the progressive disclosure of given handler
1209 * \param[in] handler Handler of a livebox instance
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
1217 * \see livebox_pd_type
1219 extern enum livebox_pd_type livebox_pd_type(struct livebox *handler);
1222 * \brief Check the existence of a livebox about given package name
1225 * \param[in] pkgname
1227 * \retval 1 if the box is exists
1228 * \retval 0 if the box is not exists
1233 extern int livebox_is_exists(const char *pkgname);
1236 * \brief Set function table for parsing the text content of a livebox
1239 * \param[in] handler Handler of a livebox instance
1242 * \retval LB_STATUS_SUCCESS Successfully done
1243 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1244 * \see livebox_set_pd_text_handler
1246 extern int livebox_set_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
1249 * \brief Set function table for parsing the text content of a Progressive Disclosure
1252 * \param[in] handler Handler of a livebox instance
1255 * \retval LB_STATUS_SUCCESS Successfully done
1256 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1257 * \see livebox_set_text_handler
1259 extern int livebox_set_pd_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
1262 * \brief Emit a text signal to given livebox only if it is a text type.
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
1275 * \retval LB_STATUS_ERROR_INVALID Invalid parameters
1276 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1277 * \retval LB_STATUS_SUCCESS Successfully emitted
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);
1283 * \brief Set a private data pointer to carry it using given handler
1286 * \param[in] handler Handler of a livebox instance
1287 * \param[in] data data pointer
1289 * \retval LB_STATUS_SUCCESS Successfully registered
1290 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1293 * \see livebox_get_data
1295 extern int livebox_set_data(struct livebox *handler, void *data);
1298 * \brief Get private data pointer which is carried by given handler
1301 * \param[in] handler Handler of a livebox instance
1303 * \retval data pointer
1304 * \retval NULL if there is not data
1307 * \see livebox_set_data
1309 extern void *livebox_get_data(struct livebox *handler);
1312 * \brief Subscribe the event for liveboxes only in given cluster and sub-cluster
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, ...).
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"
1322 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1323 * \retval LB_STATUS_SUCCESS Successfully requested
1326 * \see livebox_unsubscribe_group
1328 extern int livebox_subscribe_group(const char *cluster, const char *category);
1331 * \brief Unsubscribe the event for the liveboxes, but you will receive already added liveboxes event.
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"
1338 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1339 * \retval LB_STATUS_SUCCESS Successfully requested
1342 * \see livebox_subscribe_group
1344 extern int livebox_unsubscribe_group(const char *cluster, const char *category);
1347 * \brief Refresh the group(cluster/sub-cluser(aka. category))
1349 * This function will trigger the update of all liveboxes in given cluster/category group
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
1357 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1358 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1359 * \retval LB_STATUS_SUCCESS Successfully requested
1362 * \see livebox_refresh
1364 extern int livebox_refresh_group(const char *cluster, const char *category, int force);
1367 * \brief Refresh a livebox
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
1373 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1374 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1375 * \retval LB_STATUS_SUCCESS Successfully requested
1378 * \see livebox_refresh_group
1380 extern int livebox_refresh(struct livebox *handler, int force);
1383 * \brief Pixmap Id of a livebox content
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.
1389 * \param[in] handler Handler of a livebox instance
1391 * \retval 0 if the pixmap is not created
1392 * \retval pixmap Pixmap Id need to be casted to (unsigned int) type
1395 * \see livebox_pd_pixmap
1397 extern int livebox_lb_pixmap(const struct livebox *handler);
1400 * \brief Pixmap Id of a PD content
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.
1406 * \param[in] handler Handler of a livebox instance
1408 * \retval 0 if the pixmap is not created
1409 * \retval pixmap Pixmap Id need to be casted to (unsigned int) type
1412 * \see livebox_lb_pixmap
1414 extern int livebox_pd_pixmap(const struct livebox *handler);
1417 * \brief Acquire the pixmap of PD
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
1422 * \param[in] handler Handler of a livebox instance.
1423 * \param[in] cb Result callback for acquiring request
1424 * \param[in] data Callback Data
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
1431 * \see livebox_release_pd_pixmap
1432 * \see livebox_acquire_lb_pixmap
1435 extern int livebox_acquire_pd_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
1438 * \brief Release the acquired pixmap ID
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
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)
1449 * \see livebox_acquire_pd_pixmap
1450 * \see livebox_release_lb_pixmap
1452 extern int livebox_release_pd_pixmap(struct livebox *handler, int pixmap);
1455 * \brief Getting the PIXMAP of a livebox
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.
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
1464 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1465 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1466 * \retval LB_STATUS_SUCCESS Successfully requested
1468 * Livebox service system should support the PIXMAP type buffer.
1469 * The livebox should be designed to use the buffer (script type)
1471 * \see livebox_release_lb_pixmap
1472 * \see livebox_acquire_pd_pixmap
1475 extern int livebox_acquire_lb_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
1478 * \brief Release the pixmap of a livebox
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.
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
1486 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1487 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1488 * \retval LB_STATUS_SUCCESS Successfully done
1490 * The pixmap should be acquired by livebox_acquire_lb_pixmap
1492 * \see livebox_acquire_lb_pixmap
1493 * \see livebox_release_pd_pixmap
1495 extern int livebox_release_lb_pixmap(struct livebox *handler, int pixmap);
1498 * \brief Update the visible state of a livebox
1501 * \param[in] handler Handler of a livebox instance
1502 * \param[in] state Configure the current visible state of a livebox
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
1514 extern int livebox_set_visibility(struct livebox *handler, enum livebox_visible_state state);
1517 * \brief Current visible state of a livebox
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
1530 extern enum livebox_visible_state livebox_visibility(struct livebox *handler);
1533 * \brief Set the update mode of current livebox
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
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
1554 extern int livebox_set_update_mode(struct livebox *handler, int active_update, ret_cb_t cb, void *data);
1557 * \brief Is this box in the active update mode?
1560 * \param[in] handler Handler of a livebox instance
1562 * \retval 0 if passive mode
1563 * \retval 1 if active mode or error code
1568 extern int livebox_is_active_update(struct livebox *handler);
1571 * \brief Sync manually
1574 * param[in] handler Handler of a livebox instance
1576 * \retval LB_STATUS_SUCCESS If success
1577 * \retval LB_STATUS_ERROR_INVALID Invalid handle
1580 * \see livebox_set_manual_sync
1581 * \see livebox_manual_sync
1582 * \see livebox_sync_lb_fb
1584 extern int livebox_sync_pd_fb(struct livebox *handler);
1587 * \brief Sync manually
1590 * \param[in] handler Handler of a livebox instance
1592 * \retval LB_STATUS_SUCCESS If success
1593 * \retval LB_STATUS_ERROR_INVALID Invalid handle
1596 * \see livebox_set_manual_sync
1597 * \see livebox_manual_sync
1598 * \see livebox_sync_pd_fb
1600 extern int livebox_sync_lb_fb(struct livebox *handler);
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.
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
1612 * \see livebox_alt_name
1614 extern const char *livebox_alt_icon(struct livebox *handler);
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.
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
1626 * \see livebox_alt_icon
1628 extern const char *livebox_alt_name(struct livebox *handler);
1631 * \brief Get the lock for frame buffer.
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.
1637 * \param[in] handler Handler of a livebox instance
1638 * \param[in] is_pd 1 for PD or 0
1640 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1641 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1642 * \retval LB_STATUS_SUCCESS Successfully done
1645 * \see livebox_release_fb_lock
1647 extern int livebox_acquire_fb_lock(struct livebox *handler, int is_pd);
1650 * \brief Release the lock of frame buffer
1652 * This function should be called ASAP after acquire a lock of FB.
1653 * Or the render process will be blocked.
1655 * \param[in] handler Handler of a livebox instance
1656 * \param[in] is_pd 1 for PD or 0
1658 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1659 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1660 * \retval LB_STATUS_SUCCESS Successfully done
1663 * \see livebox_acquire_fb_lock
1665 extern int livebox_release_fb_lock(struct livebox *handler, int is_pd);
1668 * \brief Set options for controlling livebox sub-system.
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)
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.
1686 * \param[in] option option which will be affected by this call
1687 * \param[in] state new value for given option
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
1694 * \see livebox_get_option
1695 * \see livebox_sync_pd_fb
1696 * \see livebox_sync_lb_fb
1698 extern int livebox_set_option(enum livebox_option_type option, int state);
1701 * \brief Get options livebox sub-system
1704 * \param[in] option type of option
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
1711 * \see livebox_set_option
1713 extern int livebox_option(enum livebox_option_type option);
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.
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
1728 extern int livebox_set_auto_launch_handler(int (*launch_handler)(struct livebox *handler, const char *appid, void *data), void *data);