Add livebox update interface.
[platform/framework/web/livebox-viewer.git] / include / livebox.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.tizenopensource.org/license
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __LIVEBOX_H
18 #define __LIVEBOX_H
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 struct livebox;
25
26 /*!
27  * \note size list
28  * 172x172
29  * 348x172
30  * 348x348
31  * 700x348
32  * 700x172
33  * 700x700
34  */
35 #define DEFAULT_PERIOD -1.0f
36
37 enum content_event_type {
38         CONTENT_EVENT_MOUSE_DOWN        = 0x00000001, /*!< LB mouse down event for livebox */
39         CONTENT_EVENT_MOUSE_UP          = 0x00000002, /*!< LB mouse up event for livebox */
40         CONTENT_EVENT_MOUSE_MOVE        = 0x00000004, /*!< LB mouse move event for livebox */
41         CONTENT_EVENT_MOUSE_ENTER       = 0x00000008, /*!< LB mouse enter event for livebox */
42         CONTENT_EVENT_MOUSE_LEAVE       = 0x00000010, /*!< LB mouse leave event for livebox */
43
44         CONTENT_EVENT_ACCESS_READ       = 0x00000100, /*!< LB accessibility read for livebox */
45         CONTENT_EVENT_ACCESS_READ_NEXT  = 0x00000200, /*!< LB accessibility read next for livebox */
46         CONTENT_EVENT_ACCESS_READ_PREV  = 0x00000400, /*!< LB accessibility read prev for livebox */
47         CONTENT_EVENT_ACCESS_ACTIVATE   = 0x00000800, /*!< LB accessibility activate */
48         CONTENT_EVENT_ACCESS_UP         = 0x00001000, /*!< LB accessibility up */
49         CONTENT_EVENT_ACCESS_DOWN       = 0x00002000, /*!< LB accessibility down */
50
51         CONTENT_EVENT_KEY_DOWN          = 0x00100000, /*!< LB key press */
52         CONTENT_EVENT_KEY_UP            = 0x00200000, /*!< LB key release */
53
54         CONTENT_EVENT_KEY_MASK          = 0x80000000,
55         CONTENT_EVENT_ACCESS_MASK       = 0x40000000,
56         CONTENT_EVENT_MOUSE_MASK        = 0x20000000,
57         CONTENT_EVENT_PD_MASK           = 0x10000000,
58         CONTENT_EVENT_LB_MASK           = 0x00000000,
59
60         LB_MOUSE_DOWN                   = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_DOWN,
61         LB_MOUSE_UP                     = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UP,
62         LB_MOUSE_MOVE                   = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_MOVE,
63         LB_MOUSE_ENTER                  = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_ENTER,
64         LB_MOUSE_LEAVE                  = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_LEAVE,
65
66         PD_MOUSE_DOWN                   = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_DOWN,
67         PD_MOUSE_UP                     = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_UP,
68         PD_MOUSE_MOVE                   = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_MOVE,
69         PD_MOUSE_ENTER                  = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_ENTER,
70         PD_MOUSE_LEAVE                  = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_MOUSE_MASK | CONTENT_EVENT_MOUSE_LEAVE,
71
72         LB_ACCESS_READ                  = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_ACCESS_MASK | CONTENT_EVENT_ACCESS_READ,
73         LB_ACCESS_READ_NEXT             = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_ACCESS_MASK | CONTENT_EVENT_ACCESS_READ_NEXT,
74         LB_ACCESS_READ_PREV             = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_ACCESS_MASK | CONTENT_EVENT_ACCESS_READ_PREV,
75         LB_ACCESS_ACTIVATE              = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_ACCESS_MASK | CONTENT_EVENT_ACCESS_ACTIVATE,
76         LB_ACCESS_UP                    = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_ACCESS_MASK | CONTENT_EVENT_ACCESS_UP,
77         LB_ACCESS_DOWN                  = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_ACCESS_MASK | CONTENT_EVENT_ACCESS_DOWN,
78
79         PD_ACCESS_READ                  = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_ACCESS_MASK | CONTENT_EVENT_ACCESS_READ,
80         PD_ACCESS_READ_NEXT             = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_ACCESS_MASK | CONTENT_EVENT_ACCESS_READ_NEXT,
81         PD_ACCESS_READ_PREV             = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_ACCESS_MASK | CONTENT_EVENT_ACCESS_READ_PREV,
82         PD_ACCESS_ACTIVATE              = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_ACCESS_MASK | CONTENT_EVENT_ACCESS_ACTIVATE,
83         PD_ACCESS_UP                    = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_ACCESS_MASK | CONTENT_EVENT_ACCESS_UP,
84         PD_ACCESS_DOWN                  = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_ACCESS_MASK | CONTENT_EVENT_ACCESS_DOWN,
85
86         LB_KEY_DOWN                     = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_DOWN,
87         LB_KEY_UP                       = CONTENT_EVENT_LB_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_UP,
88
89         PD_KEY_DOWN                     = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_DOWN,
90         PD_KEY_UP                       = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_UP,
91
92         CONTENT_EVENT_MAX       = 0xFFFFFFFF,
93 };
94
95 /* Exported to user app */
96 enum livebox_lb_type {
97         LB_TYPE_IMAGE = 0x01, /*!< Contents of a livebox is based on the image file */
98         LB_TYPE_BUFFER = 0x02, /*!< Contents of a livebox is based on canvas buffer(shared) */
99         LB_TYPE_TEXT = 0x04, /*!< Contents of a livebox is based on formatted text file */
100         LB_TYPE_PIXMAP = 0x08, /*!< Contens of a livebox is shared by the pixmap(depends on X) */
101
102         LB_TYPE_INVALID = 0xFF,
103 };
104
105 enum livebox_pd_type {
106         PD_TYPE_BUFFER = 0x01, /*!< Contents of a PD is based on canvas buffer(shared) */
107         PD_TYPE_TEXT = 0x02, /*!< Contents of a PD is based on formatted text file */
108         PD_TYPE_PIXMAP = 0x04, /*!< Contents of a livebox is shared by the pixmap(depends on X) */
109
110         PD_TYPE_INVALID = 0xFF,
111 };
112
113 enum livebox_event_type { /*!< livebox_event_handler_set Event list */
114         LB_EVENT_LB_UPDATED, /*!< Contents of the given livebox is updated */
115         LB_EVENT_PD_UPDATED, /*!< Contents of the given pd is updated */
116
117         LB_EVENT_CREATED, /*!< A new livebox is created */
118         LB_EVENT_DELETED, /*!< A livebox is deleted */
119
120         LB_EVENT_GROUP_CHANGED, /*!< Group (Cluster/Sub-cluster) information is changed */
121         LB_EVENT_PINUP_CHANGED, /*!< PINUP status is changed */
122         LB_EVENT_PERIOD_CHANGED, /*!< Update period is changed */
123
124         LB_EVENT_PD_CREATED, /*!< If a PD is created even if you didn't call the livebox_create_pd API */
125         LB_EVENT_PD_DESTROYED, /*!< If a PD is destroyed even if you didn't call the livebox_destroy_pd API */
126
127         LB_EVENT_IGNORED, /*!< Request is ignored */
128 };
129
130 enum livebox_fault_type {
131         LB_FAULT_DEACTIVATED, /*!< Livebox is deactivated by its fault operation */
132         LB_FAULT_PROVIDER_DISCONNECTED, /*!< Provider is disconnected */
133 };
134
135 enum livebox_visible_state { /*!< Must be sync'd with the provider */
136         LB_SHOW = 0x00, /*!< Livebox is showed. Default state */
137         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 */
138
139         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 */
140
141         LB_VISIBLE_ERROR = 0xFFFFFFFF, /* To enlarge the size of this enumeration type */
142 };
143
144 /*!
145  * \note
146  * TEXT type livebox contents handling opertators.
147  */
148 struct livebox_script_operators {
149         int (*update_begin)(struct livebox *handle); /*!< Content parser is started */
150         int (*update_end)(struct livebox *handle); /*!< Content parser is stopped */
151
152         /*!
153          * \brief
154          * Listed functions will be called when parser meets each typed component
155          */
156         int (*update_text)(struct livebox *handle, const char *id, const char *part, const char *data); /*!< Update text content */
157         int (*update_image)(struct livebox *handle, const char *id, const char *part, const char *data); /*!< Update image content */
158         int (*update_script)(struct livebox *handle, const char *id, const char *part, const char *file, const char *group); /*!< Update script content */
159         int (*update_signal)(struct livebox *handle, const char *id, const char *emission, const char *signal); /*!< Update signal */
160         int (*update_drag)(struct livebox *handle, const char *id, const char *part, double dx, double dy); /*!< Update drag info */
161         int (*update_info_size)(struct livebox *handle, const char *id, int w, int h); /*!< Update content size */
162         int (*update_info_category)(struct livebox *handle, const char *id, const char *category); /*!< Update content category info */
163 };
164
165 /*!
166  * \brief Prototype of the return callback of every async functions.
167  * \param[in] handle
168  * \param[in] ret
169  * \param[in] data
170  * \return void
171  */
172 typedef void (*ret_cb_t)(struct livebox *handle, int ret, void *data);
173
174 /*!
175  * \brief Initialize the livebox system
176  * \param[in] disp
177  * \return int
178  */
179 extern int livebox_init(void *disp);
180
181 /*!
182  * \brief Finalize the livebox system
183  * \return int
184  */
185 extern int livebox_fini(void);
186
187 /*!
188  * \brief Add a new livebox
189  * \param[in] pkgname
190  * \param[in] content
191  * \param[in] cluster
192  * \param[in] category
193  * \param[in] period
194  * \param[in] cb
195  * \param[in] data
196  * \return handle
197  */
198 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);
199 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);
200
201 /*!
202  * \brief Delete a livebox
203  * \param[in] handle
204  * \param[in] ret_cb_t return callback
205  * \param[in] data user data for return callback
206  * \return int
207  */
208 extern int livebox_del(struct livebox *handler, ret_cb_t cb, void *data);
209
210 /*!
211  * \brief Set a livebox events callback
212  * \param[in] cb Event handler
213  * \param[in] data User data for the event handler
214  * \return int
215  * \sa livebox_unset_event_handler
216  */
217
218 extern int livebox_set_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data), void *data);
219
220 /*!
221  * \brief Unset the livebox event handler
222  * \param[in] cb
223  * \return void * pointer of 'data' which is registered from the livebox_event_handler_set
224  * \sa livebox_set_event_handler
225  */
226 extern void *livebox_unset_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data));
227
228 /*!
229  * \note
230  *   argument list
231  *      event, pkgname, filename, funcname
232  *
233  * \brief Live box fault event handler registeration function
234  * \param[in] cb
235  * \param[in] data
236  * \return int
237  * \sa livebox_unset_fault_handler
238  */
239 extern int livebox_set_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *), void *data);
240
241 /*!
242  * \brief Unset the live box fault event handler
243  * \param[in] cb
244  * \return pointer of 'data'
245  * \sa livebox_set_fault_handler
246  */
247 extern void *livebox_unset_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *));
248
249 /*!
250  * \brief Activate the faulted livebox.
251  * \param[in] pkgname
252  * \param[in] cb
253  * \param[in] data
254  * \return int
255  */
256 extern int livebox_activate(const char *pkgname, ret_cb_t cb, void *data);
257
258 /*!
259  * \brief Resize the livebox
260  * \param[in] handler Handler of a livebox
261  * \param[in] type Type of a livebox size, LB_SIZE_TYPE_1x1, ...
262  * \param[in] cb Result callback of the resize operation.
263  * \param[in] data User data for return callback
264  * \return int
265  */
266 extern int livebox_resize(struct livebox *handler, int type, ret_cb_t cb, void *data);
267
268 /*!
269  * \brief Send the click event for a livebox.
270  * \param[in] handler Handler of a livebox
271  * \param[in] x Rational X of the content width.
272  * \param[in] y Rational Y of the content height.
273  * \return int
274  */
275 extern int livebox_click(struct livebox *handler, double x, double y);
276
277 /*!
278  * \brief Change the cluster/sub-cluster name of given livebox handler
279  * \param[in] handler Handler of a livebox
280  * \param[in] cluster New cluster of a livebox
281  * \param[in] category New category of a livebox
282  * \param[in] cb Result callback for changing the cluster/category of a livebox
283  * \param[in] data User data for the result callback
284  * \return int
285  */
286 extern int livebox_set_group(struct livebox *handler, const char *cluster, const char *category, ret_cb_t cb, void *data);
287
288 /*!
289  * \brief Get the cluster and category(sub-cluster) name of given livebox (It is not I18N format, only english)
290  * \param[in] handler Handler of a livebox
291  * \param[out] cluster Storage(memory) for containing the cluster name
292  * \param[out] category Storage(memory) for containing the category name
293  * \return int
294  */
295 extern int livebox_get_group(struct livebox *handler, char ** const cluster, char ** const category);
296
297 /*!
298  * \brief Get the period of this livebox handler
299  * \param[in] handler Handler of a livebox
300  * \return double Current update period of a livebox
301  */
302 extern double livebox_period(struct livebox *handler);
303
304 /*!
305  * \brief Change the update period
306  * \param[in] handler Handler of a livebox
307  * \param[in] period New update period of a livebox
308  * \param[in] cb Result callback of changing the update period of this livebox
309  * \param[in] data User data for the result callback
310  * \return int
311  */
312 extern int livebox_set_period(struct livebox *handler, double period, ret_cb_t cb, void *data);
313
314 /*!
315  * \brief Is this an text type livebox?
316  * \param[in] handler
317  * \return content_type
318  */
319 extern enum livebox_lb_type livebox_lb_type(struct livebox *handler);
320
321 /*!
322  * \brief Is this livebox is created by a user?
323  * \param[in] handler
324  * \return int
325  */
326 extern int livebox_is_user(struct livebox *handler);
327
328 /*!
329  * \brief Get the content information string of given livebox
330  * \param[in] handler
331  * \return content
332  */
333 extern const char *livebox_content(struct livebox *handler);
334
335 /*!
336  * \brief Get the sub cluster title string of given livebox
337  * \param[in] handler
338  * \return sub cluster title
339  */
340 extern const char *livebox_category_title(struct livebox *handler);
341
342 /*!
343  * \brief Get the filename of given livebox, if it is an IMAGE type livebox
344  * \param[in] handler
345  * \return filename
346  */
347 extern const char *livebox_filename(struct livebox *handler);
348
349 /*!
350  * \brief Get the package name of given livebox handler
351  * \param[in] handler
352  * \return pkgname
353  */
354 extern const char *livebox_pkgname(struct livebox *handler);
355
356 /*!
357  * \brief Get the priority of a current content.
358  * \param[in] handler
359  * \return priority
360  */
361 extern double livebox_priority(struct livebox *handler);
362
363 /*!
364  * \brief Acquire the buffer of given livebox (Only for the buffer type)
365  * \param[in] handler
366  * \return address of a FB
367  */
368 extern void *livebox_acquire_fb(struct livebox *handler);
369
370 /*!
371  * \brief Release the buffer of a livebox (Only for the buffer type)
372  * \param[in] buffer
373  * \return int
374  */
375 extern int livebox_release_fb(void *buffer);
376
377 /*!
378  * \brief Get the reference count of Livebox buffer (Only for the buffer type)
379  * \param[in] buffer
380  * \return int
381  */
382 extern int livebox_fb_refcnt(void *buffer);
383
384 /*!
385  * \brief Acquire the buffer of a PD frame (Only for the buffer type)
386  * \param[in] handler
387  * \return int
388  */
389 extern void *livebox_acquire_pdfb(struct livebox *handler);
390
391 /*!
392  * \brief Release the acquired buffer of the PD Frame (Only for the buffer type)
393  * \param[in] buffer
394  * \return int
395  */
396 extern int livebox_release_pdfb(void *buffer);
397
398 /*!
399  * \brief Reference count of given PD buffer (Only for the buffer type)
400  * \param[in] buffer
401  * \return int
402  */
403 extern int livebox_pdfb_refcnt(void *buffer);
404
405 /*!
406  * \brief Get the size of the Livebox
407  * \param[in] handler
408  * \param[out] w
409  * \param[out] h
410  * \return int
411  */
412 extern int livebox_size(struct livebox *handler);
413
414 /*!
415  * \brief Get the size of the Progressive Disclosure
416  * \param[in] handler
417  * \param[out] w
418  * \param[out] h
419  * \return int
420  */
421 extern int livebox_get_pdsize(struct livebox *handler, int *w, int *h);
422
423 /*!
424  * \brief List of supported sizes of given handler
425  * \param[in] handler
426  * \param[out] cnt
427  * \param[out] w
428  * \param[out] h
429  * \return int
430  */
431 extern int livebox_get_supported_sizes(struct livebox *handler, int *cnt, int *size_list);
432
433 /*!
434  * \brief BUFFER SIZE of the livebox if it is a buffer type
435  * \param[in] handler
436  * \return int
437  */
438 extern int livebox_lbfb_bufsz(struct livebox *handler);
439
440 /*!
441  * \brief BUFFER SIZE of the progiressive disclosure if it is a buffer type
442  * \param[in] handler
443  * \return int
444  */
445 extern int livebox_pdfb_bufsz(struct livebox *handler);
446
447 /*!
448  * \brief Send the content event (for buffer type) to provider(livebox)
449  * \param[in] handler
450  * \param[in] type
451  * \param[in] x
452  * \param[in] y
453  */
454 extern int livebox_content_event(struct livebox *handler, enum content_event_type type, double x, double y);
455
456 /*!
457  * \brief Do pin up or not.
458  * \param[in] handler
459  * \param[in] flag
460  * \param[in] cb
461  * \param[in] data
462  * \return int
463  */
464 extern int livebox_set_pinup(struct livebox *handler, int flag, ret_cb_t cb, void *data);
465
466 /*!
467  * \brief Check the PIN-UP status of given handler
468  * \param[in] handler
469  * \return int
470  */
471 extern int livebox_is_pinned_up(struct livebox *handler);
472
473 /*!
474  * \brief Check the PINUP feature availability of the given handler
475  * \param[in] handler
476  * \return int
477  */
478 extern int livebox_has_pinup(struct livebox *handler);
479
480 /*!
481  * \brief Check the PD existence of given handler
482  * \param[in] handler
483  * \return int
484  */
485 extern int livebox_has_pd(struct livebox *handler);
486
487 /*!
488  * \brief Create the PD of given handler
489  * \param[in] handler
490  * \param[in] cb
491  * \param[in] data
492  * \return int
493  */
494 extern int livebox_create_pd(struct livebox *handler, ret_cb_t cb, void *data);
495
496 /*!
497  * \brief Create the PD of given handler with the relative position from livebox
498  * \param[in] handler
499  * \param[in] x 0.0 ~ 1.0
500  * \param[in] y 0.0 ~ 1.0
501  * \param[in] cb
502  * \param[in] data
503  * \return int
504  */
505 extern int livebox_create_pd_with_position(struct livebox *handler, double x, double y, ret_cb_t cb, void *data);
506
507 /*!
508  * \brief Destroy the PD of given handler if it is created.
509  * \param[in] handler
510  * \param[in] cb
511  * \param[in] data
512  * \return int
513  */
514 extern int livebox_destroy_pd(struct livebox *handler, ret_cb_t cb, void *data);
515
516 /*!
517  * \brief Check the create status of given livebox handler
518  * \param[in] handler
519  * \return int
520  */
521 extern int livebox_pd_is_created(struct livebox *handler);
522
523 /*!
524  * \brief Check the content type of the progressive disclosure of given handler
525  * \param[in] handler
526  * \return int
527  */
528 extern enum livebox_pd_type livebox_pd_type(struct livebox *handler);
529
530 /*!
531  * \brief Check the existence of a livebox about given package name
532  * \param[in] pkgname
533  * \return int
534  */
535 extern int livebox_is_exists(const char *pkgname);
536
537 /*!
538  * \brief Set function table for parsing the text content of a livebox
539  * \param[in] handler
540  * \param[in] ops
541  * \return int
542  */
543 extern int livebox_set_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
544
545 /*!
546  * \brief Set function table for parsing the text content of a Progressive Disclosure
547  * \param[in] handler
548  * \param[in] ops
549  * \return int
550  */
551 extern int livebox_set_pd_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
552
553 /*!
554  * \brief Emit a text signal to given livebox only if it is a text type.
555  * \param[in] handler
556  * \param[in] emission
557  * \param[in] source
558  * \param[in] sx
559  * \param[in] sy
560  * \param[in] ex
561  * \param[in] ey
562  * \param[in] cb
563  * \param[in] data
564  */
565 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);
566
567 /*!
568  * \brief Set a private data pointer to carry it using given handler
569  * \param[in] handler
570  * \param[in] data
571  * \return int
572  */
573 extern int livebox_set_data(struct livebox *handler, void *data);
574
575 /*!
576  * \brief Get private data pointer which is carried by given handler
577  * \param[in] handler
578  * \return int
579  */
580 extern void *livebox_get_data(struct livebox *handler);
581
582 /*!
583  * \brief Subscribe the event for liveboxes only in given cluster and sub-cluster
584  * \param[in] cluster   "*" can be used for subscribe all cluster's liveboxes event.
585  *                      If you use the "*", value in the category will be ignored.
586  * \param[in] category  "*" can be used for subscribe liveboxes events of all category(sub-cluster) in given "cluster"
587  * \return int Success 0, fails error code
588  */
589 extern int livebox_subscribe_group(const char *cluster, const char *category);
590
591 /*!
592  * \brief Unsubscribe the event for the liveboxes, but you will receive already added liveboxes event.
593  * \param[in] cluster   "*" can be used for subscribe all cluster's liveboxes event.
594  *                      If you use the "*", value in the category will be ignored.
595  * \param[in] category  "*" can be used for subscribe all sub-cluster's liveboxes event in given "cluster"
596  * \return int Success 0, fails error code
597  */
598 extern int livebox_unsubscribe_group(const char *cluster, const char *category);
599
600 /*!
601  * \brief Refresh the group(cluster/sub-cluser(aka. category))
602  * \param[in] cluster Cluster ID
603  * \param[in] category Sub-cluster ID
604  * \return int Success 0 or negative value
605  */
606 extern int livebox_refresh_group(const char *cluster, const char *category);
607
608 /*!
609  * \brief Refresh a livebox
610  * \param[in] handler
611  * \return int Success 0 or negative value
612  */
613 extern int livebox_refresh(struct livebox *handler);
614
615 /*!
616  * \brief Pixmap Id of a livebox content
617  * \param[in] handler
618  * \return int
619  * \sa livebox_pd_pixmap
620  */
621 extern int livebox_lb_pixmap(const struct livebox *handler);
622
623 /*!
624  * \brief Pixmap Id of a PD content
625  * \param[in] handler
626  * \return int
627  * \sa livebox_lb_pixmap
628  */
629 extern int livebox_pd_pixmap(const struct livebox *handler);
630
631 /*!
632  * \brief
633  * \param[in] handler
634  * \param[in] cb
635  * \param[in] data
636  * \return int
637  * \sa livebox_release_pd_pixmap
638  * \sa livebox_acquire_lb_pixmap
639  */
640 extern int livebox_acquire_pd_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
641
642 /*!
643  * \brief Release the acquired pixmap ID
644  * \param[in] handler
645  * \param[in] pixmap
646  * \return int
647  * \sa livebox_acquire_pd_pixmap
648  * \sa livebox_release_lb_pixmap
649  */
650 extern int livebox_release_pd_pixmap(struct livebox *handler, int pixmap);
651
652 /*!
653  * \brief
654  * \param[in] handler
655  * \param[in] cb
656  * \param[in] data
657  * \return int
658  * \sa livebox_release_lb_pixmap
659  * \sa livebox_acquire_pd_pixmap
660  */
661 extern int livebox_acquire_lb_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
662
663 /*!
664  * \brief
665  * \param[in] handler
666  * \param[in] pixmap
667  * \return int
668  * \sa livebox_acquire_lb_pixmap
669  * \sa livebox_release_pd_pixmap
670  */
671 extern int livebox_release_lb_pixmap(struct livebox *handler, int pixmap);
672
673 /*!
674  * \brief Update the visible state of a livebox
675  * \param[in] handler Handler of a livebox
676  * \param[in] state Configure the current visible state of a livebox
677  * \return int
678  */
679 extern int livebox_set_visibility(struct livebox *handler, enum livebox_visible_state state);
680
681 /*!
682  * \brief Current visible state of a livebox
683  * \param[in] handler Handler of a livebox
684  * \return enum visible state
685  */
686 extern enum livebox_visible_state livebox_visibility(struct livebox *handler);
687
688 #ifdef __cplusplus
689 }
690 #endif
691
692 #endif
693 /* End of a file */