2 * Copyright (c) 2011 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.
18 #ifndef __TIZEN_APPFW_PACKAGE_INFO_H
19 #define __TIZEN_APPFW_PACKAGE_INFO_H
28 * @file package_info.h
32 * @addtogroup CAPI_PACKAGE_INFO_MODULE
38 * @brief The package information handle.
41 typedef struct package_info_s *package_info_h;
44 * @brief The package update information handle.
47 typedef struct package_updateinfo_s *package_updateinfo_h;
50 * @brief The required privilege handle.
52 * @see package_info_foreach_required_privilege()
54 typedef struct allowed_package_required_privilege_s *allowed_package_required_privilege_h;
57 * @brief Enumeration for storage type.
61 PACKAGE_INFO_INTERNAL_STORAGE = 0, /**< Internal storage */
62 PACKAGE_INFO_EXTERNAL_STORAGE = 1, /**< External storage */
63 PACKAGE_INFO_EXTENDED_STORAGE = 2, /**< Extended storage (Since 5.0) */
64 } package_info_installed_storage_type_e;
68 * @brief Enumeration for app component type.
72 PACKAGE_INFO_ALLAPP = 0, /**< All applications
73 (Deprecated since 5.5, use #PACKAGE_INFO_APP_COMPONENT_TYPE_ALL instead) */
74 PACKAGE_INFO_UIAPP = 1, /**< UI application
75 (Deprecated since 5.5, use #PACKAGE_INFO_APP_COMPONENT_TYPE_UI instead) */
76 PACKAGE_INFO_SERVICEAPP = 2, /**< Service application
77 (Deprecated since 5.5, use #PACKAGE_INFO_APP_COMPONENT_TYPE_SERVICE instead) */
78 PACKAGE_INFO_WIDGETAPP = 3, /**< Widget application (Since 4.0)
79 (Deprecated since 5.5, use #PACKAGE_INFO_APP_COMPONENT_TYPE_WIDGET instead) */
80 PACKAGE_INFO_WATCHAPP = 4, /**< Watch application (Since 4.0)
81 (Deprecated since 5.5, use #PACKAGE_INFO_APP_COMPONENT_TYPE_WATCH instead) */
83 PACKAGE_INFO_APP_COMPONENT_TYPE_ALL = 0, /**< All applications (Since 5.5) */
84 PACKAGE_INFO_APP_COMPONENT_TYPE_UI = 1, /**< UI application (Since 5.5) */
85 PACKAGE_INFO_APP_COMPONENT_TYPE_SERVICE = 2, /**< Service application (Since 5.5) */
86 PACKAGE_INFO_APP_COMPONENT_TYPE_WIDGET = 3, /**< Widget application (Since 5.5) */
87 PACKAGE_INFO_APP_COMPONENT_TYPE_WATCH = 4, /**< Watch application (Since 5.5) */
88 PACKAGE_INFO_APP_COMPONENT_TYPE_COMPONENT_BASED = 5, /**< Component-based application (Since 5.5) */
89 } package_info_app_component_type_e;
93 * @brief Enumeration for certification type.
97 PACKAGE_INFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
98 PACKAGE_INFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
99 PACKAGE_INFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
100 PACKAGE_INFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
101 PACKAGE_INFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
102 PACKAGE_INFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
103 PACKAGE_INFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< Distributor2 Root Certificate*/
104 PACKAGE_INFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< Distributor2 Intermediate Certificate*/
105 PACKAGE_INFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< Distributor2 Signer Certificate*/
106 } package_cert_type_e;
109 * @brief Enumeration for package update info type.
113 PACKAGE_UPDATEINFO_TYPE_NONE = 0, /**< None type */
114 PACKAGE_UPDATEINFO_TYPE_FORCE, /**< Force type */
115 PACKAGE_UPDATEINFO_TYPE_OPTIONAL /**< Optional type */
116 } package_updateinfo_type_e;
119 * @brief Called for each update information of all packages.
121 * @remarks @a info should not be freed and can be used only in the callback.
122 * @param[in] info The package update information handle
123 * @param[in] user_data The user data passed from the foreach function
124 * @return @c true to continue with the next iteration of the loop,
125 * otherwise @c false to break out of the loop
126 * @pre package_info_updateinfo_foreach_info() will invoke this callback.
127 * @see package_info_updateinfo_foreach_info()
129 typedef bool (*package_info_updateinfo_cb) (package_updateinfo_h info, void *user_data);
132 * @brief Called to get the application ID once for each installed package.
134 * @param[in] comp_type The application component type
135 * @param[in] app_id The application ID.
136 * @param[in] user_data The user data passed from the foreach function
137 * @return @c true to continue with the next iteration of the loop,
138 * otherwise @c false to break out of the loop
139 * @pre package_info_foreach_app_from_package() will invoke this callback.
140 * @see package_info_foreach_app_from_package()
142 typedef bool (*package_info_app_cb) (package_info_app_component_type_e comp_type, const char *app_id, void *user_data);
146 * @brief Called to get the certification information.
148 * @param[in] handle The package info handle
149 * @param[in] cert_type The certificate type
150 * @param[in] cert_value The certificate value of corresponding certificate key \n
151 * This value is base64 encoded data.
152 * @param[in] user_data The user data passed from the foreach function
153 * @return @c true to continue with the next iteration of the loop,
154 * otherwise @c false to break out of the loop
155 * @pre package_info_foreach_cert_info() will invoke this callback.
156 * @see package_info_foreach_cert_info()
158 typedef bool (*package_info_cert_info_cb) (package_info_h handle, package_cert_type_e cert_type, const char *cert_value, void *user_data);
162 * @brief Called to get the privilege information.
164 * @param[in] privilege_name the name of the privilege
165 * @param[in] user_data The user data passed from the foreach function
166 * @return @c true to continue with the next iteration of the loop,
167 * otherwise @c false to break out of the loop
168 * @pre package_info_foreach_privilege_info() will invoke this callback.
169 * @see package_info_foreach_privilege_info()
171 typedef bool (*package_info_privilege_info_cb) (const char *privilege_name, void *user_data);
175 * @brief Called when dependency information between packages is retrieved.
177 * @remarks @a from, @a to, @a type and @a required_version are managed by the platform and will be released after the callback exits.
178 * @param[in] from The ID of package that depends on another
179 * @param[in] to The ID of package that is required by another
180 * @param[in] type The type of dependency
181 * @param[in] required_version The required version
182 * @param[in] user_data The user data passed from the foreach function
183 * @return @c true to continue with the next iteration of the loop,
184 * otherwise @c false to break out of the loop
185 * @pre package_info_foreach_dependency_info() will invoke this callback.
186 * @pre package_info_foreach_dependency_info_depends_on() will invoke this callback.
187 * @see package_info_foreach_dependency_info()
188 * @see package_info_foreach_dependency_info_depends_on()
190 typedef bool (*package_info_dependency_info_cb) (const char *from, const char *to, const char *type, const char *required_version, void *user_data);
194 * @brief Called to get the allowed package information of resource package.
196 * @remarks @a allowed_package, @a privilege_handle are managed by the platform and will be released after the callback exits.
197 * @param[in] allowed_package The ID of allowed package
198 * @param[in] privilege_handle The privilege handle required by resource package
199 * @param[in] user_data The user data passed from the foreach function
200 * @return @c true to continue with the next iteration of the loop,
201 * otherwise @c false to break out of the loop
202 * @pre package_info_foreach_res_allowed_package() will invoke this callback.
203 * @see package_info_foreach_res_allowed_package()
205 typedef bool (*package_info_res_allowed_package_cb) (const char *allowed_package, allowed_package_required_privilege_h privilege_handle, void *user_data);
209 * @brief Retrieves all application IDs of each package.
211 * @param[in] package_info The package info handle
212 * @param[in] comp_type The application component type
213 * @param[in] callback The callback function to invoke
214 * @param[in] user_data The user data to be passed to the callback function
215 * @return @c 0 on success,
216 * otherwise a negative error value
217 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
218 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
219 * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE No such package
220 * @post This function invokes package_info_app_cb() repeatedly for each package.
221 * @see package_info_app_cb()
223 int package_info_foreach_app_from_package(package_info_h package_info, package_info_app_component_type_e comp_type, package_info_app_cb callback, void *user_data);
227 * @brief Destroys the package information handle and releases all its resources.
229 * @param[in] package_info The package information handle
230 * @return @c 0 on success,
231 * otherwise a negative error value
232 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
233 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
234 * @see package_manager_foreach_package_info()
235 * @see package_manager_get_package_info()
237 int package_info_destroy(package_info_h package_info);
241 * @brief Gets the package name.
243 * @remarks You must release @a package using free().
244 * @param[in] package_info The package information
245 * @param[out] package The package name
246 * @return @c 0 on success,
247 * otherwise a negative error value
248 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
249 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
250 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
252 int package_info_get_package(package_info_h package_info, char **package);
256 * @brief Gets the main application ID of the package.
258 * @remarks You must release @a main_app_id using free().
259 * @param[in] package_info The package information
260 * @param[out] main_app_id The main application ID of the package
261 * @return @c 0 on success,
262 * otherwise a negative error value
263 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
264 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
265 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
266 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
268 int package_info_get_main_app_id(package_info_h package_info, char **main_app_id);
272 * @brief Gets the label of the package.
274 * @remarks You must release @a label using free().
275 * @param[in] package_info The package information
276 * @param[out] label The label of the package
277 * @return @c 0 on success,
278 * otherwise a negative error value
279 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
280 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
281 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
282 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
284 int package_info_get_label(package_info_h package_info, char **label);
288 * @brief Gets the absolute path to the icon image.
290 * @remarks You must release @a path using free().
291 * @param[in] package_info The package information
292 * @param[out] path The path of the package
293 * @return @c 0 on success,
294 * otherwise a negative error value
295 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
296 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
297 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
298 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
300 int package_info_get_icon(package_info_h package_info, char **path);
304 * @brief Gets the version of the package.
306 * @remarks You must release @a version using free().
307 * @param[in] package_info The package information
308 * @param[out] version The version of the package
309 * @return @c 0 on success,
310 * otherwise a negative error value
311 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
312 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
313 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
314 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
316 int package_info_get_version(package_info_h package_info, char **version);
320 * @brief Gets the type of the package.
322 * @remarks You must release @a type using free().
323 * @param[in] package_info The package information
324 * @param[out] type The type of the package
325 * @return @c 0 on success,
326 * otherwise a negative error value
327 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
328 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
329 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
330 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
332 int package_info_get_type(package_info_h package_info, char **type);
336 * @brief Gets the installed storage for the given package.
338 * @param[in] package_info The package information
339 * @param[out] storage The installed storage
340 * @return @c 0 on success,
341 * otherwise a negative error value
342 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
343 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
345 int package_info_get_installed_storage(package_info_h package_info, package_info_installed_storage_type_e *storage);
349 * @brief Gets the root path of the package.
351 * @remarks You must release @a path using free().
352 * @param[in] package_info The package information
353 * @param[out] path The root path of the package
354 * @return @c 0 on success,
355 * otherwise a negative error value
356 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
357 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
358 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
359 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
361 int package_info_get_root_path(package_info_h package_info, char **path);
366 * @brief Gets the name of the TEP (Tizen Expansion Package).
367 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
368 * @privlevel platform
369 * @privilege %http://tizen.org/privilege/packagemanager.admin
370 * @remarks Name must be released using free().
371 * @param[in] package_info The package information
372 * @param[out] name The name of the tep
373 * @return 0 on success,
374 * otherwise a negative error value
375 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
376 * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
377 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
378 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
379 * @retval #PACKAGE_MANAGER_ERROR_SYSTEM_ERROR Severe system error
381 int package_info_get_tep_name(package_info_h package_info, char **name);
385 * @brief Gets the resource type of the package.
387 * @remarks You must release @a res_type using free().
388 * @param[in] package_info The package information
389 * @param[out] res_type The resource type of the package
390 * @return @c 0 on success,
391 * otherwise a negative error value
392 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
393 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
394 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
395 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
397 int package_info_get_res_type(package_info_h package_info, char **res_type);
401 * @brief Gets the resource version of the package.
403 * @remarks You must release @a res_version using free().
404 * @param[in] package_info The package information
405 * @param[out] res_version The resource version of the package
406 * @return @c 0 on success,
407 * otherwise a negative error value
408 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
409 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
410 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
411 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
413 int package_info_get_res_version(package_info_h package_info, char **res_version);
417 * @brief Checks whether the package is system package.
419 * @param[in] package_info The package information
420 * @param[out] system @c true if the package is system package,
421 * otherwise @c false if the package is not system package
422 * @return @c 0 on success,
423 * otherwise a negative error value
424 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
425 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
426 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
427 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
429 int package_info_is_system_package(package_info_h package_info, bool *system);
433 * @brief Checks whether the package is removable.
435 * @param[in] package_info The package information
436 * @param[out] removable The removable info of the package
437 * @return @c 0 on success,
438 * otherwise a negative error value
439 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
440 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
441 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
442 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR IO error
444 int package_info_is_removable_package(package_info_h package_info, bool *removable);
448 * @brief Checks whether the package is preloaded.
450 * @param[in] package_info The package information
451 * @param[out] preload The preload info of the package
452 * @return @c 0 on success,
453 * otherwise a negative error value
454 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
455 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
456 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
457 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
459 int package_info_is_preload_package(package_info_h package_info, bool *preload);
463 * @brief Checks whether two package information is equal.
465 * @param[in] lhs The first package information to be compared
466 * @param[in] rhs The second package information to be compared
467 * @param[out] equal @c true if the package information are equal,
468 * otherwise @c false if package information are not equal
469 * @return @c 0 on success,
470 * otherwise a negative error value
471 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
472 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
473 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
474 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR Database error occurred
476 int package_info_is_equal(package_info_h lhs, package_info_h rhs, bool *equal);
480 * @brief Checks whether the package info is accessible for the given package.
482 * @param[in] package_info The package information
483 * @param[out] accessible @c true if the package info is accessible,
484 * otherwise @c false if the package info is not accessible
485 * @return @c 0 on success,
486 * otherwise a negative error value
487 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
488 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
490 int package_info_is_accessible(package_info_h package_info, bool *accessible);
493 * @brief Gets the installed time for the given package.
494 * @details If the package was updated, the @a installed_time represents updated time.
495 * So, the meaning of 'installed time' corresponds with 'last modified time'.
497 * @param[in] package_info The package information
498 * @param[out] installed_time The integer value of time_t type for installed time
499 * @return @c 0 on success,
500 * otherwise a negative error value
501 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
502 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
503 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR Database error occurred
505 int package_info_get_installed_time(package_info_h package_info, int *installed_time);
508 * @brief Clones the package information handle.
510 * @remarks The @a clone should be released using package_info_destroy().
511 * @param[out] clone The newly created package information handle
512 * @param[in] package_info The package information
513 * @return @c 0 on success,
514 * otherwise a negative error value
515 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
516 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
517 * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE The package is not installed
518 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
520 int package_info_clone(package_info_h *clone, package_info_h package_info);
523 * @brief Gets the package information for the given package.
525 * @remarks You must release @a package_info using package_info_destroy().
526 * @param[in] package The ID of the package
527 * @param[out] package_info The package information for the given package ID
528 * @return @c 0 on success,
529 * otherwise a negative error value
530 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
531 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
532 * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE The package is not installed
533 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
535 int package_info_create(const char *package, package_info_h *package_info);
539 * @brief Retrieves certification information of the package.
541 * @param[in] package_info The package information
542 * @param[in] callback The iteration callback function
543 * @param[in] user_data The user data to be passed to the callback function
544 * @return @c 0 on success,
545 * otherwise a negative error value
546 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
547 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
548 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
549 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
551 int package_info_foreach_cert_info(package_info_h package_info, package_info_cert_info_cb callback, void *user_data);
555 * @brief Retrieves privilege information of the package.
557 * @param[in] package_info The package information
558 * @param[in] callback The iteration callback function
559 * @param[in] user_data The user data to be passed to the callback function
560 * @return @c 0 on success,
561 * otherwise a negative error value
562 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
563 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
564 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
565 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
567 int package_info_foreach_privilege_info(package_info_h package_info, package_info_privilege_info_cb callback, void *user_data);
570 * @brief Retrieves dependencies between packages.
571 * @details @a callback is called whenever there is package dependency. The callback includes packages that are only directly required by the given package.
572 * For example, if there are packages having the following relationship:
578 * A --> B means that A depends on B.
579 * When package_info_foreach_dependency_info(A) is called, the callback results in two parameters: @b from is A and @b to is B.
581 * @remarks The function provides the results synchronously. If there are no dependencies, this function will return #PACKAGE_MANAGER_ERROR_NONE immediately and the callback will not be invoked.
582 * @param[in] package_info The package information
583 * @param[in] callback The iteration callback function
584 * @param[in] user_data The user data to be passed to the callback function
585 * @return @c 0 on success,
586 * otherwise a negative error value
587 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
588 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
589 * @retval #PACKAGE_MANAGER_ERROR_SYSTEM_ERROR Severe system error
591 int package_info_foreach_dependency_info(package_info_h package_info, package_info_dependency_info_cb callback, void *user_data);
594 * @brief Retrieves which packages depend on the given package.
595 * @details @a callback is called whenever there is package dependency. The callback includes packages that are both directly and indirectly depend on the given package.
596 * For example, if there are packages having the following relationship:
602 * A --> B means that A depends on B.
603 * When package_info_foreach_dependency_info(C) is called, the callback results in two parameters: @b from is B and @b to is C, @b from is D and @b to is C, @b from is A and @b to is B.
605 * @remarks The function provides the results synchronously. If there are no dependencies, this function will return #PACKAGE_MANAGER_ERROR_NONE immediately and the callback will not be invoked.
606 * @param[in] package_info The package information
607 * @param[in] callback The iteration callback function
608 * @param[in] user_data The user data to be passed to the callback function
609 * @return @c 0 on success,
610 * otherwise a negative error value
611 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
612 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
613 * @retval #PACKAGE_MANAGER_ERROR_SYSTEM_ERROR Severe system error
615 int package_info_foreach_dependency_info_depends_on(package_info_h package_info, package_info_dependency_info_cb callback, void *user_data);
619 * @brief Retrieves allowed package information of the resource package.
620 * @details Resource packages allow access to allowed data only for allowed packages that have specific privileges.
621 * If not, they just allow access to global data
623 * @param[in] package_info The package information
624 * @param[in] callback The iteration callback function
625 * @param[in] user_data The user data to be passed to the callback function
626 * @return @c 0 on success,
627 * otherwise a negative error value
628 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
629 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
630 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
631 * @retval #PACKAGE_MANAGER_ERROR_SYSTEM_ERROR Severe system error
633 int package_info_foreach_res_allowed_package(package_info_h package_info, package_info_res_allowed_package_cb callback, void *user_data);
637 * @brief Retrieves required privilege information of the allowed package.
638 * @details The packages want to access in the allowed area of resource package must have all the privileges required by resource package.
640 * @param[in] priv_info The privilege information handle
641 * @param[in] callback The iteration callback function
642 * @param[in] user_data The user data to be passed to the callback function
643 * @return @c 0 on success,
644 * otherwise a negative error value
645 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
646 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
648 int package_info_foreach_required_privilege(allowed_package_required_privilege_h priv_info, package_info_privilege_info_cb callback, void *user_data);
652 * @brief Gets the package update information for the given package.
654 * @remarks You must release @a info using package_info_updateinfo_destroy().
655 * @param[in] pkgid The ID of the package
656 * @param[out] info The package update information for the given package ID
657 * @return @c 0 on success,
658 * otherwise a negative error value
659 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
660 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
661 * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE The package is not installed
662 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
663 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR Database error occurred
664 * @see package_info_updateinfo_destroy()
666 int package_info_updateinfo_create(const char *pkgid, package_updateinfo_h *info);
669 * @brief Gets the package name.
671 * @remarks You must release @a package using free().
672 * @param[in] info The package update information
673 * @param[out] package The package name
674 * @return @c 0 on success,
675 * otherwise a negative error value
676 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
677 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
678 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
679 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR Internal I/O error occurred
681 int package_info_updateinfo_get_pkgid(package_updateinfo_h info, char **package);
684 * @brief Gets the update version of package.
686 * @remarks You must release @a version using free().
687 * @param[in] info The package update information
688 * @param[out] version The package update version
689 * @return @c 0 on success,
690 * otherwise a negative error value
691 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
692 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
693 * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
694 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR Internal I/O error occurred
696 int package_info_updateinfo_get_version(package_updateinfo_h info, char **version);
699 * @brief Gets the update type of package.
701 * @param[in] info The package update information
702 * @param[out] type The package update type
703 * @return @c 0 on success,
704 * otherwise a negative error value
705 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
706 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
707 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR Internal I/O error occurred
709 int package_info_updateinfo_get_type(package_updateinfo_h info,
710 package_updateinfo_type_e *type);
713 * @brief Destroys the package update information handle and releases all its resources.
715 * @param[in] info The package update information handle
716 * @return @c 0 on success,
717 * otherwise a negative error value
718 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
719 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
720 * @see package_info_updateinfo_create()
722 int package_info_updateinfo_destroy(package_updateinfo_h info);
725 * @brief Retrieves update information of all packages and invoke callback for each of it.
727 * @param[in] callback The iteration callback function
728 * @param[in] user_data The user data to be passed to the callback function
729 * @return @c 0 on success,
730 * otherwise a negative error value
731 * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
732 * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
733 * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
735 int package_info_updateinfo_foreach_info(package_info_updateinfo_cb callback, void *user_data);
746 #endif /* __TIZEN_APPFW_PACKAGE_INFO_H */