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.
17 #ifndef __LIVEBOX_HELPER_H
18 #define __LIVEBOX_HELPER_H
28 * @brief This file declares API of liblivebox library
32 * @addtogroup CAPI_LIVEBOX_HELPER_MODULE
37 * @brief Definition for COLOR BLOCK.
39 #define LB_DESC_TYPE_COLOR "color"
42 * @brief Definition for TEXT BLOCK.
44 #define LB_DESC_TYPE_TEXT "text"
47 * @brief Definition for IMAGE BLOCK.
49 #define LB_DESC_TYPE_IMAGE "image"
52 * @brief Definition for SIGNAL BLOCK.
54 #define LB_DESC_TYPE_SIGNAL "signal"
57 * @brief Definition for INFO BLOCK.
59 #define LB_DESC_TYPE_INFO "info"
62 * @brief Definition for DRAG BLOCK.
64 #define LB_DESC_TYPE_DRAG "drag"
67 * @brief Definition for SCRIPT SCRIPT.
69 #define LB_DESC_TYPE_SCRIPT "script"
72 * @brief Definition for ACCESSIBILITY INFORMATION BLOCK.
74 #define LB_DESC_TYPE_ACCESS "access"
77 * @brief Definition for accessibility operation.
79 #define LB_DESC_TYPE_ACCESS_OPERATION "access,operation"
82 * @brief Definition for set highlight on specified part.
84 #define LB_DESC_DATA_ACCESS_OPERATION_HL_SET "set,hl"
87 * @brief Definition for remove highlight from specified part.
89 #define LB_DESC_DATA_ACCESS_OPERATION_HL_UNSET "unset,hl"
92 * @brief Definition for move the highlight to next part.
94 #define LB_DESC_DATA_ACCESS_OPERATION_HL_NEXT "next,hl"
97 * @brief Definition for move the highlight to previous part.
99 #define LB_DESC_DATA_ACCESS_OPERATION_HL_PREV "prev,hl"
102 * @brief Definition for reset the chain of accessibility highlight list.
104 #define LB_DESC_DATA_ACCESS_OPERATION_RESET "reset,focus"
107 * @brief Definition for specify the highlight move option.
108 * @details If the highlight list reaches to the last object, move back to the first object.
110 #define LB_DESC_OPTION_ACCESS_HL_LOOP "cycle"
113 * @brief Definition for specify the highlight move option.
114 * @details If the highlight list reaches to the last object(or the first object),
115 * the "prev,hl", "next,hl" will be failed.
117 #define LB_DESC_OPTION_ACCESS_HL_NOLOOP "no,cycle"
120 * @brief Livebox description data handle.
125 * @brief Updates a description file.
126 * @remarks Must be used only by Inhouse livebox.
127 * @param[in] filename
130 * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
131 * @return Handle of desc instance
132 * @pre Should be loaded by data-provider-slave.
133 * @post Should be destroyed(flushed) using livebox_desc_close() API.
134 * @see livebox_desc_close()
136 extern struct livebox_desc *livebox_desc_open(const char *filename, int for_pd);
139 * @brief Completes the description file update.
140 * @details Only if this API is called, the description data will be applied to the content of livebox (or PD).
141 * @remarks Must be used only by Inhouse livebox.
142 * @param[in] handle Handle which is created by livebox_desc_open() function
144 * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
146 * @retval #LB_STATUS_SUCCESS If the flushing description data is successfully done
147 * @retval #LB_STATUS_ERROR_INVALID If the given handle is not valid
148 * @pre Handle must be created by livebox_desc_open()
149 * @post Handle must not be used after return from this function.
150 * @see livebox_desc_open()
152 extern int livebox_desc_close(struct livebox_desc *handle);
155 * @brief Sets the category information of current description data.
156 * @details Creates a new description block for updating category information of layout object.
157 * @param[in] handle Handle which is created by livebox_desc_open() function
158 * @param[in] id Id string of target object
159 * @param[in] category Category string that will be used by layout object
162 * @retval #LB_STATUS_ERROR_INVALID Invalid handle
163 * @retval #LB_STATUS_ERROR_MEMORY Memory is not enough to add this block
164 * @retval index Index(>=0) of added block, which can be used by livebox_desc_set_id()
165 * @pre Must be called after create a handle using livebox_desc_open()
166 * @see livebox_desc_set_id()
168 extern int livebox_desc_set_category(struct livebox_desc *handle, const char *id, const char *category);
171 * @brief Sets the content size.
172 * @details Sets the content size of layout.
173 * @param[in] handle Handle which is created by livebox_desc_open() function
174 * @param[in] id Id string of target object
175 * @param[in] w Width in pixel
176 * @param[in] h Height in pixel
179 * @retval #LB_STATUS_ERROR_INVALID Invalid argument
180 * @retval #LB_STATUS_ERROR_MEMORY Not enough memory to add a new block
181 * @retval index Index(>=0) of added block Successfully added
182 * @see livebox_desc_open()
183 * @see livebox_desc_set_id()
185 extern int livebox_desc_set_size(struct livebox_desc *handle, const char *id, int w, int h);
188 * @brief Sets the target id of the given block.
189 * @details Only available for the script block.
190 * @param[in] handle Handle which is created by livebox_desc_open() function
191 * @param[in] idx Index of target block
192 * @param[in] id Id String which will be used by other livebox_desc_XXX functions
195 * @retval #LB_STATUS_SUCCESS Id is successfully updated for given idx of desc block
196 * @retval #LB_STATUS_ERROR_INVALID Invalid argument
197 * @retval #LB_STATUS_ERROR_NOT_EXIST Given index of desc block is not exists
198 * @pre Desc block should be exists which has given index "idx".
199 * @post Specified Id string("id") can be used by other livebox_desc_XXXX functions.
200 * @see livebox_desc_open()
201 * @see livebox_desc_set_id()
203 extern int livebox_desc_set_id(struct livebox_desc *handle, int idx, const char *id);
206 * @brief Adds a new block.
207 * @param[in] handle Handle which is created by the livebox_desc_open() function
208 * @param[in] id ID of source script object
209 * @param[in] type Type (image|text|script|signal|.. etc)
210 * @param[in] part Target part to update with given content(data)
211 * @param[in] data Content for specified part
212 * @param[in] option Option for the block. (script: group, image: option, ...)
214 * @return Index of current description block
215 * @retval #LB_STATUS_ERROR_INVALID Invalid argument
216 * @retval #LB_STATUS_ERROR_MEMORY Not enough memory to add a new desc block
217 * @retval index Index(>=0) of added desc block
218 * @pre Handle must be created using livebox_desc_open.
219 * @see livebox_desc_set_id()
220 * @see livebox_desc_del_block()
222 extern int livebox_desc_add_block(struct livebox_desc *handle, const char *id, const char *type, const char *part, const char *data, const char *option);
225 * @brief Deletes an added block.
226 * @details If you discard the added desc block, use this API and the index of the created desc block.
227 * @param[in] handle Handle which is created by livebox_desc_open() function
228 * @param[in] idx Index of added block, returned from livebox_desc_add_block(), livebox_desc_set_size(), livebox_desc_set_category(), etc
231 * @retval #LB_STATUS_SUCCESS Successfully deleted
232 * @retval #LB_STATUS_ERROR_NOT_EXIST Given index of desc block is not exists
233 * @pre Index must be exists.
234 * @see livebox_desc_add_block()
235 * @see livebox_desc_open()
237 extern int livebox_desc_del_block(struct livebox_desc *handle, int idx);
240 * @brief Creates an Evas_Object to create an elm_win object.
241 * @details Creating a new Evas_Object using livebox frame buffer.
242 * @param[in] id Instance Id
243 * @param[in] is_pd 1 if this object is created for PD or 0 (for LB)
245 * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
246 * @return Evas_Object* Evas Object type
247 * @retval Address Valid evas object
248 * @retval @c NULL failed to create
250 extern Evas_Object *livebox_get_evas_object(const char *id, int is_pd);
253 * @brief Set extra information for updated content.
255 * If the provider should give some hints to the viewer,
256 * such as title, icon and name, this function can set them.
257 * provider will send those information to the viewer when the
258 * content is updated.
259 * @remarks This function only works with the buffer type inhouse provider.
260 * @param[in] id Livebox Instance Id
261 * @param[in] content Content string that will pass to a livebox via livebox_create interface when it is re-created.
262 * @param[in] title Human readable text for accessitility, summarized text for representing the content of a box.
263 * @param[in] icon Path of icon image file - alternative image content
264 * @param[in] name Name of a box - alternative text content
267 * @retval #LB_STATUS_ERROR_MEMORY Out of memory
268 * @retval #LB_STATUS_ERROR_INVALID Invalid parameters
269 * @retval #LB_STATUS_ERROR_FAULT Unrecoverable error
270 * @retval #LB_STATUS_SUCCESS Successfully sent
272 extern int livebox_set_extra_info(const char *id, const char *content, const char *title, const char *icon, const char *name);