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_ON_SCROLL = 0x00000080, /*!< LB On scrolling */
63 CONTENT_EVENT_ON_HOLD = 0x00000100, /*!< LB On holding */
64 CONTENT_EVENT_OFF_SCROLL = 0x00000200, /*!< LB Stop scrolling */
65 CONTENT_EVENT_OFF_HOLD = 0x00000400, /*!< LB Stop holding */
67 CONTENT_EVENT_KEY_MASK = 0x80000000,
68 CONTENT_EVENT_MOUSE_MASK = 0x20000000,
69 CONTENT_EVENT_PD_MASK = 0x10000000,
70 CONTENT_EVENT_LB_MASK = 0x40000000,
72 LB_MOUSE_ON_SCROLL = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_ON_SCROLL, /*!< Mouse event occurs while scrolling */
73 LB_MOUSE_ON_HOLD = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_ON_HOLD, /*!< Mouse event occurs on holding */
74 LB_MOUSE_OFF_SCROLL = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_OFF_SCROLL, /*!< Scrolling stopped */
75 LB_MOUSE_OFF_HOLD = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_OFF_HOLD, /*!< Holding stopped */
77 LB_MOUSE_DOWN = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_DOWN, /*!< Mouse down on the livebox */
78 LB_MOUSE_UP = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UP, /*!< Mouse up on the livebox */
79 LB_MOUSE_MOVE = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_MOVE, /*!< Move move on the livebox */
80 LB_MOUSE_ENTER = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_ENTER, /*!< Mouse enter to the livebox */
81 LB_MOUSE_LEAVE = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_LEAVE, /*!< Mouse leave from the livebox */
82 LB_MOUSE_SET = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_SET, /*!< Mouse event, start feeding event by master */
83 LB_MOUSE_UNSET = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UNSET, /*!< Mouse event, stop feeding event by master */
85 PD_MOUSE_ON_SCROLL = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_ON_SCROLL, /*!< Mouse event occurs while scrolling */
86 PD_MOUSE_ON_HOLD = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_ON_HOLD, /*!< Mouse event occurs on holding */
87 PD_MOUSE_OFF_SCROLL = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_OFF_SCROLL, /*!< Scrolling stopped */
88 PD_MOUSE_OFF_HOLD = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_OFF_HOLD, /*!< Holding stopped */
90 PD_MOUSE_DOWN = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_DOWN, /*!< Mouse down on the PD */
91 PD_MOUSE_UP = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UP, /*!< Mouse up on the PD */
92 PD_MOUSE_MOVE = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_MOVE, /*!< Mouse move on the PD */
93 PD_MOUSE_ENTER = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_ENTER, /*!< Mouse enter to the PD */
94 PD_MOUSE_LEAVE = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_LEAVE, /*!< Mouse leave from the PD */
95 PD_MOUSE_SET = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_SET, /*!< Mouse event, start feeding event by master */
96 PD_MOUSE_UNSET = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UNSET, /*!< Mouse event, stop feeding event by master */
98 LB_KEY_DOWN = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_DOWN, /*!< Key down on the livebox */
99 LB_KEY_UP = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_UP, /*!< Key up on the livebox */
100 LB_KEY_SET = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_SET, /*!< Key event, start feeding event by master */
101 LB_KEY_UNSET = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_UNSET, /*!< Key event, stop feeding event by master */
102 LB_KEY_FOCUS_IN = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_FOCUS_IN, /*!< Key event, focus in */
103 LB_KEY_FOCUS_OUT = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_FOCUS_OUT, /*!< Key event, foucs out */
105 PD_KEY_DOWN = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_DOWN, /*!< Key down on the livebox */
106 PD_KEY_UP = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_UP, /*!< Key up on the livebox */
107 PD_KEY_SET = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_SET, /*!< Key event, start feeding event by master */
108 PD_KEY_UNSET = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_UNSET, /*!< Key event, stop feeding event by master */
109 PD_KEY_FOCUS_IN = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_FOCUS_IN, /*!< Key event, focus in */
110 PD_KEY_FOCUS_OUT = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_FOCUS_OUT, /*!< Key event, focus out */
112 CONTENT_EVENT_MAX = 0xFFFFFFFF
117 * Accessibility event for buffer type Livebox or PD.
118 * These event set are sync'd with Tizen accessibility event set.
120 enum access_event_type {
121 ACCESS_EVENT_PD_MASK = 0x10000000,
122 ACCESS_EVENT_LB_MASK = 0x20000000,
124 ACCESS_EVENT_HIGHLIGHT = 0x00000100, /*!< LB accessibility: Hightlight a object */
125 ACCESS_EVENT_HIGHLIGHT_NEXT = 0x00000200, /*!< LB accessibility: Set highlight to next object */
126 ACCESS_EVENT_HIGHLIGHT_PREV = 0x00000400, /*!< LB accessibility: Set highlight to prev object */
127 ACCESS_EVENT_UNHIGHLIGHT = 0x00000800, /*!< LB accessibility unhighlight */
128 ACCESS_EVENT_ACTIVATE = 0x00001000, /*!< LB accessibility activate */
129 ACCESS_EVENT_ACTION_DOWN = 0x00010000, /*!< LB accessibility value changed */
130 ACCESS_EVENT_ACTION_UP = 0x00020000, /*!< LB accessibility value changed */
131 ACCESS_EVENT_SCROLL_DOWN = 0x00100000, /*!< LB accessibility scroll down */
132 ACCESS_EVENT_SCROLL_MOVE = 0x00200000, /*!< LB accessibility scroll move */
133 ACCESS_EVENT_SCROLL_UP = 0x00400000, /*!< LB accessibility scroll up */
135 LB_ACCESS_HIGHLIGHT = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_HIGHLIGHT, /*!< Access event - Highlight an object in the livebox */
136 LB_ACCESS_HIGHLIGHT_NEXT = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_HIGHLIGHT_NEXT, /*!< Access event - Move highlight to the next object in a livebox */
137 LB_ACCESS_HIGHLIGHT_PREV = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_HIGHLIGHT_PREV, /*!< Access event - Move highlight to the prev object in a livebox */
138 LB_ACCESS_UNHIGHLIGHT = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_UNHIGHLIGHT, /*!< Access event - Delete highlight from the livebox */
139 LB_ACCESS_ACTIVATE = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_ACTIVATE, /*!< Access event - Launch or activate the highlighted object */
140 LB_ACCESS_ACTION_DOWN = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_ACTION_DOWN, /*!< Access event - down */
141 LB_ACCESS_ACTION_UP = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_ACTION_UP, /*!< Access event - up */
142 LB_ACCESS_SCROLL_DOWN = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_SCROLL_DOWN, /*!< Access event - scroll down */
143 LB_ACCESS_SCROLL_MOVE = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_SCROLL_MOVE, /*!< Access event - scroll move */
144 LB_ACCESS_SCROLL_UP = ACCESS_EVENT_LB_MASK | ACCESS_EVENT_SCROLL_UP, /*!< Access event - scroll up */
146 PD_ACCESS_HIGHLIGHT = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_HIGHLIGHT, /*!< Access event - Highlight an object in the PD */
147 PD_ACCESS_HIGHLIGHT_NEXT = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_HIGHLIGHT_NEXT, /*!< Access event - Move highlight to the next object in a PD */
148 PD_ACCESS_HIGHLIGHT_PREV = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_HIGHLIGHT_PREV, /*!< Access event - Move highlight to the prev object in a PD */
149 PD_ACCESS_UNHIGHLIGHT = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_UNHIGHLIGHT, /*!< Access event - Delet highlight from the PD */
150 PD_ACCESS_ACTIVATE = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_ACTIVATE, /*!< Access event - Launch or activate the highlighted object */
151 PD_ACCESS_ACTION_DOWN = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_ACTION_DOWN, /*!< Access event - down */
152 PD_ACCESS_ACTION_UP = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_ACTION_UP, /*!< Access event - up */
153 PD_ACCESS_SCROLL_DOWN = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_SCROLL_DOWN, /*!< Access event - scroll down */
154 PD_ACCESS_SCROLL_MOVE = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_SCROLL_MOVE, /*!< Access event - scroll move */
155 PD_ACCESS_SCROLL_UP = ACCESS_EVENT_PD_MASK | ACCESS_EVENT_SCROLL_UP /*!< Access event - scroll up */
160 * Livebox LB content type
162 enum livebox_lb_type {
163 LB_TYPE_IMAGE = 0x01, /*!< Contents of a livebox is based on the image file */
164 LB_TYPE_BUFFER = 0x02, /*!< Contents of a livebox is based on canvas buffer(shared) */
165 LB_TYPE_TEXT = 0x04, /*!< Contents of a livebox is based on formatted text file */
166 LB_TYPE_PIXMAP = 0x08, /*!< Contens of a livebox is shared by the pixmap(depends on X) */
168 LB_TYPE_INVALID = 0xFF
173 * Livebox PD content type
175 enum livebox_pd_type {
176 PD_TYPE_BUFFER = 0x01, /*!< Contents of a PD is based on canvas buffer(shared) */
177 PD_TYPE_TEXT = 0x02, /*!< Contents of a PD is based on formatted text file */
178 PD_TYPE_PIXMAP = 0x04, /*!< Contents of a livebox is shared by the pixmap(depends on X) */
180 PD_TYPE_INVALID = 0xFF
185 * Livebox event type.
186 * These event will be sent from the provider.
188 enum livebox_event_type { /*!< livebox_event_handler_set Event list */
189 LB_EVENT_LB_UPDATED, /*!< Contents of the given livebox is updated */
190 LB_EVENT_PD_UPDATED, /*!< Contents of the given pd is updated */
192 LB_EVENT_CREATED, /*!< A new livebox is created */
193 LB_EVENT_DELETED, /*!< A livebox is deleted */
195 LB_EVENT_GROUP_CHANGED, /*!< Group (Cluster/Sub-cluster) information is changed */
196 LB_EVENT_PINUP_CHANGED, /*!< PINUP status is changed */
197 LB_EVENT_PERIOD_CHANGED, /*!< Update period is changed */
199 LB_EVENT_LB_SIZE_CHANGED, /*!< Livebox size is changed */
200 LB_EVENT_PD_SIZE_CHANGED, /*!< PD size is changed */
202 LB_EVENT_PD_CREATED, /*!< If a PD is created even if you didn't call the livebox_create_pd API */
203 LB_EVENT_PD_DESTROYED, /*!< If a PD is destroyed even if you didn't call the livebox_destroy_pd API */
205 LB_EVENT_HOLD_SCROLL, /*!< If the screen should be freezed */
206 LB_EVENT_RELEASE_SCROLL, /*!< If the screen can be scrolled */
208 LB_EVENT_LB_UPDATE_BEGIN, /*!< Livebox LB content update is started */
209 LB_EVENT_LB_UPDATE_END, /*!< Livebox LB content update is finished */
211 LB_EVENT_PD_UPDATE_BEGIN, /*!< Livebox PD content update is started */
212 LB_EVENT_PD_UPDATE_END, /*!< Livebox PD content update is finished */
214 LB_EVENT_UPDATE_MODE_CHANGED, /*!< Livebox Update mode is changed */
216 LB_EVENT_REQUEST_CLOSE_PD, /*!< Livebox requests to close the PD */
218 LB_EVENT_IGNORED /*!< Request is ignored */
221 enum livebox_option_type {
222 LB_OPTION_MANUAL_SYNC, /*!< Sync manually */
223 LB_OPTION_FRAME_DROP_FOR_RESIZE, /*!< Drop frames while resizing */
224 LB_OPTION_SHARED_CONTENT, /*!< Use only one real instance for multiple fake instances if user creates it using same content */
226 LB_OPTION_ERROR = 0xFFFFFFFF /*!< To specify the size of this enumeration type */
229 enum livebox_fault_type {
230 LB_FAULT_DEACTIVATED, /*!< Livebox is deactivated by its fault operation */
231 LB_FAULT_PROVIDER_DISCONNECTED /*!< Provider is disconnected */
236 * Must be sync'd with the provider
238 enum livebox_visible_state {
239 LB_SHOW = 0x00, /*!< Livebox is shown. Default state */
240 LB_HIDE = 0x01, /*!< Livebox is hidden, Update timer will not be freezed. but you cannot receive any updates events. */
242 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 */
244 LB_VISIBLE_ERROR = 0xFFFFFFFF /*!< To specify the size of this enumeration type */
249 * TEXT type livebox contents handling opertators.
251 struct livebox_script_operators {
252 int (*update_begin)(struct livebox *handle); /*!< Content parser is started */
253 int (*update_end)(struct livebox *handle); /*!< Content parser is finished */
257 * Listed functions will be called when parser meets each typed content
259 int (*update_text)(struct livebox *handle, const char *id, const char *part, const char *data); /*!< Update text content */
260 int (*update_image)(struct livebox *handle, const char *id, const char *part, const char *data, const char *option); /*!< Update image content */
261 int (*update_script)(struct livebox *handle, const char *id, const char *new_id, const char *part, const char *file, const char *group); /*!< Update script content */
262 int (*update_signal)(struct livebox *handle, const char *id, const char *emission, const char *signal); /*!< Update signal */
263 int (*update_drag)(struct livebox *handle, const char *id, const char *part, double dx, double dy); /*!< Update drag info */
264 int (*update_info_size)(struct livebox *handle, const char *id, int w, int h); /*!< Update content size */
265 int (*update_info_category)(struct livebox *handle, const char *id, const char *category); /*!< Update content category info */
266 int (*update_access)(struct livebox *handle, const char *id, const char *part, const char *text, const char *option); /*!< Update access information */
267 int (*operate_access)(struct livebox *handle, const char *id, const char *part, const char *operation, const char *option); /*!< Update access operation */
268 int (*update_color)(struct livebox *handle, const char *id, const char *part, const char *data); /*!< Update color */
272 * \brief Prototype of the return callback of every async functions
275 * \param[in] handle Handle of the livebox instance
276 * \param[in] ret Result status of operation. LB_STATUS_XXX defined from liblivebox-service
277 * \param[in] data data for result callback
282 * \see livebox_add_with_size
284 * \see livebox_activate
285 * \see livebox_resize
286 * \see livebox_set_group
287 * \see livebox_set_period
288 * \see livebox_access_event
289 * \see livebox_set_pinup
290 * \see livebox_create_pd
291 * \see livebox_create_pd_with_position
292 * \see livebox_destroy_pd
293 * \see livebox_emit_text_signal
294 * \see livebox_acquire_pd_pixmap
295 * \see livebox_acquire_lb_pixmap
296 * \see livebox_set_update_mode
298 typedef void (*ret_cb_t)(struct livebox *handle, int ret, void *data);
301 * \brief Initialize the livebox system
304 * This API uses get/setenv APIs.
305 * Those APIs are not thread-safe.
306 * So you have to consider to use the livebox_init_with_options instead of this if you are developing multi-threaded viewer.
307 * \param[in] disp If you have X Display connection object already, you can re-use it. but you should care its life cycle.
308 * It must be alive before call the livebox_fini
310 * \retval LB_STATUS_SUCCESS if success
314 * \see livebox_init_with_options
316 extern int livebox_init(void *disp);
319 * \brief Initialize the livebox system with some options
320 * \details livebox_init function uses environment value to initiate some configurable values
321 * But some application doesn't want to use the env value.
322 * For them, this API will give a chance to set default options using given arguments
324 * \param[in] disp if this display is NULL, the library will try to acquire a new connection with X
325 * \param[in] prevent_overwrite If the content of image type livebox is updated, don't overwrite it(1) or overwrite old file(0)
326 * \param[in] event_filter If the next event comes in this period, ignore it. It is too fast to processing it in time.
327 * \param[in] use_thread Use the receive thread.
328 * \return int Integer, Livebox status code
329 * \retval LB_STATUS_SUCCESS if success
335 extern int livebox_init_with_options(void *disp, int prevent_overwrite, double event_filter, int use_thread);
338 * \brief Finalize the livebox system
342 * \retval LB_STATUS_SUCCES if success
343 * \retval LB_STATUS_ERROR_INVALID if livebox_init is not called.
347 * \see livebox_init_with_options
349 extern int livebox_fini(void);
352 * \brief Notify the status of client to the provider. "it is paused".
356 * \retval LB_STATUS_SUCCESS if success
357 * \retval LB_STATUS_ERROR_FAULT if it failed to send state(paused) info
360 * \see livebox_client_resumed
362 extern int livebox_client_paused(void);
365 * \brief Notify the status of client to the provider. "it is resumed".
369 * \retval LB_STATUS_SUCCESS if success
370 * \retval LB_STATUS_ERROR_FAULT if it failed to send state(resumed) info
373 * \see livebox_client_paused
375 extern int livebox_client_resumed(void);
378 * \brief Add a new livebox
381 * Even though you get the livebox handle from return value of this function,
382 * it is not matured before return callback called.
383 * You have to use the handle after get the return callback with "ret == LB_STATUS_SUCCESS"
384 * \param[in] pkgname Livebox Id
385 * \param[in] content Will be passed to the livebox instance.
386 * \param[in] cluster Main group
387 * \param[in] category Sub group
388 * \param[in] period Update period. if you set DEFAULT_PERIOD, the provider will use the default period which is described in the manifest.
389 * \param[in] cb After send the request to the provider, its result will be passed
392 * \retval NULL if it fails to add a new instance
393 * \retval handle livebox handle
397 * \see livebox_add_with_size
399 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);
402 * \brief Add a new livebox
404 * If the screen size if "1280x720"
405 * Below size lists are used for default.
406 * Or you can find the default sizes in pixel from /usr/share/data-provider-master/resolution.ini
407 * Size types are defined from the liblivebox-service package. (livebox-service.h)
409 * Normal mode livebox
410 * 1x1=175x175, LB_SIZE_TYPE_1x1
411 * 2x1=354x175, LB_SIZE_TYPE_2x1
412 * 2x2=354x354, LB_SIZE_TYPE_2x2
413 * 4x1=712x175, LB_SIZE_TYPE_4x1
414 * 4x2=712x354, LB_SIZE_TYPE_4x2
415 * 4x4=712x712, LB_SIZE_TYPE_4x4
418 * 4x3=712x533, LB_SIZE_TYPE_4x3
419 * 4x5=712x891, LB_SIZE_TYPE_4x5
420 * 4x6=712x1070, LB_SIZE_TYPE_4x6
423 * 21x21=224x215, LB_SIZE_TYPE_EASY_1x1
424 * 23x21=680x215, LB_SIZE_TYPE_EASY_3x1
425 * 23x23=680x653, LB_SIZE_TYPE_EASY_3x3
428 * 0x0=720x1280, LB_SIZE_TYPE_0x0
431 * Even if you get the handle by return value of this function, it is not created instance.
432 * So you have to deal it as not initialized handle.
433 * Only it can be initialized after get the return callback with "ret == LB_STATUS_SUCCESS".
434 * \param[in] pkgname Livebox Id
435 * \param[in] content Will be passed to the livebox instance.
436 * \param[in] cluster Main group
437 * \param[in] category Sub group
438 * \param[in] period DEFAULT_PERIOD can be used for this. this argument will be used to specify the period of update content of livebox.
439 * \param[in] type Size type - which are defined from liblivebox-service package.
440 * \param[in] cb After the request is sent to the master provider, this callback will be called.
441 * \param[in] data This data will be passed to the callback.
443 * \retval handle Livebox handle but not yet initialized
444 * \retval NULL if it fails to create a handle
448 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);
451 * \brief Delete a livebox (deprecated)
454 * If you call this with uninitialized handle, the return callback will be called synchronously.
455 * So before return from this function, the return callback will be called first.
456 * \param[in] handler Handler of a livebox instance
457 * \param[in] cb return callback
458 * \param[in] data user data for return callback
460 * \retval LB_STATUS_ERROR_INVALID Invalid argument
461 * \retval LB_STATUS_ERROR_BUSY already in process
462 * \retval LB_STATUS_ERROR_FAULT failed to create a request packet
463 * \retval LB_STATUS_SUCCESS successfully sent, return callack will be called
468 extern int livebox_del(struct livebox *handler, ret_cb_t cb, void *data);
471 * \brief Delete a livebox (will be replaced with livebox_del)
474 * If you call this with uninitialized handle, the return callback will be called synchronously.
475 * So before return from this function, the return callback will be called first.
476 * \param[in] handler Handler of a livebox instance
477 * \param[in] type Deletion type, LB_DELETE_PERMANENTLY or LB_DELETE_TEMPORARY
478 * \param[in] cb return callback
479 * \param[in] data user data for return callback
481 * \retval LB_STATUS_ERROR_INVALID Invalid argument
482 * \retval LB_STATUS_ERROR_BUSY already in process
483 * \retval LB_STATUS_ERROR_FAULT failed to create a request packet
484 * \retval LB_STATUS_SUCCESS successfully sent, return callack will be called
489 extern int livebox_del_NEW(struct livebox *handler, int type, ret_cb_t cb, void *data);
492 * \brief Set a livebox events callback
494 * To get the events push from the provider, register the event callback using this function
495 * The callback will be called if there is any events from the provider.
497 * \param[in] cb Event handler
498 * \param[in] data User data for the event handler
500 * \retval LB_STATUS_SUCCESS if succeed to set event handler
501 * \retval LB_STATUS_ERROR_INVALID Invalid argument
502 * \retval LB_STATUS_ERROR_MEMORY Not enough memory
505 * \see livebox_unset_event_handler
507 extern int livebox_set_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data), void *data);
510 * \brief Unset the livebox event handler
513 * \param[in] cb Event handler
514 * \return void * Event handler data
515 * \retval pointer of 'data' which is used with the livebox_set_event_handler
518 * \see livebox_set_event_handler
520 extern void *livebox_unset_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data));
523 * \brief Live box fault event handler registeration function
525 * event, pkgname, filename, funcname
528 * \param[in] cb Event handler
529 * \param[in] data Event handler data
531 * \retval LB_STATUS_SUCCESS if succeed to set fault event handler
532 * \retval LB_STATUS_ERROR_INVALID Invalid argument
533 * \retval LB_STATUS_ERROR_MEMORY Not enough memory
536 * \see livebox_unset_fault_handler
538 extern int livebox_set_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *), void *data);
541 * \brief Unset the live box fault event handler
544 * \param[in] cb Event handler
545 * \return void * Callback data which is set via livebox_set_fault_handler
546 * \retval pointer of 'data' which is used with the livebox_set_fault_handler
549 * \see livebox_set_fault_handler
551 extern void *livebox_unset_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *));
554 * \brief Activate the faulted livebox.
556 * Request result will be back via return callback.
558 * Even though this function returns SUCCESS, it means just successfully sent a request to provider.
559 * So you have to check the return callback. and its "ret" argument.
560 * \param[in] pkgname Package name which should be activated
561 * \param[in] cb Result callback
562 * \param[in] data Callback data
564 * \retval LB_STATUS_SUCCESS Successfully sent a request
565 * \retval LB_STATUS_ERROR_INVALID Invalid argument
566 * \retval LB_STATUS_ERROR_FAULT Failed to make a request
571 extern int livebox_activate(const char *pkgname, ret_cb_t cb, void *data);
574 * \brief Resize the livebox
576 * Normal mode livebox size
577 * 1x1=175x175, LB_SIZE_TYPE_1x1
578 * 2x1=354x175, LB_SIZE_TYPE_2x1
579 * 2x2=354x354, LB_SIZE_TYPE_2x2
580 * 4x1=712x175, LB_SIZE_TYPE_4x1
581 * 4x2=712x354, LB_SIZE_TYPE_4x2
582 * 4x4=712x712, LB_SIZE_TYPE_4x4
584 * Extended livebox size
585 * 4x3=712x533, LB_SIZE_TYPE_4x3
586 * 4x5=712x891, LB_SIZE_TYPE_4x5
587 * 4x6=712x1070, LB_SIZE_TYPE_4x6
589 * Easy mode livebox size
590 * 21x21=224x215, LB_SIZE_TYPE_EASY_1x1
591 * 23x21=680x215, LB_SIZE_TYPE_EASY_3x1
592 * 23x23=680x653, LB_SIZE_TYPE_EASY_3x3
594 * Special mode livebox size
595 * 0x0=720x1280, LB_SIZE_TYPE_0x0
597 * You have to check the return callback.
598 * \param[in] handler Handler of a livebox instance
599 * \param[in] type Type of a livebox size, LB_SIZE_TYPE_1x1, ...
600 * \param[in] cb Result callback of the resize operation.
601 * \param[in] data User data for return callback
603 * \retval LB_STATUS_ERROR_INVALID Invalid argument
604 * \retval LB_STATUS_ERROR_BUSY Previous request of resize is in progress.
605 * \retval LB_STATUS_ERROR_ALREADY Already resized, there is no differences between current size and requested size.
606 * \retval LB_STATUS_ERROR_PERMISSION Permission denied, you only have view the content of this box.
607 * \retval LB_STATUS_ERROR_FAULT Failed to make a request
612 extern int livebox_resize(struct livebox *handler, int type, ret_cb_t cb, void *data);
615 * \brief Send the click event for a livebox.
618 * \param[in] handler Handler of a livebox instance
619 * \param[in] x Rational X of the content width.
620 * \param[in] y Rational Y of the content height.
622 * \retval LB_STATUS_ERROR_INVALID Invalid argument
623 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
624 * \retval LB_STATUS_SUCCESS Successfully done
629 extern int livebox_click(struct livebox *handler, double x, double y);
632 * \brief Change the cluster/sub-cluster name of given livebox handler
635 * \param[in] handler Handler of a livebox instance
636 * \param[in] cluster New cluster of a livebox
637 * \param[in] category New category of a livebox
638 * \param[in] cb Result callback for changing the cluster/category of a livebox
639 * \param[in] data User data for the result callback
641 * \retval LB_STATUS_SUCCESS Request is successfully sent. the return callback will be called.
642 * \retval LB_STATUS_ERROR_BUSY previous request is not finished yet.
643 * \retval LB_STATUS_ERROR_ALREADY group name is same with current one.
644 * \retval LB_STATUS_ERROR_PERMISSION you have no permission to change property of this livebox instance.
645 * \retval LB_STATUS_ERROR_FAULT Failed to make a request.
650 extern int livebox_set_group(struct livebox *handler, const char *cluster, const char *category, ret_cb_t cb, void *data);
653 * \brief Get the cluster and category(sub-cluster) name of given livebox (It is not I18N format, only english)
656 * You have to do not release the cluster & category.
657 * It is allocated inside of given livebox instance, so you can only read it.
658 * \param[in] handler Handler of a livebox instance
659 * \param[out] cluster Storage(memory) for containing the cluster name
660 * \param[out] category Storage(memory) for containing the category name
662 * \retval LB_STATUS_ERROR_INVALID Invalid argument
663 * \retval LB_STATUS_SUCCESS Successfully done
668 extern int livebox_get_group(struct livebox *handler, const char **cluster, const char **category);
671 * \brief Get the period of this livebox handler
674 * if this function returns 0.0f, it means the livebox has no update period.
675 * or the handle is not valid.
676 * This function only can be works after the return callback of livebox_create fucntion is called.
677 * \param[in] handler Handler of a livebox instance
679 * \retval Current update period of a livebox
680 * \retval 0.0f it means the box has no update period, or it can returns 0.0 if the handles is not valid.
685 extern double livebox_period(struct livebox *handler);
688 * \brief Change the update period
691 * \param[in] handler Handler of a livebox instance
692 * \param[in] period New update period of a livebox
693 * \param[in] cb Result callback of changing the update period of this livebox
694 * \param[in] data User data for the result callback
696 * \retval LB_STATUS_SUCCESS Successfully done
697 * \retval LB_STATUS_ERROR_INVALID Invalid argument
698 * \retval LB_STATUS_ERROR_BUSY
699 * \retval LB_STATUS_ERROR_ALREADY
700 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
705 extern int livebox_set_period(struct livebox *handler, double period, ret_cb_t cb, void *data);
708 * \brief Is this an text type livebox?
711 * \param[in] handler Handler of a livebox instance
712 * \return livebox_lb_type
713 * \retval LB_TYPE_IMAGE Contents of a livebox is based on the image file
714 * \retval LB_TYPE_BUFFER Contents of a livebox is based on canvas buffer(shared)
715 * \retval LB_TYPE_TEXT Contents of a livebox is based on formatted text file
716 * \retval LB_TYPE_PIXMAP Contens of a livebox is shared by the pixmap(depends on X)
717 * \retval LB_TYPE_INVALID
720 * \see livebox_lb_type
722 extern enum livebox_lb_type livebox_lb_type(struct livebox *handler);
725 * \brief Is this livebox is created by a user?
727 * If the livebox instance is created by system this will returns 0.
729 * \param[in] handler Handler of a livebox instance
731 * \retval LB_STATUS_ERROR_INVALID Invalid argument
732 * \retval 0 automatically created livebox by the provider
733 * \retval 1 created by user via livebox_add or livebox_add_with_size
737 * \see livebox_add_with_size
738 * \see livebox_set_event_handler
740 extern int livebox_is_user(struct livebox *handler);
743 * \brief Get the content information string of given livebox
746 * \param[in] handler Handler of a livebox instance
747 * \return const char *
748 * \retval content_info Livebox content info that can be used again via content_info argument of livebox_add or livebox_add_with_size.
752 * \see livebox_add_with_size
754 extern const char *livebox_content(struct livebox *handler);
757 * \brief Get the sub cluster title string of given livebox
759 * This API is now used for accessibility.
760 * Each box should set their content as a string to read by TTS.
761 * So if the box has focus on the homescreen, the homescreen will read a text using this API.
763 * The title which is returned by this, the TTS should read it.
764 * But it is just recomended to a homescreen.
765 * So read it or not is depends on implementation of the homescreen.
766 * \param[in] handler Handler of a livebox instance
767 * \return const char *
768 * \retval sub cluster name
774 extern const char *livebox_category_title(struct livebox *handler);
777 * \brief Get the filename of given livebox, if it is an IMAGE type livebox
779 * If the box is developed as image format to represent its contents,
780 * The homescreen should know its image file name.
782 * \param[in] handler Handler of a livebox instance
783 * \return const char *
784 * \retval filename if the livebox type is image this function will give you a abspath of an image file (content is rendered)
785 * \retval NULL if this has no image file or type is not image file.
790 extern const char *livebox_filename(struct livebox *handler);
793 * \brief Get the package name of given livebox handler
796 * \param[in] handler Handler of a livebox instance
797 * \return const char *
798 * \retval pkgname package name
799 * \retval NULL if the handler is not valid
804 extern const char *livebox_pkgname(struct livebox *handler);
807 * \brief Get the priority of a current content.
810 * \param[in] handler Handler of a livebox instance
812 * \retval 0.0f handler is NULL
813 * \retval -1.0f Handler is not valid (not yet initialized)
814 * \retval real number between 0.0 and 1.0
819 extern double livebox_priority(struct livebox *handler);
822 * \brief Acquire the buffer of given livebox (Only for the buffer type)
825 * \param[in] handler Handler of a livebox instance
827 * \retval address of a FB
828 * \retval NULL if it fails to get fb address
833 extern void *livebox_acquire_fb(struct livebox *handler);
836 * \brief Release the buffer of a livebox (Only for the buffer type)
841 * \retval LB_STATUS_ERROR_INVALID Invalid argument
842 * \retval LB_STATUS_SUCCESS Successfully done
845 * \see livebox_acquire_fb
847 extern int livebox_release_fb(void *buffer);
850 * \brief Get the reference count of Livebox buffer (Only for the buffer type)
855 * \retval LB_STATUS_ERROR_INVALID Invalid argument
856 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
857 * \retval refcnt positive integer including ZERO
860 * \see livebox_pdfb_refcnt
862 extern int livebox_fb_refcnt(void *buffer);
865 * \brief Acquire the buffer of a PD frame (Only for the buffer type)
868 * \param[in] handler Handler of a livebox instance
871 * \retval adress of buffer of PD
874 * \see livebox_release_pdfb
876 extern void *livebox_acquire_pdfb(struct livebox *handler);
879 * \brief Release the acquired buffer of the PD Frame (Only for the buffer type)
884 * \retval LB_STATUS_ERROR_INVALID Invalid argument
885 * \retval LB_STATUS_SUCCESS Successfully done
888 * \see livebox_acquire_pdfb
890 extern int livebox_release_pdfb(void *buffer);
893 * \brief Reference count of given PD buffer (Only for the buffer type)
898 * \retval LB_STATUS_ERROR_INVALID Invalid argument
899 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
900 * \retval reference count
903 * \see livebox_fb_refcnt
905 extern int livebox_pdfb_refcnt(void *buffer);
908 * \brief Get the size of the Livebox
911 * \param[in] handler Handler of a livebox instance
913 * \retval LB_SIZE_TYPE_NxM
914 * \retval LB_SIZE_TYPE_INVALID
919 extern int livebox_size(struct livebox *handler);
922 * \brief Get the size of the Progressive Disclosure
925 * \param[in] handler Handler of a livebox instance
929 * \retval LB_STATUS_ERROR_INVALID Invalid argument
930 * \retval LB_STATUS_SUCCESS Successfully done
935 extern int livebox_get_pdsize(struct livebox *handler, int *w, int *h);
938 * \brief List of supported sizes of given handler
941 * \param[in] handler Handler of a livebox instance
943 * \param[out] size_list
945 * \retval LB_STATUS_ERROR_INVALID Invalid argument
946 * \retval LB_STATUS_SUCCESS Successfully done
951 extern int livebox_get_supported_sizes(struct livebox *handler, int *cnt, int *size_list);
954 * \brief BUFFER SIZE of the livebox if it is a buffer type
957 * \param[in] handler Handler of a livebox instance
959 * \retval LB_STATUS_ERROR_INVALID Invalid argument
960 * \retval size of livebox buffer
965 extern int livebox_lbfb_bufsz(struct livebox *handler);
968 * \brief BUFFER SIZE of the progiressive disclosure if it is a buffer type
971 * \param[in] handler Handler of a livebox instance
973 * \retval LB_STATUS_ERROR_INVALID Invalid argument
974 * \retval size of PD buffer
979 extern int livebox_pdfb_bufsz(struct livebox *handler);
982 * \brief Send the content event (for buffer type) to provider(livebox)
984 * \remarks DEPRECATED
985 * Use the livebox_mouse_event function instead of this.
986 * \param[in] handler Handler of a livebox instance
987 * \param[in] type Event type
988 * \param[in] x coordinates of X axis
989 * \param[in] y coordinates of Y axis
991 * \retval LB_STATUS_ERROR_INVALID Invalid argument
992 * \retval LB_STATUS_ERROR_BUSY Previous operaion is not finished yet
993 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
994 * \retval LB_STATUS_SUCCESS Successfully sent
997 * \see livebox_mouse_event
998 * \see livebox_access_event
999 * \see livebox_key_event
1001 extern int livebox_content_event(struct livebox *handler, enum content_event_type type, double x, double y);
1004 * \brief Send the content event (for buffer type) to provider(livebox)
1007 * \param[in] handler Handler of a livebox instance
1008 * \param[in] type Event type
1009 * \param[in] x coordinates of X axis
1010 * \param[in] y coordinates of Y axis
1012 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1013 * \retval LB_STATUS_ERROR_BUSY Previous operation is not finished yet
1014 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1015 * \retval LB_STATUS_SUCCESS Successfully sent
1018 * \see livebox_content_event
1019 * \see livebox_access_event
1020 * \see livebox_key_event
1022 extern int livebox_mouse_event(struct livebox *handler, enum content_event_type type, double x, double y);
1025 * \brief Send the access event(for buffer type) to provider(livebox).
1028 * \param[in] handler Handler of a livebox instance
1029 * \param[in] type Event type
1030 * \param[in] x coordinates of X axsis
1031 * \param[in] y coordinates of Y axsis
1032 * \param[in] cb Result callback function
1033 * \param[in] data Callback data
1035 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1036 * \retval LB_STATUS_ERROR_BUSY Previous operation is not finished yet
1037 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1038 * \retval LB_STATUS_SUCCESS Successfully sent
1041 * \see livebox_mouse_event
1042 * \see livebox_key_event
1044 extern int livebox_access_event(struct livebox *handler, enum access_event_type type, double x, double y, ret_cb_t cb, void *data);
1047 * \brief Send the key event(for buffer type) to provider(livebox).
1050 * \param[in] handler Handler of a livebox instance
1051 * \param[in] type Key event type
1052 * \param[in] keycode Code of key
1053 * \param[in] cb Result callback
1054 * \param[in] data Callback data
1056 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1057 * \retval LB_STATUS_ERROR_BUSY Previous operation is not finished yet
1058 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1059 * \retval LB_STATUS_SUCCESS Successfully sent
1062 * \see livebox_mouse_event
1063 * \see livebox_access_event
1065 extern int livebox_key_event(struct livebox *handler, enum content_event_type type, unsigned int keycode, ret_cb_t cb, void *data);
1068 * \brief Do pin up or not.
1070 * If the livebox supports the pinup feature,
1071 * you can freeze the update of given livebox.
1072 * But it is different with pause.
1073 * The box will be updated and it will decide wheter update its content or not when the pinup is on.
1075 * \param[in] handler Handler of a livebox instance
1076 * \param[in] flag Pinup value
1077 * \param[in] cb Result callback
1078 * \param[in] data Callback data
1080 * \retval LB_STATUS_ERROR_INVALID Invalid parameters
1082 * \see livebox_set_visibility
1083 * \see livebox_is_pinned_up
1085 extern int livebox_set_pinup(struct livebox *handler, int flag, ret_cb_t cb, void *data);
1088 * \brief Check the PIN-UP status of given handler
1091 * \param[in] handler Handler of a livebox instance
1093 * \retval LB_STATUS_ERROR_INVALID Invalid parameters
1094 * \retval 1 box is pinned up
1095 * \retval 0 box is not pinned up
1096 * \see livebox_set_pinup
1098 extern int livebox_is_pinned_up(struct livebox *handler);
1101 * \brief Check the PINUP feature availability of the given handler
1104 * \param[in] handler Handler of a livebox instance
1106 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1107 * \retval 1 if the box support Pinup feature
1108 * \retval 0 if the box does not support the Pinup feature
1111 * \see livebox_is_pinned_up
1112 * \see livebox_set_pinup
1114 extern int livebox_has_pinup(struct livebox *handler);
1117 * \brief Check the PD existence of given handler
1120 * \param[in] handler Handler of a livebox instance
1122 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1123 * \retval 1 if the box support the PD
1124 * \retval 0 if the box has no PD
1129 extern int livebox_has_pd(struct livebox *handler);
1132 * \brief Create the PD of given handler
1135 * \param[in] handler Handler of a livebox instance
1136 * \param[in] cb Result callback
1137 * \param[in] data Callback data
1139 * \retval LB_STATUS_SUCCESS Successfully done
1140 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1141 * \retval LB_STATUS_ERROR_BUSY Previous operation is not finished yet
1142 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1146 * \see livebox_create_pd_with_position
1147 * \see livebox_move_pd
1148 * \see livebox_destroy_pd
1150 extern int livebox_create_pd(struct livebox *handler, ret_cb_t cb, void *data);
1153 * \brief Create the PD of given handler with the relative position from livebox
1156 * \param[in] handler Handler of a livebox instance
1157 * \param[in] x 0.0 ~ 1.0
1158 * \param[in] y 0.0 ~ 1.0
1159 * \param[in] cb Result callback
1160 * \param[in] data Callback data
1162 * \retval LB_STATUS_SUCCESS Successfully done
1163 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1164 * \retval LB_STATUS_ERROR_BUSY Previous operation is not finished yet
1165 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1168 * \see livebox_create_pd
1169 * \see livebox_destroy_pd
1170 * \see livebox_move_pd
1172 extern int livebox_create_pd_with_position(struct livebox *handler, double x, double y, ret_cb_t cb, void *data);
1175 * \brief PD position is updated.
1178 * \param[in] handler Handler of a livebox instance
1179 * \param[in] x 0.0 ~ 1.0
1180 * \param[in] y 0.0 ~ 1.0
1182 * \retval LB_STATUS_SUCCESS if succeed to send request for updating position of the PD.
1183 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1184 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1189 extern int livebox_move_pd(struct livebox *handler, double x, double y);
1192 * \brief Destroy the PD of given handler if it is created.
1195 * \param[in] handler Handler of a livebox instance
1199 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1200 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1201 * \retval LB_STATUS_SUCCESS Successfully done
1206 extern int livebox_destroy_pd(struct livebox *handler, ret_cb_t cb, void *data);
1209 * \brief Check the create status of given livebox handler
1212 * \param[in] handler Handler of a livebox instance
1214 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1215 * \retval 0 PD is not created
1216 * \retval 1 PD is created
1218 extern int livebox_pd_is_created(struct livebox *handler);
1221 * \brief Check the content type of the progressive disclosure of given handler
1224 * \param[in] handler Handler of a livebox instance
1226 * \retval PD_TYPE_BUFFER Contents of a PD is based on canvas buffer(shared)
1227 * \retval PD_TYPE_TEXT Contents of a PD is based on formatted text file
1228 * \retval PD_TYPE_PIXMAP Contents of a livebox is shared by the pixmap(depends on X)
1229 * \retval PD_TYPE_INVALID
1232 * \see livebox_pd_type
1234 extern enum livebox_pd_type livebox_pd_type(struct livebox *handler);
1237 * \brief Check the existence of a livebox about given package name
1240 * \param[in] pkgname
1242 * \retval 1 if the box is exists
1243 * \retval 0 if the box is not exists
1248 extern int livebox_is_exists(const char *pkgname);
1251 * \brief Set function table for parsing the text content of a livebox
1254 * \param[in] handler Handler of a livebox instance
1257 * \retval LB_STATUS_SUCCESS Successfully done
1258 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1259 * \see livebox_set_pd_text_handler
1261 extern int livebox_set_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
1264 * \brief Set function table for parsing the text content of a Progressive Disclosure
1267 * \param[in] handler Handler of a livebox instance
1270 * \retval LB_STATUS_SUCCESS Successfully done
1271 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1272 * \see livebox_set_text_handler
1274 extern int livebox_set_pd_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
1277 * \brief Emit a text signal to given livebox only if it is a text type.
1280 * \param[in] handler Handler of a livebox instance
1281 * \param[in] emission Emission string
1282 * \param[in] source Source string
1283 * \param[in] sx start X
1284 * \param[in] sy start Y
1285 * \param[in] ex end X
1286 * \param[in] ey end Y
1287 * \param[in] cb Result callback
1288 * \param[in] data Callback data
1290 * \retval LB_STATUS_ERROR_INVALID Invalid parameters
1291 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1292 * \retval LB_STATUS_SUCCESS Successfully emitted
1295 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);
1298 * \brief Set a private data pointer to carry it using given handler
1301 * \param[in] handler Handler of a livebox instance
1302 * \param[in] data data pointer
1304 * \retval LB_STATUS_SUCCESS Successfully registered
1305 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1308 * \see livebox_get_data
1310 extern int livebox_set_data(struct livebox *handler, void *data);
1313 * \brief Get private data pointer which is carried by given handler
1316 * \param[in] handler Handler of a livebox instance
1318 * \retval data pointer
1319 * \retval NULL if there is not data
1322 * \see livebox_set_data
1324 extern void *livebox_get_data(struct livebox *handler);
1327 * \brief Subscribe the event for liveboxes only in given cluster and sub-cluster
1329 * If you wrote a view-only client.
1330 * you can receive the event of specific liveboxes which are grouped in given cluster/category
1331 * But you cannot modify their attributes (such as size, ...).
1333 * \param[in] cluster "*" can be used for subscribe all cluster's liveboxes event.
1334 * If you use the "*", value in the category will be ignored.
1335 * \param[in] category "*" can be used for subscribe liveboxes events of all category(sub-cluster) in given "cluster"
1337 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1338 * \retval LB_STATUS_SUCCESS Successfully requested
1341 * \see livebox_unsubscribe_group
1343 extern int livebox_subscribe_group(const char *cluster, const char *category);
1346 * \brief Unsubscribe the event for the liveboxes, but you will receive already added liveboxes event.
1349 * \param[in] cluster "*" can be used for subscribe all cluster's liveboxes event.
1350 * If you use the "*", value in the category will be ignored.
1351 * \param[in] category "*" can be used for subscribe all sub-cluster's liveboxes event in given "cluster"
1353 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1354 * \retval LB_STATUS_SUCCESS Successfully requested
1357 * \see livebox_subscribe_group
1359 extern int livebox_unsubscribe_group(const char *cluster, const char *category);
1362 * \brief Refresh the group(cluster/sub-cluser(aka. category))
1364 * This function will trigger the update of all liveboxes in given cluster/category group
1366 * Basically default livebox system doesn't use the cluster/category concept.
1367 * But you can use it. so if you decide to use it then you can trigger the update of all liveboxes in given group.
1368 * \param[in] cluster Cluster ID
1369 * \param[in] category Sub-cluster ID
1370 * \param[in] force 1 if the boxes should be updated even if they are paused
1372 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1373 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1374 * \retval LB_STATUS_SUCCESS Successfully requested
1377 * \see livebox_refresh
1379 extern int livebox_refresh_group(const char *cluster, const char *category, int force);
1382 * \brief Refresh a livebox
1385 * \param[in] handler Handler of a livebox instance
1386 * \param[in] force 1 if the box should be updated even if it is paused
1388 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1389 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1390 * \retval LB_STATUS_SUCCESS Successfully requested
1393 * \see livebox_refresh_group
1395 extern int livebox_refresh(struct livebox *handler, int force);
1398 * \brief Pixmap Id of a livebox content
1400 * This function doesn't guarantees the life-cycle of the pixmap.
1401 * If the service provider destroy the pixmap, you will not know about it.
1402 * So you should validate it before access it.
1404 * \param[in] handler Handler of a livebox instance
1406 * \retval 0 if the pixmap is not created
1407 * \retval pixmap Pixmap Id need to be casted to (unsigned int) type
1410 * \see livebox_pd_pixmap
1412 extern int livebox_lb_pixmap(const struct livebox *handler);
1415 * \brief Pixmap Id of a PD content
1417 * This function doesn't guarantees the life-cycle of the pixmap.
1418 * If the service provider destroy the pixmap, you will not know about it.
1419 * So you should validate it before access it.
1421 * \param[in] handler Handler of a livebox instance
1423 * \retval 0 if the pixmap is not created
1424 * \retval pixmap Pixmap Id need to be casted to (unsigned int) type
1427 * \see livebox_lb_pixmap
1429 extern int livebox_pd_pixmap(const struct livebox *handler);
1432 * \brief Acquire the pixmap of PD
1434 * After acquire the pixmap of PD, it will not be destroyed
1435 * So if the new update is comming with new pixmap Id, you should release old pixmap manually
1437 * \param[in] handler Handler of a livebox instance.
1438 * \param[in] cb Result callback for acquiring request
1439 * \param[in] data Callback Data
1441 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1442 * \retval LB_STATUS_ERROR_FAULT Failed to send a request to the service provider or there is critical error that is unrecoverable
1443 * \retval LB_STATUS_SUCCESS Successfully requested to acquire the pixmap of PD
1446 * \see livebox_release_pd_pixmap
1447 * \see livebox_acquire_lb_pixmap
1450 extern int livebox_acquire_pd_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
1453 * \brief Release the acquired pixmap ID
1456 * \param[in] handler Handler of a livebox instance, This can be NULL, only if the handler is deleted.
1457 * \param[in] pixmap Pixmap Id to release it
1459 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1460 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1461 * \retval LB_STATUS_SUCCESS Successfully released (request is sent)
1464 * \see livebox_acquire_pd_pixmap
1465 * \see livebox_release_lb_pixmap
1467 extern int livebox_release_pd_pixmap(struct livebox *handler, int pixmap);
1470 * \brief Getting the PIXMAP of a livebox
1472 * Even if the render process release the pixmap, the pixmap will be kept before released by livebox_release_lb_pixmap
1473 * You should release the pixmap manually.
1475 * \param[in] handler Handler of a livebox instance
1476 * \param[in] cb Callback function which will be called with result of acquiring lb pixmap
1477 * \param[in] data Callback data
1479 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1480 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1481 * \retval LB_STATUS_SUCCESS Successfully requested
1483 * Livebox service system should support the PIXMAP type buffer.
1484 * The livebox should be designed to use the buffer (script type)
1486 * \see livebox_release_lb_pixmap
1487 * \see livebox_acquire_pd_pixmap
1490 extern int livebox_acquire_lb_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
1493 * \brief Release the pixmap of a livebox
1495 * After the client gets new pixmap or no more need to keep current pixmap, use this to release it.
1496 * If there is no user for given pixmap, the pixmap will be destroyed.
1498 * \param[in] handler Handler of a livebox instance, This can be NULL, only if the handler is deleted.
1499 * \param[in] pixmap Pixmap Id of given livebox handler
1501 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1502 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1503 * \retval LB_STATUS_SUCCESS Successfully done
1505 * The pixmap should be acquired by livebox_acquire_lb_pixmap
1507 * \see livebox_acquire_lb_pixmap
1508 * \see livebox_release_pd_pixmap
1510 extern int livebox_release_lb_pixmap(struct livebox *handler, int pixmap);
1513 * \brief Update the visible state of a livebox
1516 * \param[in] handler Handler of a livebox instance
1517 * \param[in] state Configure the current visible state of a livebox
1519 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1520 * \retval LB_STATUS_ERROR_BUSY
1521 * \retval LB_STATUS_ERROR_PERMISSION
1522 * \retval LB_STATUS_ERROR_ALREADY
1523 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1524 * \retval LB_STATUS_SUCCESS Successfully done
1529 extern int livebox_set_visibility(struct livebox *handler, enum livebox_visible_state state);
1532 * \brief Current visible state of a livebox
1535 * \param[in] handler Handler of a livebox instance
1536 * \return livebox_visible_state
1537 * \retval LB_SHOW Livebox is showed. Default state
1538 * \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
1539 * \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
1540 * \retval LB_VISIBLE_ERROR To enlarge the size of this enumeration type
1545 extern enum livebox_visible_state livebox_visibility(struct livebox *handler);
1548 * \brief Set the update mode of current livebox
1551 * if you set 1 for active update mode, you should get buffer without updated event from provider.
1552 * But is passive mode, you have to update content of a box when you get updated event.
1553 * Default is Passive mode.
1554 * \param[in] handler Handler of a livebox instance
1555 * \param[in] active_update 1 means active update, 0 means passive update (default)
1556 * \param[in] cb Result callback function
1557 * \param[in] data Callback data
1559 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1560 * \retval LB_STATUS_ERROR_BUSY
1561 * \retval LB_STATUS_ERROR_PERMISSION
1562 * \retval LB_STATUS_ERROR_ALREADY
1563 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1564 * \retval LB_STATUS_SUCCESS Successfully done
1569 extern int livebox_set_update_mode(struct livebox *handler, int active_update, ret_cb_t cb, void *data);
1572 * \brief Is this box in the active update mode?
1575 * \param[in] handler Handler of a livebox instance
1577 * \retval 0 if passive mode
1578 * \retval 1 if active mode or error code
1583 extern int livebox_is_active_update(struct livebox *handler);
1586 * \brief Sync manually
1589 * param[in] handler Handler of a livebox instance
1591 * \retval LB_STATUS_SUCCESS If success
1592 * \retval LB_STATUS_ERROR_INVALID Invalid handle
1595 * \see livebox_set_manual_sync
1596 * \see livebox_manual_sync
1597 * \see livebox_sync_lb_fb
1599 extern int livebox_sync_pd_fb(struct livebox *handler);
1602 * \brief Sync manually
1605 * \param[in] handler Handler of a livebox instance
1607 * \retval LB_STATUS_SUCCESS If success
1608 * \retval LB_STATUS_ERROR_INVALID Invalid handle
1611 * \see livebox_set_manual_sync
1612 * \see livebox_manual_sync
1613 * \see livebox_sync_pd_fb
1615 extern int livebox_sync_lb_fb(struct livebox *handler);
1618 * \brief Getting the alternative icon of given livebox instance.
1619 * \details If the box should be represented as a shortcut icon, this function will get the alternative icon.
1621 * \param[in] handler Handler of a livebox instance
1622 * \return const char *
1623 * \retval address Absolute path of an alternative icon file
1624 * \retval NULL Livebox has no alternative icon file
1627 * \see livebox_alt_name
1629 extern const char *livebox_alt_icon(struct livebox *handler);
1632 * \brief Getting the alternative name of given livebox instance.
1633 * \details If the box should be represented as a shortcut name, this function will get the alternative name.
1635 * \param[in] handler Handler of a livebox instance
1636 * \return const char *
1637 * \retval name Alternative name of a livebox
1638 * \retval NULL Livebox has no alternative name
1641 * \see livebox_alt_icon
1643 extern const char *livebox_alt_name(struct livebox *handler);
1646 * \brief Get the lock for frame buffer.
1648 * This function should be used to prevent from rendering to the frame buffer while reading it.
1649 * And the locking area should be short and must be released ASAP
1650 * Or the render thread will be hang'd.
1652 * \param[in] handler Handler of a livebox instance
1653 * \param[in] is_pd 1 for PD or 0
1655 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1656 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1657 * \retval LB_STATUS_SUCCESS Successfully done
1660 * \see livebox_release_fb_lock
1662 extern int livebox_acquire_fb_lock(struct livebox *handler, int is_pd);
1665 * \brief Release the lock of frame buffer
1667 * This function should be called ASAP after acquire a lock of FB.
1668 * Or the render process will be blocked.
1670 * \param[in] handler Handler of a livebox instance
1671 * \param[in] is_pd 1 for PD or 0
1673 * \retval LB_STATUS_ERROR_FAULT Unrecoverable error occurred
1674 * \retval LB_STATUS_ERROR_INVALID Invalid argument
1675 * \retval LB_STATUS_SUCCESS Successfully done
1678 * \see livebox_acquire_fb_lock
1680 extern int livebox_release_fb_lock(struct livebox *handler, int is_pd);
1683 * \brief Set options for controlling livebox sub-system.
1685 * LB_OPTION_FRAME_DROP_FOR_RESIZE
1686 * While resizing the box, viewer doesn't want to know the updated frames of old size content anymore,
1687 * In that case, turn this on, the provider will not send the updated event to the viewer about old content.
1688 * So the viewer can reduce its burden to update unnecessary frames
1689 * LB_OPTION_MANUAL_SYNC
1690 * If you don't want updates frame automatically,
1691 * Only you want reload the frames by your hands,(manually)
1693 * After turnned it on, you should sync it using
1694 * livebox_sync_pd_fb
1695 * livebox_sync_lb_pfb
1696 * LB_OPTION_SHARED_CONTENT
1697 * If this option is turnned on, even though you create a new livebox,
1698 * If there are already added same instance has same content, the instance will not be created again
1699 * Instead of creating a new instance, viewer will provides old instance with new handle.
1701 * \param[in] option option which will be affected by this call
1702 * \param[in] state new value for given option
1704 * \retval LB_STATUS_ERROR_INVALID Unknown option
1705 * \retval LB_STATUS_ERROR_FAULT Failed to change the state of option
1706 * \retval LB_STATUS_SUCCESS Successfully changed
1709 * \see livebox_get_option
1710 * \see livebox_sync_pd_fb
1711 * \see livebox_sync_lb_fb
1713 extern int livebox_set_option(enum livebox_option_type option, int state);
1716 * \brief Get options livebox sub-system
1719 * \param[in] option type of option
1721 * \retval LB_STATUS_ERROR_INVALID invalid option
1722 * \retval LB_STATUS_ERROR_FAULT Failed to get option
1723 * \retval >=0 Value of given option. must has to be >=0
1726 * \see livebox_set_option
1728 extern int livebox_option(enum livebox_option_type option);
1732 * \brief Set a handler for launching an app for auto-launch feature
1733 * \details If a user clicks a box, and the box uses auto-launch option, the launcher_handler will be called.
1735 * \param[in] launch_handler Handler for launching an app manually
1736 * \param[in] data Callback data which will be given a data for launch_handler
1743 extern int livebox_set_auto_launch_handler(int (*launch_handler)(struct livebox *handler, const char *appid, void *data), void *data);