2 * Copyright (c) 2019 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.
26 * @brief The component information handle.
29 typedef void *aul_comp_info_h;
32 * @brief Called to get the component information once for each installed component.
35 * @param[in] handle The component information handle
36 * @param[in] user_data The user data passed from the foreach function
37 * @return @c true to continue with the next iteration of the loop, \n
38 * otherwise @ false to break out of the loop
39 * @see aul_comp_info_foreach_comp_info()
40 * @see aul_comp_info_usr_foreach_comp_info()
42 typedef bool (*aul_comp_info_cb)(aul_comp_info_h handle, void *user_data);
45 * @brief Creates the component information handle.
48 * @privilege %http://tizen.org/privilege/packagemanager.info
49 * @remarks You MUST release @a handle using aul_comp_info_destroy().
51 * @param[in] comp_id The component ID
52 * @param[out] handle The component information handle
53 * @return @c 0 on success,
54 * otherwise a negative error value
56 * @remarks This function is only for App Framework internally.
58 int aul_comp_info_create(const char *comp_id, aul_comp_info_h *handle);
61 * @brief Creates the component information handle.
64 * @privilege %http://tizen.org/privilege/packagemanager.info
65 * @remarks You MUST release @a handle using aul_comp_info_destroy().
67 * @param[in] comp_id The component ID
68 * @param[in] uid The user ID
69 * @param[out] handle The component information handle
70 * @return @c 0 on success,
71 * otherwise a negative error value
73 * @remarks This function is only for App Framework internally.
75 int aul_comp_info_usr_create(const char *comp_id, uid_t uid,
76 aul_comp_info_h *handle);
79 * @brief Destroys the component information handle.
82 * @param[in] handle The component information handle
83 * @return @c 0 on success,
84 * otherwise a negative error value
86 * @remarks This function is only for App Framework internally.
88 int aul_comp_info_destroy(aul_comp_info_h handle);
91 * @brief Clones the component information handle.
93 * @remarks You MUST release @a clone using aul_comp_info_destroy().
95 * @param[in] handle The component information handle
96 * @param[out] clone A newly created component information handle, if successfully cloned
97 * @return @c 0 on success,
98 * otherwise a negative error value
100 * @remarks This function is only for App Framework internally.
102 int aul_comp_info_clone(aul_comp_info_h handle, aul_comp_info_h *clone);
105 * @brief Gets the application ID of the component.
107 * @remarks You MUST NOT release @a app_id using free().
109 * @param[in] handle The component information handle
110 * @param[out] app_id The application ID of the component
111 * @return @c 0 on success,
112 * otherwise a negative error value
114 * @remarks This function is only for App Framework internally.
116 int aul_comp_info_get_app_id(aul_comp_info_h handle, const char **app_id);
119 * @brief Gets the ID of the component.
121 * @remarks You MUST NOT release @a comp_id using free().
123 * @param[in] handle The component information handle
124 * @param[out] comp_id The ID of the component
125 * @return @c 0 on success,
126 * otherwise a negative error value
128 * @remarks This function is only for App Framework internally.
130 int aul_comp_info_get_comp_id(aul_comp_info_h handle, const char **comp_id);
133 * @brief Gets the type of the component.
135 * @remarks You MUST NOT release @a type using free().
137 * @param[in] handle The component information handle
138 * @param[out] type The type of the component
139 * @return @c 0 on success,
140 * otherwise a negative error value
142 * @remarks This function is only for App Framework internally.
144 int aul_comp_info_get_type(aul_comp_info_h handle, const char **type);
147 * @brief Gets the launch mode of the component.
149 * @remarks You MUST NOT release @a launch_mode using free().
151 * @param[in] handle The component information handle
152 * @param[out] launch_mode The launch mode of the component
153 * @return @c 0 on success,
154 * otherwise a negative error value
156 * @remarks This function is only for App Framework internally.
158 int aul_comp_info_get_launch_mode(aul_comp_info_h handle,
159 const char **launch_mode);
162 * @brief Checks whether the component is the main component or not.
165 * @param[in] handle The component information handle
166 * @param[out] main_comp @c true if the component is the main component, \n
168 * @return @c 0 on success,
169 * otherwise a negative error value
171 * @remarks This function is only for App Framework internally.
173 int aul_comp_info_is_main_comp(aul_comp_info_h handle, bool *main_comp);
176 * @brief Checks whether the icon of the component should be displayed or not.
179 * @param[in] handle The component information handle
180 * @param[out] icon_display @c true if the icon should be displayed, \n
182 * @return @c 0 on success,
183 * otherwise a negative error value
185 * @remarks This function is only for App Framework internally.
187 int aul_comp_info_is_icon_display(aul_comp_info_h handle, bool *icon_display);
190 * @brief Checks whether the component should be managed by task-manager or not.
193 * @param[in] handle The component information handle
194 * @param[out] taskmanage @c true if the component should be managed by task-manager, \n
196 * @return @c 0 on success,
197 * otherwise a negative error value
199 * @remarks This function is only for App Framework internally.
201 int aul_comp_info_is_taskmanage(aul_comp_info_h handle, bool *taskmanage);
204 * @brief Gets the icon path of the component.
206 * @remarks You MUST NOT release @a icon using free().
208 * @param[in] handle The component information handle
209 * @param[out] icon The icon path of the component
210 * @return @c 0 on success,
211 * otherwise a negative error value
213 * @remarks This function is only for App Framework internally.
215 int aul_comp_info_get_icon(aul_comp_info_h handle, const char **icon);
218 * @brief Gets the label of the component.
220 * @remarks You MUST NOT release @a label using free().
222 * @param[in] handle The component information handle
223 * @param[out] label The label of the component
224 * @return @c 0 on success,
225 * otherwise a negative error value
227 * @remarks This function is only for App Framework internally.
229 int aul_comp_info_get_label(aul_comp_info_h handle, const char **label);
232 * @brief Gets the localed label of the component.
234 * @remarks You MUST release @a label using free().
236 * @param[in] comp_id The component ID
237 * @param[in] locale The locale information
238 * @param[out] label The localed label of the component
239 * @return @c 0 on success,
240 * otherwise a negative error value
242 * @remarks This function is only for App Framework internally.
244 int aul_comp_info_get_localed_label(aul_comp_info_h handle, const char *locale,
248 * @brief Retrieves all installed components information of the specified application.
251 * @privilege %http://tizen.org/privilege/packagemanager.info
253 * @param[in] app_id The application ID
254 * @param[in] callback The callback function to invoke
255 * @param[in] user_data The user data to be passed to the callback function
256 * @return @c 0 on success,
257 * otherwise a negative error value
258 * @see aul_comp_info_cb()
260 * @remarks This function is only for App Framework internally.
262 int aul_comp_info_foreach_comp_info_from_app(const char *app_id,
263 aul_comp_info_cb callback, void *user_data);
266 * @brief Retrieves all installed components information of the specified application.
269 * @privilege %http://tizen.org/privilege/packagemanager.info
271 * @param[in] app_id The application ID
272 * @param[in] uid The user ID
273 * @param[in] callback The callback function to invoke
274 * @param[in] user_data The user data to be passed to the callback function
275 * @return @c 0 on success,
276 * otherwise a negative error value
277 * @see aul_comp_info_cb()
279 * @remarks This function is only for App Framework internally.
281 int aul_comp_info_usr_foreach_comp_info_from_app(const char *app_id, uid_t uid,
282 aul_comp_info_cb callback, void *user_data);
285 * @brief Retrieves all installed components information.
288 * @privilege %http://tizen.org/privilege/packagemanager.info
290 * @param[in] callback The callback function to invoke
291 * @param[in] user_data The user data to be passed to the callback function
292 * @return @c 0 on success,
293 * otherwise a negative error value
294 * @see aul_comp_info_cb()
296 * @remarks This function is only for App Framework internally.
298 int aul_comp_info_foreach_comp_info(aul_comp_info_cb callback, void *user_data);
301 * @brief Retrieves all installed components information.
304 * @privilege %http://tizen.org/privilege/packagemanager.info
306 * @param[in] uid The user ID
307 * @param[in] callback The callback function to invoke
308 * @param[in] user_data The user data to be passed to the callback function
309 * @return @c 0 on success,
310 * otherwise a negative error value
311 * @see aul_comp_info_cb()
313 * @remarks This function is only for App Framework internally.
315 int aul_comp_info_usr_foreach_comp_info(uid_t uid, aul_comp_info_cb callback,