2 * Copyright 2012 Samsung Electronics Co., Ltd
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
8 * http://www.tizenopensource.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.
17 #ifndef __LIVEBOX_HELPER_H
18 #define __LIVEBOX_HELPER_H
24 struct livebox_buffer; /* Defined by provider */
28 * Return values of livebox programming interfaces.
30 extern const int DONE; /*!< Operation is successfully done */
31 extern const int NEED_TO_SCHEDULE; /*!< Need to call the livebox_need_to_update and livebox_update_content */
32 extern const int OUTPUT_UPDATED; /*!< Contents is updated */
33 extern const int NEED_TO_CREATE; /*!< Need to create a new instance */
34 extern const int NEED_TO_DESTROY; /*!< Need to destroy this instance */
36 extern const int LB_SYS_EVENT_FONT_CHANGED; /*!< System font is changed */
37 extern const int LB_SYS_EVENT_LANG_CHANGED; /*!< System language is changed */
38 extern const int LB_SYS_EVENT_TIME_CHANGED; /*!< System time is changed */
39 extern const int LB_SYS_EVENT_PAUSED;
40 extern const int LB_SYS_EVENT_RESUMED;
42 #define LB_DESC_TYPE_TEXT "text"
43 #define LB_DESC_TYPE_IMAGE "image"
44 #define LB_DESC_TYPE_SIGNAL "signal"
45 #define LB_DESC_TYPE_INFO "info"
46 #define LB_DESC_TYPE_DRAG "drag"
47 #define LB_DESC_TYPE_SCRIPT "script"
51 * Extra event informatino for livebox_content_event interface function
59 } pointer; /*!< Down/Up state and mouse position */
66 } part; /*!< Geometry of event received part */
73 * \brief Update a description file.
78 extern struct livebox_desc *livebox_desc_open(const char *filename, int for_pd);
81 * \brief Complete the description file updating
85 extern int livebox_desc_close(struct livebox_desc *handle);
88 * \brief Set the category information of current description data
94 extern int livebox_desc_set_category(struct livebox_desc *handle, const char *id, const char *category);
97 * \brief Set the content size
104 extern int livebox_desc_set_size(struct livebox_desc *handle, const char *id, int w, int h);
107 * \breif Set the target id of given block
108 * Only available for the script block
114 extern int livebox_desc_set_id(struct livebox_desc *handle, int idx, const char *id);
117 * \brief Add a new block
119 * \param[in] id ID of source script object
120 * \param[in] type image|text|script|signal|...
121 * \param[in] part target part to update with given content(data)
122 * \param[in] data content for specified part
123 * \param[in] group script group name
124 * \return idx Index of current description block
126 extern int livebox_desc_add_block(struct livebox_desc *handle, const char *id, const char *type, const char *part, const char *data, const char *group);
129 * \brief Delete a added block
131 * \param[in] idx Index of added block
134 extern int livebox_desc_del_block(struct livebox_desc *handle, int idx);
137 * \brief Replace '\n' with '<br>'
138 * \param[in] str Source string
139 * \return char* allocated string
141 extern char *livebox_util_nl2br(const char *str);
145 * Interfaces for direct buffer management (Available only for the PD area)
149 #ifndef __PROVIDER_BUFFER_H
152 * This enumeration value should be sync'd with provider
155 BUFFER_EVENT_ENTER, /*!< */
156 BUFFER_EVENT_LEAVE, /*!< */
157 BUFFER_EVENT_DOWN, /*!< */
158 BUFFER_EVENT_MOVE, /*!< */
159 BUFFER_EVENT_UP, /*!< */
165 * \param[in] filename
172 extern struct livebox_buffer *livebox_acquire_buffer(const char *filename, int is_pd, int width, int height, int (*handler)(struct livebox_buffer *, enum buffer_event, double, double, double, void *), void *data);
175 * \param[in] filename
178 extern unsigned long livebox_pixmap_id(struct livebox_buffer *handle);
185 extern int livebox_release_buffer(struct livebox_buffer *handle);
190 * \return void* buffer
192 extern void *livebox_ref_buffer(struct livebox_buffer *handle);
199 extern int livebox_unref_buffer(void *buffer);
206 extern int livebox_sync_buffer(struct livebox_buffer *handle);
210 * \param[in] filename
213 extern int livebox_request_update(const char *filename);