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()
40 * @see aul_comp_info_usr_foreach()
42 typedef bool (*aul_comp_info_cb)(aul_comp_info_h handle, void *user_data);
45 * @brief Creates the component information handle.
47 * @remarks You MUST release @a handle using aul_comp_info_destroy().
49 * @param[in] comp_id The component ID
50 * @param[out] handle The component information handle
51 * @return @c 0 on success,
52 * otherwise a negative error value
54 * @remarks This function is only for App Framework internally.
56 int aul_comp_info_create(const char *comp_id, aul_comp_info_h *handle);
59 * @brief Creates the component information handle.
61 * @remarks You MUST release @a handle using aul_comp_info_destroy().
63 * @param[in] comp_id The component ID
64 * @param[in] uid The user ID
65 * @param[out] handle The component information handle
66 * @return @c 0 on success,
67 * otherwise a negative error value
69 * @remarks This function is only for App Framework internally.
71 int aul_comp_info_create_usr(const char *comp_id, uid_t uid,
72 aul_comp_info_h *handle);
75 * @brief Destroys the component information handle.
78 * @param[in] handle The component information handle
79 * @return @c 0 on success,
80 * otherwise a negative error value
82 * @remarks This function is only for App Framework internally.
84 int aul_comp_info_destroy(aul_comp_info_h handle);
87 * @brief Clones the component information handle.
89 * @remarks You MUST release @a clone using aul_comp_info_destroy().
91 * @param[in] handle The component information handle
92 * @param[out] clone A newly created component information handle, if successfully cloned
93 * @return @c 0 on success,
94 * otherwise a negative error value
96 * @remarks This function is only for App Framework internally.
98 int aul_comp_info_clone(aul_comp_info_h handle, aul_comp_info_h *clone);
101 * @brief Gets the application ID of the component.
103 * @remarks You MUST NOT release @a app_id using free().
105 * @param[in] handle The component information handle
106 * @param[out] app_id The application ID of the component
107 * @return @c 0 on success,
108 * otherwise a negative error value
110 * @remarks This function is only for App Framework internally.
112 int aul_comp_info_get_app_id(aul_comp_info_h handle, const char **app_id);
115 * @brief Gets the ID of the component.
117 * @remarks You MUST NOT release @a comp_id using free().
119 * @param[in] handle The component information handle
120 * @param[out] comp_id The ID of the component
121 * @return @c 0 on success,
122 * otherwise a negative error value
124 * @remarks This function is only for App Framework internally.
126 int aul_comp_info_get_comp_id(aul_comp_info_h handle, const char **comp_id);
129 * @brief Gets the type of the component.
131 * @remarks You MUST NOT release @a type using free().
133 * @param[in] handle The component information handle
134 * @param[out] type The type of the component
135 * @return @c 0 on success,
136 * otherwise a negative error value
138 * @remarks This function is only for App Framework internally.
140 int aul_comp_info_get_type(aul_comp_info_h handle, const char **type);
143 * @brief Gets the launch mode of the component.
145 * @remarks You MUST NOT release @a launch_mode using free().
147 * @param[in] handle The component information handle
148 * @param[out] launch_mode The launch mode of the component
149 * @return @c 0 on success,
150 * otherwise a negative error value
152 * @remarks This function is only for App Framework internally.
154 int aul_comp_info_get_launch_mode(aul_comp_info_h handle,
155 const char **launch_mode);
158 * @brief Checks whether the component is the main component or not.
161 * @param[in] handle The component information handle
162 * @param[out] main_comp @c true if the component is the main component, \n
164 * @return @c 0 on success,
165 * otherwise a negative error value
167 * @remarks This function is only for App Framework internally.
169 int aul_comp_info_is_main_comp(aul_comp_info_h handle, bool *main_comp);
172 * @brief Checks whether the icon of the component should be displayed or not.
175 * @param[in] handle The component information handle
176 * @param[out] icon_display @c true if the icon should be displayed, \n
178 * @return @c 0 on success,
179 * otherwise a negative error value
181 * @remarks This function is only for App Framework internally.
183 int aul_comp_info_is_icon_display(aul_comp_info_h handle, bool *icon_display);
186 * @brief Checks whether the component should be managed by task-manager or not.
189 * @param[in] handle The component information handle
190 * @param[out] taskmanage @c true if the component should be managed by task-manager, \n
192 * @return @c 0 on success,
193 * otherwise a negative error value
195 * @remarks This function is only for App Framework internally.
197 int aul_comp_info_is_taskmanage(aul_comp_info_h handle, bool *taskmanage);
200 * @brief Gets the icon path of the component.
202 * @remarks You MUST NOT release @a icon using free().
204 * @param[in] handle The component information handle
205 * @param[out] icon The icon path of the component
206 * @return @c 0 on success,
207 * otherwise a negative error value
209 * @remarks This function is only for App Framework internally.
211 int aul_comp_info_get_icon(aul_comp_info_h handle, const char **icon);
214 * @brief Gets the label of the component.
216 * @remarks You MUST NOT release @a label using free().
218 * @param[in] handle The component information handle
219 * @param[out] label The label of the component
220 * @return @c 0 on success,
221 * otherwise a negative error value
223 * @remarks This function is only for App Framework internally.
225 int aul_comp_info_get_label(aul_comp_info_h handle, const char **label);
228 * @brief Gets the localed label of the component.
230 * @remarks You MUST release @a label using free().
232 * @param[in] comp_id The component ID
233 * @param[in] locale The locale information
234 * @param[out] label The localed label of the component
235 * @return @c 0 on success,
236 * otherwise a negative error value
238 * @remarks This function is only for App Framework internally.
240 int aul_comp_info_get_localed_label(const char *comp_id, const char *locale,
244 * @brief Gets the localed label of the component.
246 * @remarks You MUST release @a label using free().
248 * @param[in] comp_id The component ID
249 * @param[in] locale The locale information
250 * @param[in] uid The user ID
251 * @param[out] label The localed label of the component
252 * @return @c 0 on success,
253 * otherwise a negative error value
255 * @remarks This function is only for App Framework internally.
257 int aul_comp_info_get_usr_localed_label(const char *comp_id, const char *locale,
258 uid_t uid, char **label);
261 * @brief Retrieves all installed components information of the specified application.
264 * @param[in] app_id The application ID
265 * @param[in] callback The callback function to invoke
266 * @param[in] user_data The user data to be passed to the callback function
267 * @return @c 0 on success,
268 * otherwise a negative error value
269 * @see aul_comp_info_cb()
271 * @remarks This function is only for App Framework internally.
273 int aul_comp_info_foreach(const char *app_id, aul_comp_info_cb callback,
277 * @brief Retrieves all installed components information of the specified application.
280 * @param[in] app_id The application ID
281 * @param[in] uid The user ID
282 * @param[in] callback The callback function to invoke
283 * @param[in] user_data The user data to be passed to the callback function
284 * @return @c 0 on success,
285 * otherwise a negative error value
286 * @see aul_comp_info_cb()
288 * @remarks This function is only for App Framework internally.
290 int aul_comp_info_foreach_usr(const char *app_id, uid_t uid,
291 aul_comp_info_cb callback, void *user_data);