2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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.
28 * @brief Enumeration for Resource Types
32 AUL_RESOURCE_TYPE_IMAGE = 0, /**<Image*/
33 AUL_RESOURCE_TYPE_LAYOUT, /**<Edje*/
34 AUL_RESOURCE_TYPE_SOUND, /**<Sound*/
35 AUL_RESOURCE_TYPE_BIN, /**<Bin*/
36 AUL_RESOURCE_TYPE_MIN = AUL_RESOURCE_TYPE_IMAGE,
37 AUL_RESOURCE_TYPE_MAX = AUL_RESOURCE_TYPE_BIN,
38 /*add values between AUL_RESOURCE_TYPE_MIN and AUL_RESOURCE_TYPE_MAX*/
42 * @brief Enumeration for Aul Resource Manager Error.
46 AUL_RESOURCE_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
47 AUL_RESOURCE_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
48 AUL_RESOURCE_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
49 AUL_RESOURCE_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
50 } aul_resource_error_e;
53 * @brief Creates resource manager and get from db.
56 * @remarks If resource manager is already exist,
57 * It will just return APP_RESOURCE_ERROR_NONE
58 * @return @c 0 on success,
59 * otherwise a negative error value
60 * @retval #AUL_RESOURCE_ERROR_NONE Successful
61 * @retval #AUL_RESOURCE_ERROR_IO_ERROR IO Internal I/O Error
62 * @retval #AUL_RESOURCE_ERROR_OUT_OF_MEMORY Out of memeory
63 * @see aul_resource_manager_release()
65 int aul_resource_manager_init(void);
68 * @brief Creates resource manager and make valid filelist from given attributes.
71 * @remarks If resource manager is already exist,
72 * It will just return APP_RESOURCE_ERROR_NONE
73 * This function should called from resource slice tool only.
74 * @param[in] rsc_folder_path path of resource.
75 * @param[in] b bundle which contain attributes about target device.
76 * @return @c 0 on success,
77 * otherwise a negative error value
78 * @retval #AUL_RESOURCE_ERROR_NONE Successful
79 * @retval #AUL_RESOURCE_ERROR_IO_ERROR IO Internal I/O Error
80 * @retval #AUL_RESOURCE_ERROR_OUT_OF_MEMORY Out of memeory
81 * @see aul_resource_manager_release()
83 int aul_resource_manager_init_slice(const char *rsc_folder_path, bundle *b);
86 * @brief Convert resource ID to path name
89 * @remarks If resource manager is not created yet,
90 * aul_resource_manager_init() will be invoked automatically.
91 * Caller should free the returned pointer.
92 * @param[in] type Resource type @see aul_resource_e
93 * @param[in] id Resource ID
94 * @param[out] path The name of requested resource on success, otherwise NULL
95 * @return @c 0 on success,
96 * otherwise a negative error value
97 * @retval #AUL_RESOURCE_ERROR_NONE Successful
98 * @retval #AUL_RESOURCE_ERROR_INVALID_PARAMETER Invalid Parameter
99 * @retval #AUL_RESOURCE_ERROR_IO_ERROR Internal I/O Error
100 * @see aul_resource_manager_init()
102 int aul_resource_manager_get(aul_resource_e type, const char *id, char **path);
105 * @brief Destroys resource manager.
108 * @remarks Please make sure that the instance of resource manager should be released when the application is closing only.
109 * It is highly recommended way to improve run-time performance.
110 * @return @c 0 on success,
111 * otherwise a negative error value
112 * @retval #AUL_RESOURCE_ERROR_NONE Successful
113 * @see aul_resource_manager_init()
115 int aul_resource_manager_release(void);
118 * @brief Get valid file path list.
121 * @remarks Please make sure that the instance of resource manager should be released when the application is closing only.
122 * It is highly recommended way to improve run-time performance.
123 * @return @c 0 on success,
124 * otherwise a negative error value
125 * @retval #AUL_RESOURCE_ERROR_NONE Successful
126 * @see aul_resource_manager_init()
128 int aul_resource_manager_get_path_list(GHashTable **list);