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 livebox package manifest.
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 = 0x00100000, /*!< LB key press */
56 CONTENT_EVENT_KEY_UP = 0x00200000, /*!< LB key release */
58 CONTENT_EVENT_KEY_MASK = 0x80000000,
59 CONTENT_EVENT_MOUSE_MASK = 0x20000000,
60 CONTENT_EVENT_PD_MASK = 0x10000000,
61 CONTENT_EVENT_LB_MASK = 0x40000000,
63 LB_MOUSE_DOWN = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_DOWN, /*!< Mouse down on the livebox */
64 LB_MOUSE_UP = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UP, /*!< Mouse up on the livebox */
65 LB_MOUSE_MOVE = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_MOVE, /*!< Move move on the livebox */
66 LB_MOUSE_ENTER = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_ENTER, /*!< Mouse enter to the livebox */
67 LB_MOUSE_LEAVE = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_LEAVE, /*!< Mouse leave from the livebox */
68 LB_MOUSE_SET = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_SET,
69 LB_MOUSE_UNSET = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UNSET,
71 PD_MOUSE_DOWN = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_DOWN, /*!< Mouse down on the PD */
72 PD_MOUSE_UP = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UP, /*!< Mouse up on the PD */
73 PD_MOUSE_MOVE = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_MOVE, /*!< Mouse move on the PD */
74 PD_MOUSE_ENTER = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_ENTER, /*!< Mouse enter to the PD */
75 PD_MOUSE_LEAVE = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_LEAVE, /*!< Mouse leave from the PD */
76 PD_MOUSE_SET = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_SET,
77 PD_MOUSE_UNSET = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UNSET,
79 LB_KEY_DOWN = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_DOWN, /*!< Key down on the livebox */
80 LB_KEY_UP = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_UP, /*!< Key up on the livebox */
82 PD_KEY_DOWN = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_DOWN, /*!< Key down on the livebox */
83 PD_KEY_UP = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_UP, /*!< Key up on the livebox */
85 CONTENT_EVENT_MAX = 0xFFFFFFFF
90 * Accessibility event for buffer type Livebox or PD.
91 * These event set are sync'd with Tizen accessibility event set.
93 enum access_event_type {
94 ACCESS_EVENT_PD_MASK = 0x10000000,
95 ACCESS_EVENT_LB_MASK = 0x20000000,
97 ACCESS_EVENT_HIGHLIGHT = 0x00000100, /*!< LB accessibility: Hightlight a object */
98 ACCESS_EVENT_HIGHLIGHT_NEXT = 0x00000200, /*!< LB accessibility: Set highlight to next object */
99 ACCESS_EVENT_HIGHLIGHT_PREV = 0x00000400, /*!< LB accessibility: Set highlight to prev object */
100 ACCESS_EVENT_UNHIGHLIGHT = 0x00000800, /*!< LB accessibility unhighlight */
101 ACCESS_EVENT_ACTIVATE = 0x00001000, /*!< LB accessibility activate */
102 ACCESS_EVENT_ACTION_DOWN = 0x00010000, /*!< LB accessibility value changed */
103 ACCESS_EVENT_ACTION_UP = 0x00020000, /*!< LB accessibility value changed */
104 ACCESS_EVENT_SCROLL_DOWN = 0x00100000, /*!< LB accessibility scroll down */
105 ACCESS_EVENT_SCROLL_MOVE = 0x00200000, /*!< LB accessibility scroll move */
106 ACCESS_EVENT_SCROLL_UP = 0x00400000, /*!< LB accessibility scroll up */
108 LB_ACCESS_HIGHLIGHT = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_HIGHLIGHT, /*!< Access event - Highlight an object in the livebox */
109 LB_ACCESS_HIGHLIGHT_NEXT = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_HIGHLIGHT_NEXT, /*!< Access event - Move highlight to the next object in a livebox */
110 LB_ACCESS_HIGHLIGHT_PREV = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_HIGHLIGHT_PREV, /*!< Access event - Move highlight to the prev object in a livebox */
111 LB_ACCESS_UNHIGHLIGHT = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_UNHIGHLIGHT, /*!< Access event - Delete highlight from the livebox */
112 LB_ACCESS_ACTIVATE = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_ACTIVATE, /*!< Access event - Launch or activate the highlighted object */
113 LB_ACCESS_ACTION_DOWN = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_ACTION_DOWN, /*!< Access event - down */
114 LB_ACCESS_ACTION_UP = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_ACTION_UP, /*!< Access event - up */
115 LB_ACCESS_SCROLL_DOWN = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_SCROLL_DOWN, /*!< Access event - scroll down */
116 LB_ACCESS_SCROLL_MOVE = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_SCROLL_MOVE, /*!< Access event - scroll move */
117 LB_ACCESS_SCROLL_UP = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_SCROLL_UP, /*!< Access event - scroll up */
119 PD_ACCESS_HIGHLIGHT = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_HIGHLIGHT,
120 PD_ACCESS_HIGHLIGHT_NEXT = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_HIGHLIGHT_NEXT,
121 PD_ACCESS_HIGHLIGHT_PREV = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_HIGHLIGHT_PREV,
122 PD_ACCESS_UNHIGHLIGHT = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_UNHIGHLIGHT,
123 PD_ACCESS_ACTIVATE = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_ACTIVATE,
124 PD_ACCESS_ACTION_DOWN = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_ACTION_DOWN,
125 PD_ACCESS_ACTION_UP = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_ACTION_UP,
126 PD_ACCESS_SCROLL_DOWN = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_SCROLL_DOWN,
127 PD_ACCESS_SCROLL_MOVE = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_SCROLL_MOVE,
128 PD_ACCESS_SCROLL_UP = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_SCROLL_UP
133 * Livebox LB content type
135 enum livebox_lb_type {
136 LB_TYPE_IMAGE = 0x01, /*!< Contents of a livebox is based on the image file */
137 LB_TYPE_BUFFER = 0x02, /*!< Contents of a livebox is based on canvas buffer(shared) */
138 LB_TYPE_TEXT = 0x04, /*!< Contents of a livebox is based on formatted text file */
139 LB_TYPE_PIXMAP = 0x08, /*!< Contens of a livebox is shared by the pixmap(depends on X) */
141 LB_TYPE_INVALID = 0xFF
146 * Livebox PD content type
148 enum livebox_pd_type {
149 PD_TYPE_BUFFER = 0x01, /*!< Contents of a PD is based on canvas buffer(shared) */
150 PD_TYPE_TEXT = 0x02, /*!< Contents of a PD is based on formatted text file */
151 PD_TYPE_PIXMAP = 0x04, /*!< Contents of a livebox is shared by the pixmap(depends on X) */
153 PD_TYPE_INVALID = 0xFF
158 * Livebox event type.
159 * These event will be sent from the provider.
161 enum livebox_event_type { /*!< livebox_event_handler_set Event list */
162 LB_EVENT_LB_UPDATED, /*!< Contents of the given livebox is updated */
163 LB_EVENT_PD_UPDATED, /*!< Contents of the given pd is updated */
165 LB_EVENT_CREATED, /*!< A new livebox is created */
166 LB_EVENT_DELETED, /*!< A livebox is deleted */
168 LB_EVENT_GROUP_CHANGED, /*!< Group (Cluster/Sub-cluster) information is changed */
169 LB_EVENT_PINUP_CHANGED, /*!< PINUP status is changed */
170 LB_EVENT_PERIOD_CHANGED, /*!< Update period is changed */
172 LB_EVENT_LB_SIZE_CHANGED, /*!< Livebox size is changed */
173 LB_EVENT_PD_SIZE_CHANGED, /*!< PD size is changed */
175 LB_EVENT_PD_CREATED, /*!< If a PD is created even if you didn't call the livebox_create_pd API */
176 LB_EVENT_PD_DESTROYED, /*!< If a PD is destroyed even if you didn't call the livebox_destroy_pd API */
178 LB_EVENT_HOLD_SCROLL, /*!< If the screen should be freezed */
179 LB_EVENT_RELEASE_SCROLL, /*!< If the screen can be scrolled */
181 LB_EVENT_LB_UPDATE_BEGIN, /*!< Livebox LB content update is started */
182 LB_EVENT_LB_UPDATE_END, /*!< Livebox LB content update is finished */
184 LB_EVENT_PD_UPDATE_BEGIN, /*!< Livebox PD content update is started */
185 LB_EVENT_PD_UPDATE_END, /*!< Livebox PD content update is finished */
187 LB_EVENT_UPDATE_MODE_CHANGED, /*!< Livebox Update mode is changed */
189 LB_EVENT_IGNORED /*!< Request is ignored */
192 enum livebox_fault_type {
193 LB_FAULT_DEACTIVATED, /*!< Livebox is deactivated by its fault operation */
194 LB_FAULT_PROVIDER_DISCONNECTED /*!< Provider is disconnected */
199 * Must be sync'd with the provider
201 enum livebox_visible_state {
202 LB_SHOW = 0x00, /*!< Livebox is showed. Default state */
203 LB_HIDE = 0x01, /*!< Livebox is hide, Update timer is not be freezed. but you cannot receive any updates events. you should refresh(reload) the content of a livebox when you make this show again */
205 LB_HIDE_WITH_PAUSE = 0x02, /*!< Livebix is hide, it will paused the update timer, but if a livebox update its contents, update event will come to you */
207 LB_VISIBLE_ERROR = 0xFFFFFFFF /* To enlarge the size of this enumeration type */
212 * TEXT type livebox contents handling opertators.
214 struct livebox_script_operators {
215 int (*update_begin)(struct livebox *handle); /*!< Content parser is started */
216 int (*update_end)(struct livebox *handle); /*!< Content parser is stopped */
220 * Listed functions will be called when parser meets each typed component
222 int (*update_text)(struct livebox *handle, const char *id, const char *part, const char *data); /*!< Update text content */
223 int (*update_image)(struct livebox *handle, const char *id, const char *part, const char *data, const char *option); /*!< Update image content */
224 int (*update_script)(struct livebox *handle, const char *id, const char *part, const char *file, const char *group); /*!< Update script content */
225 int (*update_signal)(struct livebox *handle, const char *id, const char *emission, const char *signal); /*!< Update signal */
226 int (*update_drag)(struct livebox *handle, const char *id, const char *part, double dx, double dy); /*!< Update drag info */
227 int (*update_info_size)(struct livebox *handle, const char *id, int w, int h); /*!< Update content size */
228 int (*update_info_category)(struct livebox *handle, const char *id, const char *category); /*!< Update content category info */
232 * \brief Prototype of the return callback of every async functions
235 * \param[in] handle Handle of the livebox instance
236 * \param[in] ret Result status of operation. LB_STATUS_XXX defined from liblivebox-service
237 * \param[in] data data for result callback
242 * \see livebox_add_with_size
244 * \see livebox_activate
245 * \see livebox_resize
246 * \see livebox_set_group
247 * \see livebox_set_period
248 * \see livebox_access_event
249 * \see livebox_set_pinup
250 * \see livebox_create_pd
251 * \see livebox_create_pd_with_position
252 * \see livebox_destroy_pd
253 * \see livebox_emit_text_signal
254 * \see livebox_acquire_pd_pixmap
255 * \see livebox_acquire_lb_pixmap
256 * \see livebox_set_update_mode
258 typedef void (*ret_cb_t)(struct livebox *handle, int ret, void *data);
261 * \brief Initialize the livebox system
264 * \param[in] disp If you have X Display connection object, you can re-use it. but you should care its life cycle.
265 * It must be alive before call the livebox_fini
267 * \retval LB_STATUS_SUCCESS if success
272 extern int livebox_init(void *disp);
275 * \brief Initialize the livebox system with some options
276 * \details livebox_init function uses environment value to initiate some configurable values
277 * But some application doesn't want to use the env value.
278 * For them, this API will give a chance to set default options using given arguments
281 * \param[in] prevent_overwrite
282 * \param[in] event_filter
284 * \retval LB_STATUS_SUCCESS if success
290 extern int livebox_init_with_options(void *disp, int prevent_overwrite, double event_filter);
293 * \brief Finalize the livebox system
297 * \retval LB_STATUS_SUCCES if success
298 * \retval LB_STATUS_ERROR_INVALID if livebox_init is not called.
303 extern int livebox_fini(void);
306 * \brief Client is paused.
310 * \retval LB_STATUS_SUCCESS if success
311 * \retval LB_STATUS_ERROR_FAULT if it failed to send state(paused) info
314 * \see livebox_client_resumed
316 extern int livebox_client_paused(void);
319 * \brief Client is rfesumed.
323 * \retval LB_STATUS_SUCCESS if success
324 * \retval LB_STATUS_ERROR_FAULT if it failed to send state(resumed) info
327 * \see livebox_client_paused
329 extern int livebox_client_resumed(void);
332 * \brief Add a new livebox
335 * Even though you get the livebox handle from return value of this function,
336 * it is not matured before return callback called.
337 * You have to use the handle after get the return callback with "ret == LB_STATUS_SUCCESS"
338 * \param[in] pkgname Livebox Id
339 * \param[in] content Will be passed to the livebox instance.
340 * \param[in] cluster Main group
341 * \param[in] category Sub group
342 * \param[in] period Update period. if you set DEFAULT_PERIOD, the provider will use the default period which is described in the manifest.
343 * \param[in] cb After send the request to the provider, its result will be passed
346 * \retval NULL if it fails to add a new instance
347 * \retval handle livebox handle
351 * \see livebox_add_with_size
353 extern struct livebox *livebox_add(const char *pkgname, const char *content, const char *cluster, const char *category, double period, ret_cb_t cb, void *data);
356 * \brief Add a new livebox
358 * Normal mode livebox
379 * Even if you get the handle by return value of this function, it is not created instance.
380 * So you have to deal it as not initialized handle.
381 * Only it can be initialized after get the return callback with "ret == LB_STATUS_SUCCESS".
382 * \param[in] pkgname Livebox Id
383 * \param[in] content Will be passed to the livebox instance.
384 * \param[in] cluster Main group
385 * \param[in] category Sub group
386 * \param[in] period DEFAULT_PERIOD can be used for this. this argument will be used to specify the period of update content of livebox.
387 * \param[in] type Size type - which are defined from liblivebox-service package.
388 * \param[in] cb After the request is sent to the master provider, this callback will be called.
389 * \param[in] data This data will be passed to the callback.
391 * \retval handle Livebox handle but not yet initialized
392 * \retval NULL if it fails to create a handle
396 extern struct livebox *livebox_add_with_size(const char *pkgname, const char *content, const char *cluster, const char *category, double period, int type, ret_cb_t cb, void *data);
399 * \brief Delete a livebox
402 * If you call this with uninitialized handle, the return callback will be called synchronously.
403 * So before return from this function, the return callback will be called first.
404 * \param[in] handler Handle of a livebox instance
405 * \param[in] cb return callback
406 * \param[in] data user data for return callback
408 * \retval LB_STATUS_ERROR_INVALID Invalid argument
409 * \retval LB_STATUS_ERROR_BUSY already in process
410 * \retval LB_STATUS_ERROR_FAULT failed to create a request packet
411 * \retval LB_STATUS_SUCCESS successfully sent, return callack will be called
416 extern int livebox_del(struct livebox *handler, ret_cb_t cb, void *data);
419 * \brief Set a livebox events callback
421 * To get the events push from the provider, register the event callback using this function
422 * The callback will be called if there is any events from the provider.
424 * \param[in] cb Event handler
425 * \param[in] data User data for the event handler
427 * \retval LB_STATUS_SUCCESS if succeed to set event handler
428 * \retval LB_STATUS_ERROR_INVALID Invalid argument
429 * \retval LB_STATUS_ERROR_MEMORY Not enough memory
432 * \see livebox_unset_event_handler
434 extern int livebox_set_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data), void *data);
437 * \brief Unset the livebox event handler
442 * \retval pointer of 'data' which is used with the livebox_set_event_handler
445 * \see livebox_set_event_handler
447 extern void *livebox_unset_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data));
450 * \brief Live box fault event handler registeration function
452 * event, pkgname, filename, funcname
458 * \retval LB_STATUS_SUCCESS if succeed to set fault event handler
459 * \retval LB_STATUS_ERROR_INVALID Invalid argument
460 * \retval LB_STATUS_ERROR_MEMORY Not enough memory
463 * \see livebox_unset_fault_handler
465 extern int livebox_set_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *), void *data);
468 * \brief Unset the live box fault event handler
473 * \retval pointer of 'data' which is used with the livebox_set_fault_handler
476 * \see livebox_set_fault_handler
478 extern void *livebox_unset_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *));
481 * \brief Activate the faulted livebox.
483 * Request result will be back via return callback.
485 * Even though this function returns SUCCESS, it means just successfully sent a request to provider.
486 * So you have to check the return callback. and its "ret" argument.
491 * \retval LB_STATUS_SUCCESS Successfully sent a request
492 * \retval LB_STATUS_ERROR_INVALID Invalid argument
493 * \retval LB_STATUS_ERROR_FAULT Failed to make a request
498 extern int livebox_activate(const char *pkgname, ret_cb_t cb, void *data);
501 * \brief Resize the livebox
503 * Normal mode livebox size
511 * Extended livebox size
516 * Easy mode livebox size
521 * Special mode livebox size
524 * You have to check the return callback.
525 * \param[in] handler Handler of a livebox
526 * \param[in] type Type of a livebox size, LB_SIZE_TYPE_1x1, ...
527 * \param[in] cb Result callback of the resize operation.
528 * \param[in] data User data for return callback
530 * \retval LB_STATUS_ERROR_INVALID Invalid argument
531 * \retval LB_STATUS_ERROR_BUSY Previous request of resize is in progress.
532 * \retval LB_STATUS_ERROR_ALREADY Already resized, there is no differences between current size and requested size.
533 * \retval LB_STATUS_ERROR_PERMISSION Permission denied, you only have view the content of this box.
534 * \retval LB_STATUS_ERROR_FAULT Failed to make a request
539 extern int livebox_resize(struct livebox *handler, int type, ret_cb_t cb, void *data);
542 * \brief Send the click event for a livebox.
545 * \param[in] handler Handler of a livebox
546 * \param[in] x Rational X of the content width.
547 * \param[in] y Rational Y of the content height.
549 * \retval LB_STATUS_ERROR_INVALID
550 * \retval LB_STATUS_ERROR_FAULT
551 * \retval LB_STATUS_SUCCESS
556 extern int livebox_click(struct livebox *handler, double x, double y);
559 * \brief Change the cluster/sub-cluster name of given livebox handler
562 * \param[in] handler Handler of a livebox
563 * \param[in] cluster New cluster of a livebox
564 * \param[in] category New category of a livebox
565 * \param[in] cb Result callback for changing the cluster/category of a livebox
566 * \param[in] data User data for the result callback
568 * \retval LB_STATUS_SUCCESS Request is successfully sent. the return callback will be called.
569 * \retval LB_STATUS_ERROR_BUSY previous request is not finished yet.
570 * \retval LB_STATUS_ERROR_ALREADY group name is same with current one.
571 * \retval LB_STATUS_ERROR_PERMISSION you have no permission to change property of this livebox instance.
572 * \retval LB_STATUS_ERROR_FAULT Failed to make a request.
577 extern int livebox_set_group(struct livebox *handler, const char *cluster, const char *category, ret_cb_t cb, void *data);
580 * \brief Get the cluster and category(sub-cluster) name of given livebox (It is not I18N format, only english)
583 * You have to do not release the cluster & category.
584 * It is allocated inside of given livebox instance, so you can only read it.
585 * \param[in] handler Handler of a livebox
586 * \param[out] cluster Storage(memory) for containing the cluster name
587 * \param[out] category Storage(memory) for containing the category name
589 * \retval LB_STATUS_ERROR_INVALID
590 * \retval LB_STATUS_SUCCESS
595 extern int livebox_get_group(struct livebox *handler, char ** const cluster, char ** const category);
598 * \brief Get the period of this livebox handler
601 * if this function returns 0.0f, it means the livebox has no update period.
602 * or the handle is not valid.
603 * This function only can be works after the return callback of livebox_create fucntion is called.
604 * \param[in] handler Handler of a livebox
606 * \retval Current update period of a livebox
607 * \retval 0.0f it means the box has no update period, or it can returns 0.0 if the handles is not valid.
612 extern double livebox_period(struct livebox *handler);
615 * \brief Change the update period
618 * \param[in] handler Handler of a livebox
619 * \param[in] period New update period of a livebox
620 * \param[in] cb Result callback of changing the update period of this livebox
621 * \param[in] data User data for the result callback
623 * \retval LB_STATUS_SUCCESS
624 * \retval LB_STATUS_ERROR_INVALID
625 * \retval LB_STATUS_ERROR_BUSY
626 * \retval LB_STATUS_ERROR_ALREADY
627 * \retval LB_STATUS_ERROR_FAULT
632 extern int livebox_set_period(struct livebox *handler, double period, ret_cb_t cb, void *data);
635 * \brief Is this an text type livebox?
639 * \return livebox_lb_type
640 * \retval LB_TYPE_IMAGE Contents of a livebox is based on the image file
641 * \retval LB_TYPE_BUFFER Contents of a livebox is based on canvas buffer(shared)
642 * \retval LB_TYPE_TEXT Contents of a livebox is based on formatted text file
643 * \retval LB_TYPE_PIXMAP Contens of a livebox is shared by the pixmap(depends on X)
644 * \retval LB_TYPE_INVALID
647 * \see livebox_lb_type
649 extern enum livebox_lb_type livebox_lb_type(struct livebox *handler);
652 * \brief Is this livebox is created by a user?
654 * If the livebox instance is created by system this will returns 0.
658 * \retval LB_STATUS_ERROR_INVALID Invalid argument
659 * \retval 0 automatically created livebox by the provider
660 * \retval 1 created by user via livebox_add or livebox_add_with_size
664 * \see livebox_add_with_size
665 * \see livebox_set_event_handler
667 extern int livebox_is_user(struct livebox *handler);
670 * \brief Get the content information string of given livebox
675 * \retval content_info Livebox content info that can be used again via content_info argument of livebox_add or livebox_add_with_size.
679 * \see livebox_add_with_size
681 extern const char *livebox_content(struct livebox *handler);
684 * \brief Get the sub cluster title string of given livebox
688 * \return const char *
689 * \retval sub cluster name
695 extern const char *livebox_category_title(struct livebox *handler);
698 * \brief Get the filename of given livebox, if it is an IMAGE type livebox
702 * \return const char *
703 * \retval filename if the livebox type is image this function will give you a abspath of an image file (content is rendered)
704 * \retval NULL if this has no image file or type is not image file.
709 extern const char *livebox_filename(struct livebox *handler);
712 * \brief Get the package name of given livebox handler
716 * \return const char *
717 * \retval pkgname package name
718 * \retval NULL if the handler is not valid
723 extern const char *livebox_pkgname(struct livebox *handler);
726 * \brief Get the priority of a current content.
731 * \retval 0.0f handler is NULL
732 * \retval -1.0f Handler is not valid (not yet initialized)
733 * \retval real number between 0.0 and 1.0
738 extern double livebox_priority(struct livebox *handler);
741 * \brief Acquire the buffer of given livebox (Only for the buffer type)
746 * \retval address of a FB
747 * \retval NULL if it fails to get fb address
752 extern void *livebox_acquire_fb(struct livebox *handler);
755 * \brief Release the buffer of a livebox (Only for the buffer type)
760 * \retval LB_STATUS_ERROR_INVALID
761 * \retval LB_STATUS_SUCCESS
764 * \see livebox_acquire_fb
766 extern int livebox_release_fb(void *buffer);
769 * \brief Get the reference count of Livebox buffer (Only for the buffer type)
774 * \retval LB_STATUS_ERROR_INVALID
775 * \retval LB_STATUS_ERROR_FAULT
776 * \retval refcnt positive integer including ZERO
779 * \see livebox_pdfb_refcnt
781 extern int livebox_fb_refcnt(void *buffer);
784 * \brief Acquire the buffer of a PD frame (Only for the buffer type)
790 * \retval adress of buffer of PD
793 * \see livebox_release_pdfb
795 extern void *livebox_acquire_pdfb(struct livebox *handler);
798 * \brief Release the acquired buffer of the PD Frame (Only for the buffer type)
803 * \retval LB_STATUS_ERROR_INVALID
804 * \retval LB_STATUS_SUCCESS
807 * \see livebox_acquire_pdfb
809 extern int livebox_release_pdfb(void *buffer);
812 * \brief Reference count of given PD buffer (Only for the buffer type)
817 * \retval LB_STATUS_ERROR_INVALID
818 * \retval LB_STATUS_ERROR_FAULT
819 * \retval reference count
822 * \see livebox_fb_refcnt
824 extern int livebox_pdfb_refcnt(void *buffer);
827 * \brief Get the size of the Livebox
832 * \retval LB_SIZE_TYPE_NxM
833 * \retval LB_SIZE_TYPE_INVALID
838 extern int livebox_size(struct livebox *handler);
841 * \brief Get the size of the Progressive Disclosure
848 * \retval LB_STATUS_ERROR_INVALID
849 * \retval LB_STATUS_SUCCESS
854 extern int livebox_get_pdsize(struct livebox *handler, int *w, int *h);
857 * \brief List of supported sizes of given handler
862 * \param[out] size_list
864 * \retval LB_STATUS_ERROR_INVALID
865 * \retval LB_STATUS_SUCCESS
870 extern int livebox_get_supported_sizes(struct livebox *handler, int *cnt, int *size_list);
873 * \brief BUFFER SIZE of the livebox if it is a buffer type
878 * \retval LB_STATUS_ERROR_INVALID
879 * \retval size of livebox buffer
884 extern int livebox_lbfb_bufsz(struct livebox *handler);
887 * \brief BUFFER SIZE of the progiressive disclosure if it is a buffer type
892 * \retval LB_STATUS_ERROR_INVALID
893 * \retval size of PD buffer
898 extern int livebox_pdfb_bufsz(struct livebox *handler);
901 * \brief Send the content event (for buffer type) to provider(livebox)
909 * \retval LB_STATUS_ERROR_INVALID
910 * \retval LB_STATUS_ERROR_BUSY
911 * \retval LB_STATUS_ERROR_FAULT
912 * \retval LB_STATUS_SUCCESS
915 * \see livebox_access_event
917 extern int livebox_content_event(struct livebox *handler, enum content_event_type type, double x, double y);
920 * \brief Send the access event(for buffer type) to provider(livebox).
930 * \retval LB_STATUS_ERROR_INVALID
931 * \retval LB_STATUS_ERROR_BUSY
932 * \retval LB_STATUS_ERROR_FAULT
933 * \retval LB_STATUS_SUCCESS
936 * \see livebox_content_event
938 extern int livebox_access_event(struct livebox *handler, enum access_event_type type, double x, double y, ret_cb_t cb, void *data);
941 * \brief Do pin up or not.
949 * \retval LB_STATUS_ERROR_INVALID
950 * \retval 1 box is pinned up
951 * \retval 0 box is not pinned up
954 extern int livebox_set_pinup(struct livebox *handler, int flag, ret_cb_t cb, void *data);
957 * \brief Check the PIN-UP status of given handler
963 extern int livebox_is_pinned_up(struct livebox *handler);
966 * \brief Check the PINUP feature availability of the given handler
971 * \retval LB_STATUS_ERROR_INVALID
972 * \retval 1 if the box support Pinup feature
973 * \retval 0 if the box does not support the Pinup feature
978 extern int livebox_has_pinup(struct livebox *handler);
981 * \brief Check the PD existence of given handler
986 * \retval LB_STATUS_ERROR_INVALID
987 * \retval 1 if the box support the PD
988 * \retval 0 if the box has no PD
993 extern int livebox_has_pd(struct livebox *handler);
996 * \brief Create the PD of given handler
1003 * \retval LB_STATUS_SUCCESS
1004 * \retval LB_STATUS_ERROR_INVALID
1005 * \retval LB_STATUS_ERROR_BUSY
1006 * \retval LB_STATUS_ERROR_FAULT
1011 extern int livebox_create_pd(struct livebox *handler, ret_cb_t cb, void *data);
1014 * \brief Create the PD of given handler with the relative position from livebox
1017 * \param[in] handler
1018 * \param[in] x 0.0 ~ 1.0
1019 * \param[in] y 0.0 ~ 1.0
1023 * \retval LB_STATUS_SUCCESS
1024 * \retval LB_STATUS_ERROR_INVALID
1025 * \retval LB_STATUS_ERROR_BUSY
1026 * \retval LB_STATUS_ERROR_FAULT
1031 extern int livebox_create_pd_with_position(struct livebox *handler, double x, double y, ret_cb_t cb, void *data);
1034 * \brief PD position is updated.
1037 * \param[in] handler
1038 * \param[in] x 0.0 ~ 1.0
1039 * \param[in] y 0.0 ~ 1.0
1041 * \retval LB_STATUS_SUCCESS if succeed to send request for updating position of the PD.
1042 * \retval LB_STATUS_ERROR_FAULT
1043 * \retval LB_STATUS_ERROR_INVALID
1048 extern int livebox_move_pd(struct livebox *handler, double x, double y);
1051 * \brief Destroy the PD of given handler if it is created.
1054 * \param[in] handler
1058 * \retval LB_STATUS_ERROR_INVALID
1059 * \retval LB_STATUS_ERROR_FAULT
1060 * \retval LB_STATUS_SUCCESS
1065 extern int livebox_destroy_pd(struct livebox *handler, ret_cb_t cb, void *data);
1068 * \brief Check the create status of given livebox handler
1071 * \param[in] handler
1073 * \retval LB_STATUS_ERROR_INVALID
1074 * \retval 0 PD is not created
1075 * \retval 1 PD is created
1077 extern int livebox_pd_is_created(struct livebox *handler);
1080 * \brief Check the content type of the progressive disclosure of given handler
1083 * \param[in] handler
1085 * \retval PD_TYPE_BUFFER Contents of a PD is based on canvas buffer(shared)
1086 * \retval PD_TYPE_TEXT Contents of a PD is based on formatted text file
1087 * \retval PD_TYPE_PIXMAP Contents of a livebox is shared by the pixmap(depends on X)
1088 * \retval PD_TYPE_INVALID
1091 * \see livebox_pd_type
1093 extern enum livebox_pd_type livebox_pd_type(struct livebox *handler);
1096 * \brief Check the existence of a livebox about given package name
1099 * \param[in] pkgname
1101 * \retval 1 if the box is exists
1102 * \retval 0 if the box is not exists
1107 extern int livebox_is_exists(const char *pkgname);
1110 * \brief Set function table for parsing the text content of a livebox
1113 * \param[in] handler
1116 * \retval LB_STATUS_SUCCESS
1117 * \retval LB_STATUS_ERROR_INVALID
1118 * \see livebox_set_pd_text_handler
1120 extern int livebox_set_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
1123 * \brief Set function table for parsing the text content of a Progressive Disclosure
1126 * \param[in] handler
1129 * \retval LB_STATUS_SUCCESS
1130 * \retval LB_STATUS_ERROR_INVALID
1131 * \see livebox_set_text_handler
1133 extern int livebox_set_pd_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
1136 * \brief Emit a text signal to given livebox only if it is a text type.
1139 * \param[in] handler
1140 * \param[in] emission
1149 * \retval LB_STATUS_ERROR_INVALID
1150 * \retval LB_STATUS_ERROR_FAULT
1151 * \retval LB_STATUS_SUCCESS
1154 extern int livebox_emit_text_signal(struct livebox *handler, const char *emission, const char *source, double sx, double sy, double ex, double ey, ret_cb_t cb, void *data);
1157 * \brief Set a private data pointer to carry it using given handler
1160 * \param[in] handler
1163 * \retval LB_STATUS_SUCCESS
1164 * \retval LB_STATUS_ERROR_INVALID
1167 * \see livebox_get_data
1169 extern int livebox_set_data(struct livebox *handler, void *data);
1172 * \brief Get private data pointer which is carried by given handler
1175 * \param[in] handler
1177 * \retval data pointer
1180 * \see livebox_set_data
1182 extern void *livebox_get_data(struct livebox *handler);
1185 * \brief Subscribe the event for liveboxes only in given cluster and sub-cluster
1188 * \param[in] cluster "*" can be used for subscribe all cluster's liveboxes event.
1189 * If you use the "*", value in the category will be ignored.
1190 * \param[in] category "*" can be used for subscribe liveboxes events of all category(sub-cluster) in given "cluster"
1192 * \retval LB_STATUS_ERROR_FAULT
1193 * \retval LB_STATUS_SUCCESS
1196 * \see livebox_unsubscribe_group
1198 extern int livebox_subscribe_group(const char *cluster, const char *category);
1201 * \brief Unsubscribe the event for the liveboxes, but you will receive already added liveboxes event.
1204 * \param[in] cluster "*" can be used for subscribe all cluster's liveboxes event.
1205 * If you use the "*", value in the category will be ignored.
1206 * \param[in] category "*" can be used for subscribe all sub-cluster's liveboxes event in given "cluster"
1208 * \retval LB_STATUS_ERROR_FAULT
1209 * \retval LB_STATUS_SUCCESS
1212 * \see livebox_subscribe_group
1214 extern int livebox_unsubscribe_group(const char *cluster, const char *category);
1217 * \brief Refresh the group(cluster/sub-cluser(aka. category))
1220 * \param[in] cluster Cluster ID
1221 * \param[in] category Sub-cluster ID
1223 * \retval LB_STATUS_ERROR_INVALID
1224 * \retval LB_STATUS_ERROR_FAULT
1225 * \retval LB_STATUS_SUCCESS
1230 extern int livebox_refresh_group(const char *cluster, const char *category);
1233 * \brief Refresh a livebox
1236 * \param[in] handler
1238 * \retval LB_STATUS_ERROR_INVALID
1239 * \retval LB_STATUS_ERROR_FAULT
1240 * \retval LB_STATUS_SUCCESS
1245 extern int livebox_refresh(struct livebox *handler);
1248 * \brief Pixmap Id of a livebox content
1251 * \param[in] handler
1253 * \retval 0 if the pixmap is not created
1254 * \retval pixmap Pixmap Id need to be casted to (unsigned int) type
1257 * \see livebox_pd_pixmap
1259 extern int livebox_lb_pixmap(const struct livebox *handler);
1262 * \brief Pixmap Id of a PD content
1265 * \param[in] handler
1267 * \retval 0 if the pixmap is not created
1268 * \retval pixmap Pixmap Id need to be casted to (unsigned int) type
1271 * \see livebox_lb_pixmap
1273 extern int livebox_pd_pixmap(const struct livebox *handler);
1279 * \param[in] handler
1283 * \retval LB_STATUS_ERROR_INVALID
1284 * \retval LB_STATUS_ERROR_FAULT
1285 * \retval LB_STATUS_SUCCESS
1288 * \see livebox_release_pd_pixmap
1289 * \see livebox_acquire_lb_pixmap
1292 extern int livebox_acquire_pd_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
1295 * \brief Release the acquired pixmap ID
1298 * \param[in] handler
1301 * \retval LB_STATUS_ERROR_INVALID
1302 * \retval LB_STATUS_ERROR_FAULT
1303 * \retval LB_STATUS_SUCCESS
1306 * \see livebox_acquire_pd_pixmap
1307 * \see livebox_release_lb_pixmap
1309 extern int livebox_release_pd_pixmap(struct livebox *handler, int pixmap);
1315 * \param[in] handler
1319 * \retval LB_STATUS_ERROR_INVALID
1320 * \retval LB_STATUS_ERROR_FAULT
1321 * \retval LB_STATUS_SUCCESS
1324 * \see livebox_release_lb_pixmap
1325 * \see livebox_acquire_pd_pixmap
1328 extern int livebox_acquire_lb_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
1334 * \param[in] handler
1337 * \retval LB_STATUS_ERROR_INVALID
1338 * \retval LB_STATUS_ERROR_FAULT
1339 * \retval LB_STATUS_SUCCESS
1342 * \see livebox_acquire_lb_pixmap
1343 * \see livebox_release_pd_pixmap
1345 extern int livebox_release_lb_pixmap(struct livebox *handler, int pixmap);
1348 * \brief Update the visible state of a livebox
1351 * \param[in] handler Handler of a livebox
1352 * \param[in] state Configure the current visible state of a livebox
1354 * \retval LB_STATUS_ERROR_INVALID
1355 * \retval LB_STATUS_ERROR_BUSY
1356 * \retval LB_STATUS_ERROR_PERMISSION
1357 * \retval LB_STATUS_ERROR_ALREADY
1358 * \retval LB_STATUS_ERROR_FAULT
1359 * \retval LB_STATUS_SUCCESS
1364 extern int livebox_set_visibility(struct livebox *handler, enum livebox_visible_state state);
1367 * \brief Current visible state of a livebox
1370 * \param[in] handler Handler of a livebox
1371 * \return livebox_visible_state
1372 * \retval LB_SHOW Livebox is showed. Default state
1373 * \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
1374 * \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
1375 * \retval LB_VISIBLE_ERROR To enlarge the size of this enumeration type
1380 extern enum livebox_visible_state livebox_visibility(struct livebox *handler);
1383 * \brief Set the update mode of current livebox
1386 * if you set 1 for active update mode, you should get buffer without updated event from provider.
1387 * But is passive mode, you have to update content of a box when you get updated event.
1388 * Default is Passive mode.
1389 * \param[in] handler Handler of a livebox
1390 * \param[in] active_update 1 means active update, 0 means passive update (default)
1391 * \param[in] cb Result callback function
1392 * \param[in] data Callback data
1394 * \retval LB_STATUS_ERROR_INVALID
1395 * \retval LB_STATUS_ERROR_BUSY
1396 * \retval LB_STATUS_ERROR_PERMISSION
1397 * \retval LB_STATUS_ERROR_ALREADY
1398 * \retval LB_STATUS_ERROR_FAULT
1399 * \retval LB_STATUS_SUCCESS
1402 extern int livebox_set_update_mode(struct livebox *handler, int active_update, ret_cb_t cb, void *data);
1405 * \brief Is this box in the active update mode?
1408 * \param[in] handler HAndler of a livebox
1410 * \retval 0 if passive mode
1411 * \retval 1 if active mode or error code
1414 extern int livebox_is_active_update(struct livebox *handler);