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 Finalize the livebox system
279 * \retval LB_STATUS_SUCCES if success
280 * \retval LB_STATUS_ERROR_INVALID if livebox_init is not called.
285 extern int livebox_fini(void);
288 * \brief Client is paused.
292 * \retval LB_STATUS_SUCCESS if success
293 * \retval LB_STATUS_ERROR_FAULT if it failed to send state(paused) info
296 * \see livebox_client_resumed
298 extern int livebox_client_paused(void);
301 * \brief Client is rfesumed.
305 * \retval LB_STATUS_SUCCESS if success
306 * \retval LB_STATUS_ERROR_FAULT if it failed to send state(resumed) info
309 * \see livebox_client_paused
311 extern int livebox_client_resumed(void);
314 * \brief Add a new livebox
317 * Even though you get the livebox handle from return value of this function,
318 * it is not matured before return callback called.
319 * You have to use the handle after get the return callback with "ret == LB_STATUS_SUCCESS"
320 * \param[in] pkgname Livebox Id
321 * \param[in] content Will be passed to the livebox instance.
322 * \param[in] cluster Main group
323 * \param[in] category Sub group
324 * \param[in] period Update period. if you set DEFAULT_PERIOD, the provider will use the default period which is described in the manifest.
325 * \param[in] cb After send the request to the provider, its result will be passed
328 * \retval NULL if it fails to add a new instance
329 * \retval handle livebox handle
333 * \see livebox_add_with_size
335 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);
338 * \brief Add a new livebox
340 * Normal mode livebox
361 * Even if you get the handle by return value of this function, it is not created instance.
362 * So you have to deal it as not initialized handle.
363 * Only it can be initialized after get the return callback with "ret == LB_STATUS_SUCCESS".
364 * \param[in] pkgname Livebox Id
365 * \param[in] content Will be passed to the livebox instance.
366 * \param[in] cluster Main group
367 * \param[in] category Sub group
368 * \param[in] period DEFAULT_PERIOD can be used for this. this argument will be used to specify the period of update content of livebox.
369 * \param[in] type Size type - which are defined from liblivebox-service package.
370 * \param[in] cb After the request is sent to the master provider, this callback will be called.
371 * \param[in] data This data will be passed to the callback.
373 * \retval handle Livebox handle but not yet initialized
374 * \retval NULL if it fails to create a handle
378 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);
381 * \brief Delete a livebox
384 * If you call this with uninitialized handle, the return callback will be called synchronously.
385 * So before return from this function, the return callback will be called first.
386 * \param[in] handler Handle of a livebox instance
387 * \param[in] cb return callback
388 * \param[in] data user data for return callback
390 * \retval LB_STATUS_ERROR_INVALID Invalid argument
391 * \retval LB_STATUS_ERROR_BUSY already in process
392 * \retval LB_STATUS_ERROR_FAULT failed to create a request packet
393 * \retval LB_STATUS_SUCCESS successfully sent, return callack will be called
398 extern int livebox_del(struct livebox *handler, ret_cb_t cb, void *data);
401 * \brief Set a livebox events callback
403 * To get the events push from the provider, register the event callback using this function
404 * The callback will be called if there is any events from the provider.
406 * \param[in] cb Event handler
407 * \param[in] data User data for the event handler
409 * \retval LB_STATUS_SUCCESS if succeed to set event handler
410 * \retval LB_STATUS_ERROR_INVALID Invalid argument
411 * \retval LB_STATUS_ERROR_MEMORY Not enough memory
414 * \see livebox_unset_event_handler
416 extern int livebox_set_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data), void *data);
419 * \brief Unset the livebox event handler
424 * \retval pointer of 'data' which is used with the livebox_set_event_handler
427 * \see livebox_set_event_handler
429 extern void *livebox_unset_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data));
432 * \brief Live box fault event handler registeration function
434 * event, pkgname, filename, funcname
440 * \retval LB_STATUS_SUCCESS if succeed to set fault event handler
441 * \retval LB_STATUS_ERROR_INVALID Invalid argument
442 * \retval LB_STATUS_ERROR_MEMORY Not enough memory
445 * \see livebox_unset_fault_handler
447 extern int livebox_set_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *), void *data);
450 * \brief Unset the live box fault event handler
455 * \retval pointer of 'data' which is used with the livebox_set_fault_handler
458 * \see livebox_set_fault_handler
460 extern void *livebox_unset_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *));
463 * \brief Activate the faulted livebox.
465 * Request result will be back via return callback.
467 * Even though this function returns SUCCESS, it means just successfully sent a request to provider.
468 * So you have to check the return callback. and its "ret" argument.
473 * \retval LB_STATUS_SUCCESS Successfully sent a request
474 * \retval LB_STATUS_ERROR_INVALID Invalid argument
475 * \retval LB_STATUS_ERROR_FAULT Failed to make a request
480 extern int livebox_activate(const char *pkgname, ret_cb_t cb, void *data);
483 * \brief Resize the livebox
485 * Normal mode livebox size
493 * Extended livebox size
498 * Easy mode livebox size
503 * Special mode livebox size
506 * You have to check the return callback.
507 * \param[in] handler Handler of a livebox
508 * \param[in] type Type of a livebox size, LB_SIZE_TYPE_1x1, ...
509 * \param[in] cb Result callback of the resize operation.
510 * \param[in] data User data for return callback
512 * \retval LB_STATUS_ERROR_INVALID Invalid argument
513 * \retval LB_STATUS_ERROR_BUSY Previous request of resize is in progress.
514 * \retval LB_STATUS_ERROR_ALREADY Already resized, there is no differences between current size and requested size.
515 * \retval LB_STATUS_ERROR_PERMISSION Permission denied, you only have view the content of this box.
516 * \retval LB_STATUS_ERROR_FAULT Failed to make a request
521 extern int livebox_resize(struct livebox *handler, int type, ret_cb_t cb, void *data);
524 * \brief Send the click event for a livebox.
527 * \param[in] handler Handler of a livebox
528 * \param[in] x Rational X of the content width.
529 * \param[in] y Rational Y of the content height.
531 * \retval LB_STATUS_ERROR_INVALID
532 * \retval LB_STATUS_ERROR_FAULT
533 * \retval LB_STATUS_SUCCESS
538 extern int livebox_click(struct livebox *handler, double x, double y);
541 * \brief Change the cluster/sub-cluster name of given livebox handler
544 * \param[in] handler Handler of a livebox
545 * \param[in] cluster New cluster of a livebox
546 * \param[in] category New category of a livebox
547 * \param[in] cb Result callback for changing the cluster/category of a livebox
548 * \param[in] data User data for the result callback
550 * \retval LB_STATUS_SUCCESS Request is successfully sent. the return callback will be called.
551 * \retval LB_STATUS_ERROR_BUSY previous request is not finished yet.
552 * \retval LB_STATUS_ERROR_ALREADY group name is same with current one.
553 * \retval LB_STATUS_ERROR_PERMISSION you have no permission to change property of this livebox instance.
554 * \retval LB_STATUS_ERROR_FAULT Failed to make a request.
559 extern int livebox_set_group(struct livebox *handler, const char *cluster, const char *category, ret_cb_t cb, void *data);
562 * \brief Get the cluster and category(sub-cluster) name of given livebox (It is not I18N format, only english)
565 * You have to do not release the cluster & category.
566 * It is allocated inside of given livebox instance, so you can only read it.
567 * \param[in] handler Handler of a livebox
568 * \param[out] cluster Storage(memory) for containing the cluster name
569 * \param[out] category Storage(memory) for containing the category name
571 * \retval LB_STATUS_ERROR_INVALID
572 * \retval LB_STATUS_SUCCESS
577 extern int livebox_get_group(struct livebox *handler, char ** const cluster, char ** const category);
580 * \brief Get the period of this livebox handler
583 * if this function returns 0.0f, it means the livebox has no update period.
584 * or the handle is not valid.
585 * This function only can be works after the return callback of livebox_create fucntion is called.
586 * \param[in] handler Handler of a livebox
588 * \retval Current update period of a livebox
589 * \retval 0.0f it means the box has no update period, or it can returns 0.0 if the handles is not valid.
594 extern double livebox_period(struct livebox *handler);
597 * \brief Change the update period
600 * \param[in] handler Handler of a livebox
601 * \param[in] period New update period of a livebox
602 * \param[in] cb Result callback of changing the update period of this livebox
603 * \param[in] data User data for the result callback
605 * \retval LB_STATUS_SUCCESS
606 * \retval LB_STATUS_ERROR_INVALID
607 * \retval LB_STATUS_ERROR_BUSY
608 * \retval LB_STATUS_ERROR_ALREADY
609 * \retval LB_STATUS_ERROR_FAULT
614 extern int livebox_set_period(struct livebox *handler, double period, ret_cb_t cb, void *data);
617 * \brief Is this an text type livebox?
621 * \return livebox_lb_type
622 * \retval LB_TYPE_IMAGE Contents of a livebox is based on the image file
623 * \retval LB_TYPE_BUFFER Contents of a livebox is based on canvas buffer(shared)
624 * \retval LB_TYPE_TEXT Contents of a livebox is based on formatted text file
625 * \retval LB_TYPE_PIXMAP Contens of a livebox is shared by the pixmap(depends on X)
626 * \retval LB_TYPE_INVALID
629 * \see livebox_lb_type
631 extern enum livebox_lb_type livebox_lb_type(struct livebox *handler);
634 * \brief Is this livebox is created by a user?
636 * If the livebox instance is created by system this will returns 0.
640 * \retval LB_STATUS_ERROR_INVALID Invalid argument
641 * \retval 0 automatically created livebox by the provider
642 * \retval 1 created by user via livebox_add or livebox_add_with_size
646 * \see livebox_add_with_size
647 * \see livebox_set_event_handler
649 extern int livebox_is_user(struct livebox *handler);
652 * \brief Get the content information string of given livebox
657 * \retval content_info Livebox content info that can be used again via content_info argument of livebox_add or livebox_add_with_size.
661 * \see livebox_add_with_size
663 extern const char *livebox_content(struct livebox *handler);
666 * \brief Get the sub cluster title string of given livebox
670 * \return const char *
671 * \retval sub cluster name
677 extern const char *livebox_category_title(struct livebox *handler);
680 * \brief Get the filename of given livebox, if it is an IMAGE type livebox
684 * \return const char *
685 * \retval filename if the livebox type is image this function will give you a abspath of an image file (content is rendered)
686 * \retval NULL if this has no image file or type is not image file.
691 extern const char *livebox_filename(struct livebox *handler);
694 * \brief Get the package name of given livebox handler
698 * \return const char *
699 * \retval pkgname package name
700 * \retval NULL if the handler is not valid
705 extern const char *livebox_pkgname(struct livebox *handler);
708 * \brief Get the priority of a current content.
713 * \retval 0.0f handler is NULL
714 * \retval -1.0f Handler is not valid (not yet initialized)
715 * \retval real number between 0.0 and 1.0
720 extern double livebox_priority(struct livebox *handler);
723 * \brief Acquire the buffer of given livebox (Only for the buffer type)
728 * \retval address of a FB
729 * \retval NULL if it fails to get fb address
734 extern void *livebox_acquire_fb(struct livebox *handler);
737 * \brief Release the buffer of a livebox (Only for the buffer type)
742 * \retval LB_STATUS_ERROR_INVALID
743 * \retval LB_STATUS_SUCCESS
746 * \see livebox_acquire_fb
748 extern int livebox_release_fb(void *buffer);
751 * \brief Get the reference count of Livebox buffer (Only for the buffer type)
756 * \retval LB_STATUS_ERROR_INVALID
757 * \retval LB_STATUS_ERROR_FAULT
758 * \retval refcnt positive integer including ZERO
761 * \see livebox_pdfb_refcnt
763 extern int livebox_fb_refcnt(void *buffer);
766 * \brief Acquire the buffer of a PD frame (Only for the buffer type)
772 * \retval adress of buffer of PD
775 * \see livebox_release_pdfb
777 extern void *livebox_acquire_pdfb(struct livebox *handler);
780 * \brief Release the acquired buffer of the PD Frame (Only for the buffer type)
785 * \retval LB_STATUS_ERROR_INVALID
786 * \retval LB_STATUS_SUCCESS
789 * \see livebox_acquire_pdfb
791 extern int livebox_release_pdfb(void *buffer);
794 * \brief Reference count of given PD buffer (Only for the buffer type)
799 * \retval LB_STATUS_ERROR_INVALID
800 * \retval LB_STATUS_ERROR_FAULT
801 * \retval reference count
804 * \see livebox_fb_refcnt
806 extern int livebox_pdfb_refcnt(void *buffer);
809 * \brief Get the size of the Livebox
814 * \retval LB_SIZE_TYPE_NxM
815 * \retval LB_SIZE_TYPE_INVALID
820 extern int livebox_size(struct livebox *handler);
823 * \brief Get the size of the Progressive Disclosure
830 * \retval LB_STATUS_ERROR_INVALID
831 * \retval LB_STATUS_SUCCESS
836 extern int livebox_get_pdsize(struct livebox *handler, int *w, int *h);
839 * \brief List of supported sizes of given handler
844 * \param[out] size_list
846 * \retval LB_STATUS_ERROR_INVALID
847 * \retval LB_STATUS_SUCCESS
852 extern int livebox_get_supported_sizes(struct livebox *handler, int *cnt, int *size_list);
855 * \brief BUFFER SIZE of the livebox if it is a buffer type
860 * \retval LB_STATUS_ERROR_INVALID
861 * \retval size of livebox buffer
866 extern int livebox_lbfb_bufsz(struct livebox *handler);
869 * \brief BUFFER SIZE of the progiressive disclosure if it is a buffer type
874 * \retval LB_STATUS_ERROR_INVALID
875 * \retval size of PD buffer
880 extern int livebox_pdfb_bufsz(struct livebox *handler);
883 * \brief Send the content event (for buffer type) to provider(livebox)
891 * \retval LB_STATUS_ERROR_INVALID
892 * \retval LB_STATUS_ERROR_BUSY
893 * \retval LB_STATUS_ERROR_FAULT
894 * \retval LB_STATUS_SUCCESS
897 * \see livebox_access_event
899 extern int livebox_content_event(struct livebox *handler, enum content_event_type type, double x, double y);
902 * \brief Send the access event(for buffer type) to provider(livebox).
912 * \retval LB_STATUS_ERROR_INVALID
913 * \retval LB_STATUS_ERROR_BUSY
914 * \retval LB_STATUS_ERROR_FAULT
915 * \retval LB_STATUS_SUCCESS
918 * \see livebox_content_event
920 extern int livebox_access_event(struct livebox *handler, enum access_event_type type, double x, double y, ret_cb_t cb, void *data);
923 * \brief Do pin up or not.
931 * \retval LB_STATUS_ERROR_INVALID
932 * \retval 1 box is pinned up
933 * \retval 0 box is not pinned up
936 extern int livebox_set_pinup(struct livebox *handler, int flag, ret_cb_t cb, void *data);
939 * \brief Check the PIN-UP status of given handler
945 extern int livebox_is_pinned_up(struct livebox *handler);
948 * \brief Check the PINUP feature availability of the given handler
953 * \retval LB_STATUS_ERROR_INVALID
954 * \retval 1 if the box support Pinup feature
955 * \retval 0 if the box does not support the Pinup feature
960 extern int livebox_has_pinup(struct livebox *handler);
963 * \brief Check the PD existence of given handler
968 * \retval LB_STATUS_ERROR_INVALID
969 * \retval 1 if the box support the PD
970 * \retval 0 if the box has no PD
975 extern int livebox_has_pd(struct livebox *handler);
978 * \brief Create the PD of given handler
985 * \retval LB_STATUS_SUCCESS
986 * \retval LB_STATUS_ERROR_INVALID
987 * \retval LB_STATUS_ERROR_BUSY
988 * \retval LB_STATUS_ERROR_FAULT
993 extern int livebox_create_pd(struct livebox *handler, ret_cb_t cb, void *data);
996 * \brief Create the PD of given handler with the relative position from livebox
1000 * \param[in] x 0.0 ~ 1.0
1001 * \param[in] y 0.0 ~ 1.0
1005 * \retval LB_STATUS_SUCCESS
1006 * \retval LB_STATUS_ERROR_INVALID
1007 * \retval LB_STATUS_ERROR_BUSY
1008 * \retval LB_STATUS_ERROR_FAULT
1013 extern int livebox_create_pd_with_position(struct livebox *handler, double x, double y, ret_cb_t cb, void *data);
1016 * \brief PD position is updated.
1019 * \param[in] handler
1020 * \param[in] x 0.0 ~ 1.0
1021 * \param[in] y 0.0 ~ 1.0
1023 * \retval LB_STATUS_SUCCESS if succeed to send request for updating position of the PD.
1024 * \retval LB_STATUS_ERROR_FAULT
1025 * \retval LB_STATUS_ERROR_INVALID
1030 extern int livebox_move_pd(struct livebox *handler, double x, double y);
1033 * \brief Destroy the PD of given handler if it is created.
1036 * \param[in] handler
1040 * \retval LB_STATUS_ERROR_INVALID
1041 * \retval LB_STATUS_ERROR_FAULT
1042 * \retval LB_STATUS_SUCCESS
1047 extern int livebox_destroy_pd(struct livebox *handler, ret_cb_t cb, void *data);
1050 * \brief Check the create status of given livebox handler
1053 * \param[in] handler
1055 * \retval LB_STATUS_ERROR_INVALID
1056 * \retval 0 PD is not created
1057 * \retval 1 PD is created
1059 extern int livebox_pd_is_created(struct livebox *handler);
1062 * \brief Check the content type of the progressive disclosure of given handler
1065 * \param[in] handler
1067 * \retval PD_TYPE_BUFFER Contents of a PD is based on canvas buffer(shared)
1068 * \retval PD_TYPE_TEXT Contents of a PD is based on formatted text file
1069 * \retval PD_TYPE_PIXMAP Contents of a livebox is shared by the pixmap(depends on X)
1070 * \retval PD_TYPE_INVALID
1073 * \see livebox_pd_type
1075 extern enum livebox_pd_type livebox_pd_type(struct livebox *handler);
1078 * \brief Check the existence of a livebox about given package name
1081 * \param[in] pkgname
1083 * \retval 1 if the box is exists
1084 * \retval 0 if the box is not exists
1089 extern int livebox_is_exists(const char *pkgname);
1092 * \brief Set function table for parsing the text content of a livebox
1095 * \param[in] handler
1098 * \retval LB_STATUS_SUCCESS
1099 * \retval LB_STATUS_ERROR_INVALID
1100 * \see livebox_set_pd_text_handler
1102 extern int livebox_set_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
1105 * \brief Set function table for parsing the text content of a Progressive Disclosure
1108 * \param[in] handler
1111 * \retval LB_STATUS_SUCCESS
1112 * \retval LB_STATUS_ERROR_INVALID
1113 * \see livebox_set_text_handler
1115 extern int livebox_set_pd_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
1118 * \brief Emit a text signal to given livebox only if it is a text type.
1121 * \param[in] handler
1122 * \param[in] emission
1131 * \retval LB_STATUS_ERROR_INVALID
1132 * \retval LB_STATUS_ERROR_FAULT
1133 * \retval LB_STATUS_SUCCESS
1136 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);
1139 * \brief Set a private data pointer to carry it using given handler
1142 * \param[in] handler
1145 * \retval LB_STATUS_SUCCESS
1146 * \retval LB_STATUS_ERROR_INVALID
1149 * \see livebox_get_data
1151 extern int livebox_set_data(struct livebox *handler, void *data);
1154 * \brief Get private data pointer which is carried by given handler
1157 * \param[in] handler
1159 * \retval data pointer
1162 * \see livebox_set_data
1164 extern void *livebox_get_data(struct livebox *handler);
1167 * \brief Subscribe the event for liveboxes only in given cluster and sub-cluster
1170 * \param[in] cluster "*" can be used for subscribe all cluster's liveboxes event.
1171 * If you use the "*", value in the category will be ignored.
1172 * \param[in] category "*" can be used for subscribe liveboxes events of all category(sub-cluster) in given "cluster"
1174 * \retval LB_STATUS_ERROR_FAULT
1175 * \retval LB_STATUS_SUCCESS
1178 * \see livebox_unsubscribe_group
1180 extern int livebox_subscribe_group(const char *cluster, const char *category);
1183 * \brief Unsubscribe the event for the liveboxes, but you will receive already added liveboxes event.
1186 * \param[in] cluster "*" can be used for subscribe all cluster's liveboxes event.
1187 * If you use the "*", value in the category will be ignored.
1188 * \param[in] category "*" can be used for subscribe all sub-cluster's liveboxes event in given "cluster"
1190 * \retval LB_STATUS_ERROR_FAULT
1191 * \retval LB_STATUS_SUCCESS
1194 * \see livebox_subscribe_group
1196 extern int livebox_unsubscribe_group(const char *cluster, const char *category);
1199 * \brief Refresh the group(cluster/sub-cluser(aka. category))
1202 * \param[in] cluster Cluster ID
1203 * \param[in] category Sub-cluster ID
1205 * \retval LB_STATUS_ERROR_INVALID
1206 * \retval LB_STATUS_ERROR_FAULT
1207 * \retval LB_STATUS_SUCCESS
1212 extern int livebox_refresh_group(const char *cluster, const char *category);
1215 * \brief Refresh a livebox
1218 * \param[in] handler
1220 * \retval LB_STATUS_ERROR_INVALID
1221 * \retval LB_STATUS_ERROR_FAULT
1222 * \retval LB_STATUS_SUCCESS
1227 extern int livebox_refresh(struct livebox *handler);
1230 * \brief Pixmap Id of a livebox content
1233 * \param[in] handler
1235 * \retval 0 if the pixmap is not created
1236 * \retval pixmap Pixmap Id need to be casted to (unsigned int) type
1239 * \see livebox_pd_pixmap
1241 extern int livebox_lb_pixmap(const struct livebox *handler);
1244 * \brief Pixmap Id of a PD content
1247 * \param[in] handler
1249 * \retval 0 if the pixmap is not created
1250 * \retval pixmap Pixmap Id need to be casted to (unsigned int) type
1253 * \see livebox_lb_pixmap
1255 extern int livebox_pd_pixmap(const struct livebox *handler);
1261 * \param[in] handler
1265 * \retval LB_STATUS_ERROR_INVALID
1266 * \retval LB_STATUS_ERROR_FAULT
1267 * \retval LB_STATUS_SUCCESS
1270 * \see livebox_release_pd_pixmap
1271 * \see livebox_acquire_lb_pixmap
1274 extern int livebox_acquire_pd_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
1277 * \brief Release the acquired pixmap ID
1280 * \param[in] handler
1283 * \retval LB_STATUS_ERROR_INVALID
1284 * \retval LB_STATUS_ERROR_FAULT
1285 * \retval LB_STATUS_SUCCESS
1288 * \see livebox_acquire_pd_pixmap
1289 * \see livebox_release_lb_pixmap
1291 extern int livebox_release_pd_pixmap(struct livebox *handler, int pixmap);
1297 * \param[in] handler
1301 * \retval LB_STATUS_ERROR_INVALID
1302 * \retval LB_STATUS_ERROR_FAULT
1303 * \retval LB_STATUS_SUCCESS
1306 * \see livebox_release_lb_pixmap
1307 * \see livebox_acquire_pd_pixmap
1310 extern int livebox_acquire_lb_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
1316 * \param[in] handler
1319 * \retval LB_STATUS_ERROR_INVALID
1320 * \retval LB_STATUS_ERROR_FAULT
1321 * \retval LB_STATUS_SUCCESS
1324 * \see livebox_acquire_lb_pixmap
1325 * \see livebox_release_pd_pixmap
1327 extern int livebox_release_lb_pixmap(struct livebox *handler, int pixmap);
1330 * \brief Update the visible state of a livebox
1333 * \param[in] handler Handler of a livebox
1334 * \param[in] state Configure the current visible state of a livebox
1336 * \retval LB_STATUS_ERROR_INVALID
1337 * \retval LB_STATUS_ERROR_BUSY
1338 * \retval LB_STATUS_ERROR_PERMISSION
1339 * \retval LB_STATUS_ERROR_ALREADY
1340 * \retval LB_STATUS_ERROR_FAULT
1341 * \retval LB_STATUS_SUCCESS
1346 extern int livebox_set_visibility(struct livebox *handler, enum livebox_visible_state state);
1349 * \brief Current visible state of a livebox
1352 * \param[in] handler Handler of a livebox
1353 * \return livebox_visible_state
1354 * \retval LB_SHOW Livebox is showed. Default state
1355 * \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
1356 * \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
1357 * \retval LB_VISIBLE_ERROR To enlarge the size of this enumeration type
1362 extern enum livebox_visible_state livebox_visibility(struct livebox *handler);
1365 * \brief Set the update mode of current livebox
1368 * if you set 1 for active update mode, you should get buffer without updated event from provider.
1369 * But is passive mode, you have to update content of a box when you get updated event.
1370 * Default is Passive mode.
1371 * \param[in] handler Handler of a livebox
1372 * \param[in] active_update 1 means active update, 0 means passive update (default)
1373 * \param[in] cb Result callback function
1374 * \param[in] data Callback data
1376 * \retval LB_STATUS_ERROR_INVALID
1377 * \retval LB_STATUS_ERROR_BUSY
1378 * \retval LB_STATUS_ERROR_PERMISSION
1379 * \retval LB_STATUS_ERROR_ALREADY
1380 * \retval LB_STATUS_ERROR_FAULT
1381 * \retval LB_STATUS_SUCCESS
1384 extern int livebox_set_update_mode(struct livebox *handler, int active_update, ret_cb_t cb, void *data);
1387 * \brief Is this box in the active update mode?
1390 * \param[in] handler HAndler of a livebox
1392 * \retval 0 if passive mode
1393 * \retval 1 if active mode or error code
1396 extern int livebox_is_active_update(struct livebox *handler);