sync wit master
[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_LB_SIZE_CHANGED, /*!< Livebox size is changed */
125         LB_EVENT_PD_SIZE_CHANGED, /*!< PD size is changed */
126
127         LB_EVENT_PD_CREATED, /*!< If a PD is created even if you didn't call the livebox_create_pd API */
128         LB_EVENT_PD_DESTROYED, /*!< If a PD is destroyed even if you didn't call the livebox_destroy_pd API */
129
130         LB_EVENT_IGNORED, /*!< Request is ignored */
131 };
132
133 enum livebox_fault_type {
134         LB_FAULT_DEACTIVATED, /*!< Livebox is deactivated by its fault operation */
135         LB_FAULT_PROVIDER_DISCONNECTED, /*!< Provider is disconnected */
136 };
137
138 enum livebox_visible_state { /*!< Must be sync'd with the provider */
139         LB_SHOW = 0x00, /*!< Livebox is showed. Default state */
140         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 */
141
142         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 */
143
144         LB_VISIBLE_ERROR = 0xFFFFFFFF, /* To enlarge the size of this enumeration type */
145 };
146
147 /*!
148  * \note
149  * TEXT type livebox contents handling opertators.
150  */
151 struct livebox_script_operators {
152         int (*update_begin)(struct livebox *handle); /*!< Content parser is started */
153         int (*update_end)(struct livebox *handle); /*!< Content parser is stopped */
154
155         /*!
156          * \brief
157          * Listed functions will be called when parser meets each typed component
158          */
159         int (*update_text)(struct livebox *handle, const char *id, const char *part, const char *data); /*!< Update text content */
160         int (*update_image)(struct livebox *handle, const char *id, const char *part, const char *data); /*!< Update image content */
161         int (*update_script)(struct livebox *handle, const char *id, const char *part, const char *file, const char *group); /*!< Update script content */
162         int (*update_signal)(struct livebox *handle, const char *id, const char *emission, const char *signal); /*!< Update signal */
163         int (*update_drag)(struct livebox *handle, const char *id, const char *part, double dx, double dy); /*!< Update drag info */
164         int (*update_info_size)(struct livebox *handle, const char *id, int w, int h); /*!< Update content size */
165         int (*update_info_category)(struct livebox *handle, const char *id, const char *category); /*!< Update content category info */
166 };
167
168 /*!
169  * \brief Prototype of the return callback of every async functions.
170  * \param[in] handle
171  * \param[in] ret
172  * \param[in] data
173  * \return void
174  */
175 typedef void (*ret_cb_t)(struct livebox *handle, int ret, void *data);
176
177 /*!
178  * \brief Initialize the livebox system
179  * \param[in] disp
180  * \return int
181  */
182 extern int livebox_init(void *disp);
183
184 /*!
185  * \brief Finalize the livebox system
186  * \return int
187  */
188 extern int livebox_fini(void);
189
190 /*!
191  * \brief Client is paused.
192  * \return int
193  */
194 extern int livebox_client_paused(void);
195
196 /*!
197  * \brief Client is rfesumed.
198  * \return int
199  */
200 extern int livebox_client_resumed(void);
201
202 /*!
203  * \brief Add a new livebox
204  * \param[in] pkgname
205  * \param[in] content
206  * \param[in] cluster
207  * \param[in] category
208  * \param[in] period
209  * \param[in] cb
210  * \param[in] data
211  * \return handle
212  */
213 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);
214 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);
215
216 /*!
217  * \brief Delete a livebox
218  * \param[in] handle
219  * \param[in] ret_cb_t return callback
220  * \param[in] data user data for return callback
221  * \return int
222  */
223 extern int livebox_del(struct livebox *handler, ret_cb_t cb, void *data);
224
225 /*!
226  * \brief Set a livebox events callback
227  * \param[in] cb Event handler
228  * \param[in] data User data for the event handler
229  * \return int
230  * \sa livebox_unset_event_handler
231  */
232
233 extern int livebox_set_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data), void *data);
234
235 /*!
236  * \brief Unset the livebox event handler
237  * \param[in] cb
238  * \return void * pointer of 'data' which is registered from the livebox_event_handler_set
239  * \sa livebox_set_event_handler
240  */
241 extern void *livebox_unset_event_handler(int (*cb)(struct livebox *handler, enum livebox_event_type event, void *data));
242
243 /*!
244  * \note
245  *   argument list
246  *      event, pkgname, filename, funcname
247  *
248  * \brief Live box fault event handler registeration function
249  * \param[in] cb
250  * \param[in] data
251  * \return int
252  * \sa livebox_unset_fault_handler
253  */
254 extern int livebox_set_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *), void *data);
255
256 /*!
257  * \brief Unset the live box fault event handler
258  * \param[in] cb
259  * \return pointer of 'data'
260  * \sa livebox_set_fault_handler
261  */
262 extern void *livebox_unset_fault_handler(int (*cb)(enum livebox_fault_type, const char *, const char *, const char *, void *));
263
264 /*!
265  * \brief Activate the faulted livebox.
266  * \param[in] pkgname
267  * \param[in] cb
268  * \param[in] data
269  * \return int
270  */
271 extern int livebox_activate(const char *pkgname, ret_cb_t cb, void *data);
272
273 /*!
274  * \brief Resize the livebox
275  * \param[in] handler Handler of a livebox
276  * \param[in] type Type of a livebox size, LB_SIZE_TYPE_1x1, ...
277  * \param[in] cb Result callback of the resize operation.
278  * \param[in] data User data for return callback
279  * \return int
280  */
281 extern int livebox_resize(struct livebox *handler, int type, ret_cb_t cb, void *data);
282
283 /*!
284  * \brief Send the click event for a livebox.
285  * \param[in] handler Handler of a livebox
286  * \param[in] x Rational X of the content width.
287  * \param[in] y Rational Y of the content height.
288  * \return int
289  */
290 extern int livebox_click(struct livebox *handler, double x, double y);
291
292 /*!
293  * \brief Change the cluster/sub-cluster name of given livebox handler
294  * \param[in] handler Handler of a livebox
295  * \param[in] cluster New cluster of a livebox
296  * \param[in] category New category of a livebox
297  * \param[in] cb Result callback for changing the cluster/category of a livebox
298  * \param[in] data User data for the result callback
299  * \return int
300  */
301 extern int livebox_set_group(struct livebox *handler, const char *cluster, const char *category, ret_cb_t cb, void *data);
302
303 /*!
304  * \brief Get the cluster and category(sub-cluster) name of given livebox (It is not I18N format, only english)
305  * \param[in] handler Handler of a livebox
306  * \param[out] cluster Storage(memory) for containing the cluster name
307  * \param[out] category Storage(memory) for containing the category name
308  * \return int
309  */
310 extern int livebox_get_group(struct livebox *handler, char ** const cluster, char ** const category);
311
312 /*!
313  * \brief Get the period of this livebox handler
314  * \param[in] handler Handler of a livebox
315  * \return double Current update period of a livebox
316  */
317 extern double livebox_period(struct livebox *handler);
318
319 /*!
320  * \brief Change the update period
321  * \param[in] handler Handler of a livebox
322  * \param[in] period New update period of a livebox
323  * \param[in] cb Result callback of changing the update period of this livebox
324  * \param[in] data User data for the result callback
325  * \return int
326  */
327 extern int livebox_set_period(struct livebox *handler, double period, ret_cb_t cb, void *data);
328
329 /*!
330  * \brief Is this an text type livebox?
331  * \param[in] handler
332  * \return content_type
333  */
334 extern enum livebox_lb_type livebox_lb_type(struct livebox *handler);
335
336 /*!
337  * \brief Is this livebox is created by a user?
338  * \param[in] handler
339  * \return int
340  */
341 extern int livebox_is_user(struct livebox *handler);
342
343 /*!
344  * \brief Get the content information string of given livebox
345  * \param[in] handler
346  * \return content
347  */
348 extern const char *livebox_content(struct livebox *handler);
349
350 /*!
351  * \brief Get the sub cluster title string of given livebox
352  * \param[in] handler
353  * \return sub cluster title
354  */
355 extern const char *livebox_category_title(struct livebox *handler);
356
357 /*!
358  * \brief Get the filename of given livebox, if it is an IMAGE type livebox
359  * \param[in] handler
360  * \return filename
361  */
362 extern const char *livebox_filename(struct livebox *handler);
363
364 /*!
365  * \brief Get the package name of given livebox handler
366  * \param[in] handler
367  * \return pkgname
368  */
369 extern const char *livebox_pkgname(struct livebox *handler);
370
371 /*!
372  * \brief Get the priority of a current content.
373  * \param[in] handler
374  * \return priority
375  */
376 extern double livebox_priority(struct livebox *handler);
377
378 /*!
379  * \brief Acquire the buffer of given livebox (Only for the buffer type)
380  * \param[in] handler
381  * \return address of a FB
382  */
383 extern void *livebox_acquire_fb(struct livebox *handler);
384
385 /*!
386  * \brief Release the buffer of a livebox (Only for the buffer type)
387  * \param[in] buffer
388  * \return int
389  */
390 extern int livebox_release_fb(void *buffer);
391
392 /*!
393  * \brief Get the reference count of Livebox buffer (Only for the buffer type)
394  * \param[in] buffer
395  * \return int
396  */
397 extern int livebox_fb_refcnt(void *buffer);
398
399 /*!
400  * \brief Acquire the buffer of a PD frame (Only for the buffer type)
401  * \param[in] handler
402  * \return int
403  */
404 extern void *livebox_acquire_pdfb(struct livebox *handler);
405
406 /*!
407  * \brief Release the acquired buffer of the PD Frame (Only for the buffer type)
408  * \param[in] buffer
409  * \return int
410  */
411 extern int livebox_release_pdfb(void *buffer);
412
413 /*!
414  * \brief Reference count of given PD buffer (Only for the buffer type)
415  * \param[in] buffer
416  * \return int
417  */
418 extern int livebox_pdfb_refcnt(void *buffer);
419
420 /*!
421  * \brief Get the size of the Livebox
422  * \param[in] handler
423  * \param[out] w
424  * \param[out] h
425  * \return int
426  */
427 extern int livebox_size(struct livebox *handler);
428
429 /*!
430  * \brief Get the size of the Progressive Disclosure
431  * \param[in] handler
432  * \param[out] w
433  * \param[out] h
434  * \return int
435  */
436 extern int livebox_get_pdsize(struct livebox *handler, int *w, int *h);
437
438 /*!
439  * \brief List of supported sizes of given handler
440  * \param[in] handler
441  * \param[out] cnt
442  * \param[out] w
443  * \param[out] h
444  * \return int
445  */
446 extern int livebox_get_supported_sizes(struct livebox *handler, int *cnt, int *size_list);
447
448 /*!
449  * \brief BUFFER SIZE of the livebox if it is a buffer type
450  * \param[in] handler
451  * \return int
452  */
453 extern int livebox_lbfb_bufsz(struct livebox *handler);
454
455 /*!
456  * \brief BUFFER SIZE of the progiressive disclosure if it is a buffer type
457  * \param[in] handler
458  * \return int
459  */
460 extern int livebox_pdfb_bufsz(struct livebox *handler);
461
462 /*!
463  * \brief Send the content event (for buffer type) to provider(livebox)
464  * \param[in] handler
465  * \param[in] type
466  * \param[in] x
467  * \param[in] y
468  */
469 extern int livebox_content_event(struct livebox *handler, enum content_event_type type, double x, double y);
470
471 /*!
472  * \brief Do pin up or not.
473  * \param[in] handler
474  * \param[in] flag
475  * \param[in] cb
476  * \param[in] data
477  * \return int
478  */
479 extern int livebox_set_pinup(struct livebox *handler, int flag, ret_cb_t cb, void *data);
480
481 /*!
482  * \brief Check the PIN-UP status of given handler
483  * \param[in] handler
484  * \return int
485  */
486 extern int livebox_is_pinned_up(struct livebox *handler);
487
488 /*!
489  * \brief Check the PINUP feature availability of the given handler
490  * \param[in] handler
491  * \return int
492  */
493 extern int livebox_has_pinup(struct livebox *handler);
494
495 /*!
496  * \brief Check the PD existence of given handler
497  * \param[in] handler
498  * \return int
499  */
500 extern int livebox_has_pd(struct livebox *handler);
501
502 /*!
503  * \brief Create the PD of given handler
504  * \param[in] handler
505  * \param[in] cb
506  * \param[in] data
507  * \return int
508  */
509 extern int livebox_create_pd(struct livebox *handler, ret_cb_t cb, void *data);
510
511 /*!
512  * \brief Create the PD of given handler with the relative position from livebox
513  * \param[in] handler
514  * \param[in] x 0.0 ~ 1.0
515  * \param[in] y 0.0 ~ 1.0
516  * \param[in] cb
517  * \param[in] data
518  * \return int
519  */
520 extern int livebox_create_pd_with_position(struct livebox *handler, double x, double y, ret_cb_t cb, void *data);
521
522 /*!
523  * \brief PD position is updated.
524  * \param[in] handler
525  * \param[in] x 0.0 ~ 1.0
526  * \param[in] y 0.0 ~ 1.0
527  * \return int 0 if succeed to send request for updating position of the PD.
528  */
529 extern int livebox_move_pd(struct livebox *handler, double x, double y);
530
531 /*!
532  * \brief Destroy the PD of given handler if it is created.
533  * \param[in] handler
534  * \param[in] cb
535  * \param[in] data
536  * \return int
537  */
538 extern int livebox_destroy_pd(struct livebox *handler, ret_cb_t cb, void *data);
539
540 /*!
541  * \brief Check the create status of given livebox handler
542  * \param[in] handler
543  * \return int
544  */
545 extern int livebox_pd_is_created(struct livebox *handler);
546
547 /*!
548  * \brief Check the content type of the progressive disclosure of given handler
549  * \param[in] handler
550  * \return int
551  */
552 extern enum livebox_pd_type livebox_pd_type(struct livebox *handler);
553
554 /*!
555  * \brief Check the existence of a livebox about given package name
556  * \param[in] pkgname
557  * \return int
558  */
559 extern int livebox_is_exists(const char *pkgname);
560
561 /*!
562  * \brief Set function table for parsing the text content of a livebox
563  * \param[in] handler
564  * \param[in] ops
565  * \return int
566  */
567 extern int livebox_set_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
568
569 /*!
570  * \brief Set function table for parsing the text content of a Progressive Disclosure
571  * \param[in] handler
572  * \param[in] ops
573  * \return int
574  */
575 extern int livebox_set_pd_text_handler(struct livebox *handler, struct livebox_script_operators *ops);
576
577 /*!
578  * \brief Emit a text signal to given livebox only if it is a text type.
579  * \param[in] handler
580  * \param[in] emission
581  * \param[in] source
582  * \param[in] sx
583  * \param[in] sy
584  * \param[in] ex
585  * \param[in] ey
586  * \param[in] cb
587  * \param[in] data
588  */
589 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);
590
591 /*!
592  * \brief Set a private data pointer to carry it using given handler
593  * \param[in] handler
594  * \param[in] data
595  * \return int
596  */
597 extern int livebox_set_data(struct livebox *handler, void *data);
598
599 /*!
600  * \brief Get private data pointer which is carried by given handler
601  * \param[in] handler
602  * \return int
603  */
604 extern void *livebox_get_data(struct livebox *handler);
605
606 /*!
607  * \brief Subscribe the event for liveboxes only in given cluster and sub-cluster
608  * \param[in] cluster   "*" can be used for subscribe all cluster's liveboxes event.
609  *                      If you use the "*", value in the category will be ignored.
610  * \param[in] category  "*" can be used for subscribe liveboxes events of all category(sub-cluster) in given "cluster"
611  * \return int Success 0, fails error code
612  */
613 extern int livebox_subscribe_group(const char *cluster, const char *category);
614
615 /*!
616  * \brief Unsubscribe the event for the liveboxes, but you will receive already added liveboxes event.
617  * \param[in] cluster   "*" can be used for subscribe all cluster's liveboxes event.
618  *                      If you use the "*", value in the category will be ignored.
619  * \param[in] category  "*" can be used for subscribe all sub-cluster's liveboxes event in given "cluster"
620  * \return int Success 0, fails error code
621  */
622 extern int livebox_unsubscribe_group(const char *cluster, const char *category);
623
624 /*!
625  * \brief Refresh the group(cluster/sub-cluser(aka. category))
626  * \param[in] cluster Cluster ID
627  * \param[in] category Sub-cluster ID
628  * \return int Success 0 or negative value
629  */
630 extern int livebox_refresh_group(const char *cluster, const char *category);
631
632 /*!
633  * \brief Refresh a livebox
634  * \param[in] handler
635  * \return int Success 0 or negative value
636  */
637 extern int livebox_refresh(struct livebox *handler);
638
639 /*!
640  * \brief Pixmap Id of a livebox content
641  * \param[in] handler
642  * \return int
643  * \sa livebox_pd_pixmap
644  */
645 extern int livebox_lb_pixmap(const struct livebox *handler);
646
647 /*!
648  * \brief Pixmap Id of a PD content
649  * \param[in] handler
650  * \return int
651  * \sa livebox_lb_pixmap
652  */
653 extern int livebox_pd_pixmap(const struct livebox *handler);
654
655 /*!
656  * \brief
657  * \param[in] handler
658  * \param[in] cb
659  * \param[in] data
660  * \return int
661  * \sa livebox_release_pd_pixmap
662  * \sa livebox_acquire_lb_pixmap
663  */
664 extern int livebox_acquire_pd_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
665
666 /*!
667  * \brief Release the acquired pixmap ID
668  * \param[in] handler
669  * \param[in] pixmap
670  * \return int
671  * \sa livebox_acquire_pd_pixmap
672  * \sa livebox_release_lb_pixmap
673  */
674 extern int livebox_release_pd_pixmap(struct livebox *handler, int pixmap);
675
676 /*!
677  * \brief
678  * \param[in] handler
679  * \param[in] cb
680  * \param[in] data
681  * \return int
682  * \sa livebox_release_lb_pixmap
683  * \sa livebox_acquire_pd_pixmap
684  */
685 extern int livebox_acquire_lb_pixmap(struct livebox *handler, ret_cb_t cb, void *data);
686
687 /*!
688  * \brief
689  * \param[in] handler
690  * \param[in] pixmap
691  * \return int
692  * \sa livebox_acquire_lb_pixmap
693  * \sa livebox_release_pd_pixmap
694  */
695 extern int livebox_release_lb_pixmap(struct livebox *handler, int pixmap);
696
697 /*!
698  * \brief Update the visible state of a livebox
699  * \param[in] handler Handler of a livebox
700  * \param[in] state Configure the current visible state of a livebox
701  * \return int
702  */
703 extern int livebox_set_visibility(struct livebox *handler, enum livebox_visible_state state);
704
705 /*!
706  * \brief Current visible state of a livebox
707  * \param[in] handler Handler of a livebox
708  * \return enum visible state
709  */
710 extern enum livebox_visible_state livebox_visibility(struct livebox *handler);
711
712 #ifdef __cplusplus
713 }
714 #endif
715
716 #endif
717 /* End of a file */