4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
32 * @file package-manager.h
33 * @author Sewook Park <sewook7.park@samsung.com>
35 * @brief This file declares API of slp-pkgmgr library
37 * @addtogroup APPLICATION_FRAMEWORK
40 * @defgroup PackageManager
41 * @section Header to use them:
43 * #include "package-manager.h"
46 * @addtogroup PackageManager
50 #ifndef __PKG_MANAGER_H__
51 #define __PKG_MANAGER_H__
62 #define DEPRECATED __attribute__ ((__deprecated__))
68 * This is package manager
70 * Packaeg manager is used to install/uninstall the packages.\n
71 * package includes dpkg, java, widget, etc. and it can be added\n
72 * Security is considered on current package manager\n
77 * @file package-manager.h
78 * @brief Package Manager header
80 * Generated by Sewook Park <sewook7.park@samsung.com>
86 * @addtogroup PackageManager
91 * @brief pkgmgr info types.
93 #define PKGMGR_INFO_STR_PKGTYPE "pkg_type"
94 #define PKGMGR_INFO_STR_PKGNAME "pkg_name"
95 #define PKGMGR_INFO_STR_VERSION "version"
96 #define PKGMGR_INFO_STR_INSTALLED_SIZE "installed_size"
97 #define PKGMGR_INFO_STR_DATA_SIZE "data_size"
98 #define PKGMGR_INFO_STR_APP_SIZE "app_size"
99 #define PKGMGR_INFO_STR_INSTALLED_TIME "installed_time"
102 /* 1 -100 : Package command errors */
103 /* 101-120 : reserved for Core installer */
104 /* 121-140 : reserved for Web installer */
105 /* 141-160 : reserved for Native installer */
106 #define PKGCMD_ERR_PACKAGE_NOT_FOUND 1
107 #define PKGCMD_ERR_PACKAGE_INVALID 2
108 #define PKGCMD_ERR_PACKAGE_LOWER_VERSION 3
109 #define PKGCMD_ERR_PACKAGE_EXECUTABLE_NOT_FOUND 4
110 #define PKGCMD_ERR_MANIFEST_NOT_FOUND 11
111 #define PKGCMD_ERR_MANIFEST_INVALID 12
112 #define PKGCMD_ERR_CONFIG_NOT_FOUND 13
113 #define PKGCMD_ERR_CONFIG_INVALID 14
114 #define PKGCMD_ERR_SIGNATURE_NOT_FOUND 21
115 #define PKGCMD_ERR_SIGNATURE_INVALID 22
116 #define PKGCMD_ERR_SIGNATURE_VERIFICATION_FAILED 23
117 #define PKGCMD_ERR_ROOT_CERTIFICATE_NOT_FOUND 31
118 #define PKGCMD_ERR_CERTIFICATE_INVALID 32
119 #define PKGCMD_ERR_CERTIFICATE_CHAIN_VERIFICATION_FAILED 33
120 #define PKGCMD_ERR_CERTIFICATE_EXPIRED 34
121 #define PKGCMD_ERR_INVALID_PRIVILEGE 41
122 #define PKGCMD_ERR_MENU_ICON_NOT_FOUND 51
123 #define PKGCMD_ERR_FATAL_ERROR 61
124 #define PKGCMD_ERR_OUT_OF_STORAGE 62
125 #define PKGCMD_ERR_OUT_OF_MEMORY 63
126 #define PKGCMD_ERR_ARGUMENT_INVALID 64
128 #define PKGCMD_ERR_PACKAGE_NOT_FOUND_STR "PACKAGE_NOT_FOUND"
129 #define PKGCMD_ERR_PACKAGE_INVALID_STR "PACKAGE_INVALID"
130 #define PKGCMD_ERR_PACKAGE_LOWER_VERSION_STR "PACKAGE_LOWER_VERSION"
131 #define PKGCMD_ERR_PACKAGE_EXECUTABLE_NOT_FOUND_STR "PACKAGE_EXECUTABLE_NOT_FOUND"
132 #define PKGCMD_ERR_MANIFEST_NOT_FOUND_STR "MANIFEST_NOT_FOUND"
133 #define PKGCMD_ERR_MANIFEST_INVALID_STR "MANIFEST_INVALID"
134 #define PKGCMD_ERR_CONFIG_NOT_FOUND_STR "CONFIG_NOT_FOUND"
135 #define PKGCMD_ERR_CONFIG_INVALID_STR "CONFIG_INVALID"
136 #define PKGCMD_ERR_SIGNATURE_NOT_FOUND_STR "SIGNATURE_NOT_FOUND"
137 #define PKGCMD_ERR_SIGNATURE_INVALID_STR "SIGNATURE_INVALID"
138 #define PKGCMD_ERR_SIGNATURE_VERIFICATION_FAILED_STR "SIGNATURE_VERIFICATION_FAILED"
139 #define PKGCMD_ERR_ROOT_CERTIFICATE_NOT_FOUND_STR "ROOT_CERTIFICATE_NOT_FOUND"
140 #define PKGCMD_ERR_CERTIFICATE_INVALID_STR "CERTIFICATE_INVALID"
141 #define PKGCMD_ERR_CERTIFICATE_CHAIN_VERIFICATION_FAILED_STR "CERTIFICATE_CHAIN_VERIFICATION_FAILED"
142 #define PKGCMD_ERR_CERTIFICATE_EXPIRED_STR "CERTIFICATE_EXPIRED"
143 #define PKGCMD_ERR_INVALID_PRIVILEGE_STR "INVALID_PRIVILEGE"
144 #define PKGCMD_ERR_MENU_ICON_NOT_FOUND_STR "MENU_ICON_NOT_FOUND"
145 #define PKGCMD_ERR_FATAL_ERROR_STR "FATAL_ERROR"
146 #define PKGCMD_ERR_OUT_OF_STORAGE_STR "OUT_OF_STORAGE"
147 #define PKGCMD_ERR_OUT_OF_MEMORY_STR "OUT_OF_MEMORY"
148 #define PKGCMD_ERR_ARGUMENT_INVALID_STR "ARGUMENT_INVALID"
149 #define PKGCMD_ERR_UNKNOWN_STR "Unknown Error"
152 * @brief Return values in pkgmgr.
154 typedef enum _pkgmgr_return_val {
155 PKGMGR_R_ETIMEOUT = -4, /**< Timeout */
156 PKGMGR_R_EINVAL = -3, /**< Invalid argument */
157 PKGMGR_R_ECOMM = -2, /**< Comunication Error */
158 PKGMGR_R_ERROR = -1, /**< General error */
159 PKGMGR_R_OK = 0 /**< General success */
164 * @defgroup pkg_operate APIs to install /uninstall / activate application
167 * APIs to install /uninstall / activate application
168 * - Install application using application package filepath
169 * - Uninstall application using application package name
170 * - Activate application using application package name
176 * @addtogroup pkg_operate
180 typedef void* pkgmgr_pkginfo_h;
181 typedef void* pkgmgr_appinfo_h;
182 typedef void* pkgmgr_certinfo_h;
184 typedef int (*pkgmgr_iter_fn)(const char* pkg_type, const char* pkgid,
185 const char* version, void *data);
187 typedef int (*pkgmgr_handler)(int req_id, const char *pkg_type,
188 const char *pkgid, const char *key,
189 const char *val, const void *pmsg, void *data);
191 typedef int (*pkgmgr_info_pkg_list_cb ) (const pkgmgr_pkginfo_h handle,
194 typedef int (*pkgmgr_info_app_list_cb ) (const pkgmgr_appinfo_h handle,
197 typedef int (*pkgmgr_info_app_category_list_cb ) (const char *category_name,
201 typedef void pkgmgr_client;
203 typedef void pkgmgr_info;
217 PM_INSTALL_LOCATION_AUTO = 0,
218 PM_INSTALL_LOCATION_INTERNAL_ONLY,
219 PM_INSTALL_LOCATION_PREFER_EXTERNAL,
220 }pkgmgr_install_location;
223 PM_HWACCELERATION_NOT_USE_GL = 0,
224 PM_HWACCELERATION_USE_GL = 1,
225 PM_HWACCELERATION_USE_SYSTEM_SETTING = 2,
226 }pkgmgr_hwacceleration_type;
232 }pkgmgr_app_component;
235 PM_MOVE_TO_INTERNAL = 0,
236 PM_MOVE_TO_SDCARD = 1,
240 PM_INTERNAL_STORAGE = 0,
241 PM_EXTERNAL_STORAGE = 1,
242 }pkgmgr_installed_storage;
245 PM_AUTHOR_ROOT_CERT = 0,
246 PM_AUTHOR_INTERMEDIATE_CERT = 1,
247 PM_AUTHOR_SIGNER_CERT = 2,
248 PM_DISTRIBUTOR_ROOT_CERT = 3,
249 PM_DISTRIBUTOR_INTERMEDIATE_CERT = 4,
250 PM_DISTRIBUTOR_SIGNER_CERT = 5,
251 PM_DISTRIBUTOR2_ROOT_CERT = 6,
252 PM_DISTRIBUTOR2_INTERMEDIATE_CERT = 7,
253 PM_DISTRIBUTOR2_SIGNER_CERT = 8,
259 PM_REQUEST_GET_SIZE = 2,
260 PM_REQUEST_KILL_APP = 3,
262 }pkgmgr_request_service_type;
265 PM_GET_TOTAL_SIZE= 0,
266 PM_GET_DATA_SIZE = 1,
267 }pkgmgr_getsize_type;
270 * @brief This API creates pkgmgr client.
272 * This API is for package-manager client application.\n
274 * @param[in] ctype client type - PC_REQUEST, PC_LISTENING, PC_BROADCAST
275 * @return pkgmgr_client object
276 * @retval NULL on failure creating an object
278 pkgmgr_client *pkgmgr_client_new(client_type ctype);
281 * @brief This API deletes pkgmgr client.
283 * This API is for package-manager client application.\n
285 * @param[in] pc pkgmgr_client
286 * @return Operation result;
287 * @retval PKGMGR_R_OK success
288 * @retval PKGMGR_R_EINVAL invalid argument
289 * @retval PKGMGR_R_ERROR internal error
291 int pkgmgr_client_free(pkgmgr_client *pc);
294 * @brief This API installs package.
296 * This API is for package-manager client application.\n
298 * @param[in] pc pkgmgr_client
299 * @param[in] pkg_type package type
300 * @param[in] descriptor_path full path that descriptor is located
301 * @param[in] pkg_path full path that package file is located
302 * @param[in] optional_file optional file which is used for installation
303 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
304 * @param[in] event_cb user callback
305 * @param[in] data user data
306 * @return request_id (>0) if success, error code(<0) if fail\n
307 * @retval PKGMGR_R_OK success
308 * @retval PKGMGR_R_EINVAL invalid argument
309 * @retval PKGMGR_R_ECOMM communication error
311 int pkgmgr_client_install(pkgmgr_client *pc, const char *pkg_type,
312 const char *descriptor_path, const char *pkg_path,
313 const char *optional_file, pkgmgr_mode mode,
314 pkgmgr_handler event_cb, void *data);
317 * @brief This API reinstalls package.
319 * This API is for package-manager client application.\n
321 * @param[in] pc pkgmgr_client
322 * @param[in] pkg_type package type
323 * @param[in] pkg_path full path that package file is located
324 * @param[in] optional_file optional file which is used for installation
325 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
326 * @param[in] event_cb user callback
327 * @param[in] data user data
328 * @return request_id (>0) if success, error code(<0) if fail\n
329 * @retval PKGMGR_R_OK success
330 * @retval PKGMGR_R_EINVAL invalid argument
331 * @retval PKGMGR_R_ECOMM communication error
333 int pkgmgr_client_reinstall(pkgmgr_client *pc, const char *pkg_type, const char *pkgid,
334 const char *optional_file, pkgmgr_mode mode,
335 pkgmgr_handler event_cb, void *data);
338 * @brief This API uninstalls package.
340 * This API is for package-manager client application.\n
342 * @param[in] pc pkgmgr_client
343 * @param[in] pkg_type package type
344 * @param[in] pkgid package id
345 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
346 * @param[in] event_cb user callback
347 * @param[in] data user data
348 * @return request_id (>0), error code(<0) if fail\n
349 * @retval PKGMGR_R_OK success
350 * @retval PKGMGR_R_EINVAL invalid argument
351 * @retval PKGMGR_R_ECOMM communication error
353 int pkgmgr_client_uninstall(pkgmgr_client *pc, const char *pkg_type,
354 const char *pkgid, pkgmgr_mode mode,
355 pkgmgr_handler event_cb, void *data);
358 * @brief This API moves installed package to SD card or vice versa.
360 * This API is for package-manager client application.\n
362 * @param[in] pc pkgmgr_client
363 * @param[in] pkg_type package type
364 * @param[in] pkgid application package id
365 * @param[in] move_type PM_MOVE_TO_INTERNAL or PM_MOVE_TO_SDCARD
366 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
367 * @retval PKGMGR_R_OK success
368 * @retval PKGMGR_R_EINVAL invalid argument
369 * @retval PKGMGR_R_ERROR general error
371 int pkgmgr_client_move(pkgmgr_client *pc, const char *pkg_type,
372 const char *pkgid, pkgmgr_move_type move_type, pkgmgr_mode mode);
375 * @brief This API moves installed package to SD card or vice versa.
377 * This API is for package-manager client application.\n
379 * @param[in] pc pkgmgr_client
380 * @param[in] pkg_type package type
381 * @param[in] pkgid application package id
382 * @param[in] move_type PM_MOVE_TO_INTERNAL or PM_MOVE_TO_SDCARD
383 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
384 * @param[in] event_cb user callback
385 * @param[in] data user data
386 * @retval PKGMGR_R_OK success
387 * @retval PKGMGR_R_EINVAL invalid argument
388 * @retval PKGMGR_R_ERROR general error
390 int pkgmgr_client_move_pkg(pkgmgr_client *pc, const char *pkg_type,
391 const char *pkgid, pkgmgr_move_type move_type, pkgmgr_mode mode,
392 pkgmgr_handler event_cb, void *data);
395 * @brief This API activates package.
397 * This API is for package-manager client application.\n
399 * @param[in] pc pkgmgr_client
400 * @param[in] pkg_type package type
401 * @param[in] pkgid package id
402 * @return request_id (>0) if success, error code(<0) if fail\n
403 * @retval PKGMGR_R_OK success
404 * @retval PKGMGR_R_EINVAL invalid argument
405 * @retval PKGMGR_R_ECOMM communication error
407 int pkgmgr_client_activate(pkgmgr_client *pc, const char *pkg_type,
411 * @brief This API deactivates package.
413 * This API is for package-manager client application.\n
415 * @param[in] pc pkgmgr_client
416 * @param[in] pkg_type package type
417 * @param[in] pkgid package id
418 * @return request_id (>0) if success, error code(<0) if fail\n
419 * @retval PKGMGR_R_OK success
420 * @retval PKGMGR_R_EINVAL invalid argument
421 * @retval PKGMGR_R_ECOMM communication error
423 int pkgmgr_client_deactivate(pkgmgr_client *pc, const char *pkg_type,
427 * @brief This API activates package.
429 * This API is for package-manager client application.\n
431 * @param[in] pc pkgmgr_client
432 * @param[in] appid applicaiton id
433 * @return request_id (>0) if success, error code(<0) if fail\n
434 * @retval PKGMGR_R_OK success
435 * @retval PKGMGR_R_EINVAL invalid argument
436 * @retval PKGMGR_R_ECOMM communication error
438 int pkgmgr_client_activate_app(pkgmgr_client *pc, const char *appid);
441 * @brief This API activates package.
443 * This API is for package-manager client application.\n
445 * @param[in] pc pkgmgr_client
446 * @param[in] appid applicaiton id
447 * @param[in] argv argument vector
448 * @return request_id (>0) if success, error code(<0) if fail\n
449 * @retval PKGMGR_R_OK success
450 * @retval PKGMGR_R_EINVAL invalid argument
451 * @retval PKGMGR_R_ECOMM communication error
453 int pkgmgr_client_activate_appv(pkgmgr_client * pc, const char *appid, char *const argv[]);
456 * @brief This API deactivates package.
458 * This API is for package-manager client application.\n
460 * @param[in] pc pkgmgr_client
461 * @param[in] appid applicaiton id
462 * @return request_id (>0) if success, error code(<0) if fail\n
463 * @retval PKGMGR_R_OK success
464 * @retval PKGMGR_R_EINVAL invalid argument
465 * @retval PKGMGR_R_ECOMM communication error
467 int pkgmgr_client_deactivate_app(pkgmgr_client *pc, const char *appid);
470 * @brief This API deletes application's private data.
472 * This API is for package-manager client application.\n
474 * @param[in] pc pkgmgr_client
475 * @param[in] pkg_type package type
476 * @param[in] pkgid package id
477 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
478 * @return request_id (>0) if success, error code(<0) if fail\n
479 * @retval PKGMGR_R_OK success
480 * @retval PKGMGR_R_EINVAL invalid argument
481 * @retval PKGMGR_R_ECOMM communication error
483 int pkgmgr_client_clear_user_data(pkgmgr_client *pc, const char *pkg_type,
484 const char *appid, pkgmgr_mode mode);
487 * @brief This API request to listen the pkgmgr's broadcasting
489 * This API is for package-manager client application.\n
491 * @param[in] pc pkgmgr_client
492 * @param[in] event_cb user callback
493 * @param[in] data user data
494 * @return request_id (>0) if success, error code(<0) if fail\n
495 * @retval PKGMGR_R_OK success
496 * @retval PKGMGR_R_EINVAL invalid argument
498 int pkgmgr_client_listen_status(pkgmgr_client *pc, pkgmgr_handler event_cb,
502 * @brief This API broadcasts pkgmgr's status
504 * This API is for package-manager client application.\n
506 * @param[in] pc pkgmgr_client
507 * @param[in] pkg_type package type
508 * @param[in] pkgid package id
509 * @param[in] key key to broadcast
510 * @param[in] val value to broadcast
511 * @return 0 if success, error code(<0) if fail\n
512 * @retval PKGMGR_R_OK success
513 * @retval PKGMGR_R_EINVAL invalid argument
515 int pkgmgr_client_broadcast_status(pkgmgr_client *pc, const char *pkg_type,
516 const char *pkgid, const char *key,
520 * @brief This API gets the package's information.
522 * This API is for package-manager client application.\n
524 * @param[in] pkg_path package file path to get infomation
525 * @return package entry pointer if success, NULL if fail\n
527 pkgmgr_info *pkgmgr_client_check_pkginfo_from_file(const char *pkg_path);
530 * @brief This API get package information value
532 * This API is for package-manager client application.\n
534 * @param[in] pkg_info pointer for package info entry
535 * @return 0 if success, error code(<0) if fail\n
537 int pkgmgr_client_free_pkginfo(pkgmgr_info * pkg_info);
540 * @brief This API requests service
542 * This API is for package-manager client application.\n
544 * @param[in] service_type pkgmgr_request_service_type
545 * @param[in] service_mode mode which is used for addtional mode selection
546 * @param[in] pc pkgmgr_client
547 * @param[in] pkg_type package type
548 * @param[in] pkgid package id
549 * @param[in] custom_info custom information which is used for addtional information
550 * @param[in] event_cb user callback
551 * @param[in] data user data
552 * @return request_id (>0) if success, error code(<0) if fail\n
553 * @retval PKGMGR_R_OK success
554 * @retval PKGMGR_R_EINVAL invalid argument
555 * @retval PKGMGR_R_ECOMM communication error
557 int pkgmgr_client_request_service(pkgmgr_request_service_type service_type, int service_mode,
558 pkgmgr_client * pc, const char *pkg_type, const char *pkgid,
559 const char *custom_info, pkgmgr_handler event_cb, void *data);
562 * @brief This API provides package list
564 * This API is for package-manager client application.\n
566 * @param[in] iter_fn iteration function for list
567 * @param[in] data user data
568 * @return 0 if success, error code(<0) if fail\n
569 * @retval PKGMGR_R_OK success
570 * @retval PKGMGR_R_EINVAL invalid argument
571 * @retval PKGMGR_R_ERROR internal error
573 int pkgmgr_get_pkg_list(pkgmgr_iter_fn iter_fn, void *data);
577 * @defgroup pkg_list APIs to get package information
580 * API to get package information
584 * @addtogroup pkg_list
590 * @brief This API gets the package's information.
592 * This API is for package-manager client application.\n
594 * @param[in] pkg_type package type for the package to get infomation
595 * @param[in] pkgid package id for the package to get infomation
596 * @return package entry pointer if success, NULL if fail\n
598 pkgmgr_info * pkgmgr_info_new(const char *pkg_type, const char *pkgid);
601 * @brief This API gets the package's information.
603 * This API is for package-manager client application.\n
605 * @param[in] pkg_type package type for the package to get infomation
606 * @param[in] pkg_path package file path to get infomation
607 * @return package entry pointer if success, NULL if fail\n
609 pkgmgr_info * pkgmgr_info_new_from_file(const char *pkg_type,
610 const char *pkg_path);
613 * @brief This API get package information value
615 * This API is for package-manager client application.\n
617 * @param[in] pkg_info pointer for package info entry
618 * @param[in] key key for package info field
619 * @return string value if success, NULL if fail\n
621 char * pkgmgr_info_get_string(pkgmgr_info * pkg_info, const char *key);
624 * @brief This API get package information value
626 * This API is for package-manager client application.\n
628 * @param[in] pkg_info pointer for package info entry
629 * @return 0 if success, error code(<0) if fail\n
631 int pkgmgr_info_free(pkgmgr_info * pkg_info);
634 * @brief This API gets list of installed applications.
636 * This API is for package-manager client application.\n
638 * @param[in] pkg_list_cb iteration function for list
639 * @param[in] user_data user data to be passed to callback function
640 * @return 0 if success, error code(<0) if fail\n
642 int pkgmgr_pkginfo_get_list(pkgmgr_info_pkg_list_cb pkg_list_cb, void *user_data);
645 * @brief This API get package info entry from db
647 * This API is for package-manager client application.\n
649 * @param[in] pkgid pointer to package id
650 * @param[out] handle pointer to the package info handle.
651 * @return 0 if success, error code(<0) if fail\n
653 int pkgmgr_pkginfo_get_pkginfo(const char *pkgid, pkgmgr_pkginfo_h *handle);
656 * @brief This API gets type of the given package.
658 * This API is for package-manager client application.\n
660 * @param[in] handle pointer to package info handle
661 * @param[out] type to hold package type.
662 * @return 0 if success, error code(<0) if fail\n
664 int pkgmgr_pkginfo_get_pkgname(pkgmgr_pkginfo_h handle, char **pkg_name);
667 * @brief This API gets id of the given package.
669 * This API is for package-manager client application.\n
671 * @param[in] handle pointer to package info handle
672 * @param[out]pkgid to hold package id.
673 * @return 0 if success, error code(<0) if fail\n
675 int pkgmgr_pkginfo_get_pkgid(pkgmgr_pkginfo_h handle, char **pkgid);
678 * @brief This API gets type of the given package.
680 * This API is for package-manager client application.\n
682 * @param[in] handle pointer to package info handle
683 * @param[out] type to hold package type.
684 * @return 0 if success, error code(<0) if fail\n
686 int pkgmgr_pkginfo_get_type(pkgmgr_pkginfo_h handle, char **type);
689 * @brief This API gets version of the given package.
691 * This API is for package-manager client application.\n
693 * @param[in] handle pointer to package info handle
694 * @param[out] version to hold package version.
695 * @return 0 if success, error code(<0) if fail\n
697 int pkgmgr_pkginfo_get_version(pkgmgr_pkginfo_h handle, char **version);
700 * @brief This API gets install location of the given package.
702 * This API is for package-manager client application.\n
704 * @param[in] handle pointer to package info handle
705 * @param[out] location to hold install location.
706 * @return 0 if success, error code(<0) if fail\n
708 int pkgmgr_pkginfo_get_install_location(pkgmgr_pkginfo_h handle, pkgmgr_install_location *location);
711 * @brief This API gets package size of the given package in case of external installation.
712 * size will be 0 if package install location is internal-only.
713 * size will be 0 if package install location is prefer-external but size is not specified in manifest file.
714 * Application should check the return value and use it distinguish the above cases.
716 * This API is for package-manager client application.\n
718 * @param[in] handle pointer to package info handle
719 * @param[out] size to hold package size.
720 * @return 0 if success, error code(<0) if fail\n
723 int pkgmgr_pkginfo_get_package_size(pkgmgr_pkginfo_h handle, int *size);
726 * @brief This API gets icon of the given package.
728 * This API is for package-manager client application.\n
730 * @param[in] handle pointer to package info handle
731 * @param[out] icon to hold package icon.
732 * @return 0 if success, error code(<0) if fail\n
734 int pkgmgr_pkginfo_get_icon(pkgmgr_pkginfo_h handle, char **icon);
737 * @brief This API gets label of the given package.
739 * This API is for package-manager client application.\n
741 * @param[in] handle pointer to package info handle
742 * @param[out] label to hold package label.
743 * @return 0 if success, error code(<0) if fail\n
745 int pkgmgr_pkginfo_get_label(pkgmgr_pkginfo_h handle, char **label);
748 * @brief This API gets desription of the given package.
750 * This API is for package-manager client application.\n
752 * @param[in] handle pointer to package info handle
753 * @param[out] description to hold package description.
754 * @return 0 if success, error code(<0) if fail\n
756 int pkgmgr_pkginfo_get_description(pkgmgr_pkginfo_h handle, char **description);
759 * @brief This API gets author's name of the given package.
761 * This API is for package-manager client application.\n
763 * @param[in] handle pointer to package info handle
764 * @param[out] author_name to hold author's name.
765 * @return 0 if success, error code(<0) if fail\n
767 int pkgmgr_pkginfo_get_author_name(pkgmgr_pkginfo_h handle, char **author_name);
770 * @brief This API gets author's email of the given package.
772 * This API is for package-manager client application.\n
774 * @param[in] handle pointer to package info handle
775 * @param[out] author_email to hold author's email id.
776 * @return 0 if success, error code(<0) if fail\n
778 int pkgmgr_pkginfo_get_author_email(pkgmgr_pkginfo_h handle, char **author_email);
781 * @brief This API gets author's href of the given package.
783 * This API is for package-manager client application.\n
785 * @param[in] handle pointer to package info handle
786 * @param[out] author_href to hold author's href.
787 * @return 0 if success, error code(<0) if fail\n
789 int pkgmgr_pkginfo_get_author_href(pkgmgr_pkginfo_h handle, char **author_href);
792 * @brief This API gets removable of the given package.
794 * This API is for package-manager client application.\n
796 * @param[in] handle pointer to package info handle
797 * @param[out] removable to hold removable value.
798 * @return 0 if success, error code(<0) if fail\n
800 int pkgmgr_pkginfo_is_removable(pkgmgr_pkginfo_h handle, bool *removable);
803 * @brief This API gets preload of the given package.
805 * This API is for package-manager client application.\n
807 * @param[in] handle pointer to package info handle
808 * @param[out] preload to hold preload value
809 * @return 0 if success, error code(<0) if fail\n
811 int pkgmgr_pkginfo_is_preload(pkgmgr_pkginfo_h handle, bool *preload);
814 * @brief This API gets readonly value of the given package.
816 * This API is for package-manager client application.\n
818 * @param[in] handle pointer to package info handle
819 * @param[out] readonly to hold readonly value
820 * @return 0 if success, error code(<0) if fail\n
822 int pkgmgr_pkginfo_is_readonly(pkgmgr_pkginfo_h handle, bool *readonly);
825 * @brief This API gets accessible of the given package.
827 * This API is for package-manager client application.\n
829 * @param[in] pkgid id of package
830 * @param[out]accessible accessible of package
831 * @return 0 if success, error code(<0) if fail\n
833 int pkgmgr_pkginfo_is_accessible(pkgmgr_pkginfo_h handle, bool *accessible);
836 * @brief This API destroy the pacakge info handle
838 * This API is for package-manager client application.\n
840 * @param[in] handle pointer to package info handle
841 * @return 0 if success, error code(<0) if fail\n
843 int pkgmgr_pkginfo_destroy_pkginfo(pkgmgr_pkginfo_h handle);
846 * @brief This API gets installed storage of the given package.
848 * This API is for package-manager client application.\n
850 * @param[in] pkgid id of package
851 * @param[out] storage storage of package
852 * @return 0 if success, error code(<0) if fail\n
854 int pkgmgr_pkginfo_get_installed_storage(pkgmgr_pkginfo_h handle, pkgmgr_installed_storage *storage);
857 * @brief This API gets installed time of the given package.
859 * This API is for package-manager client application.\n
861 * @param[in] handle pointer to package info handle
862 * @param[out] installed_time installed time of package
863 * @return 0 if success, error code(<0) if fail\n
865 int pkgmgr_pkginfo_get_installed_time(pkgmgr_pkginfo_h handle, int *installed_time);
868 * @brief This API gets list of ui-application/service application of the given package.
870 * This API is for package-manager client application.\n
872 * @param[in] handle pointer to package info handle
873 * @param[in] component application component type.
874 * @param[in] app_func application's callback function.
875 * @param[in] user_data user data to be passed to callback function
876 * @return 0 if success, error code(<0) if fail\n
878 int pkgmgr_appinfo_get_list(pkgmgr_pkginfo_h handle, pkgmgr_app_component component,
879 pkgmgr_info_app_list_cb app_func, void *user_data);
882 * @brief This API gets list of category for ui-application/service application.
884 * This API is for package-manager client application.\n
886 * @param[in] handle pointer to package info handle
887 * @param[in] category_func callback function.
888 * @param[in] user_data user data to be passed to callback function
889 * @return 0 if success, error code(<0) if fail\n
891 int pkgmgr_appinfo_foreach_category(pkgmgr_appinfo_h handle, pkgmgr_info_app_category_list_cb category_func,
895 * @brief This API gets application info entry from db.
897 * This API is for package-manager client application.\n
899 * @param[in] appid application id
900 * @param[out] handle pointer to app info handle
901 * @return 0 if success, error code(<0) if fail\n
903 int pkgmgr_appinfo_get_appinfo(const char *appid, pkgmgr_appinfo_h *handle);
906 * @brief This API gets appid of the given appid.
908 * This API is for package-manager client application.\n
910 * @param[in] handle pointer to app info handle
911 * @param[out] appid to hold appid value
912 * @return 0 if success, error code(<0) if fail\n
914 int pkgmgr_appinfo_get_appid(pkgmgr_appinfo_h handle, char **appid);
917 * @brief This API gets pkgid of the given appid.
919 * This API is for package-manager client application.\n
921 * @param[in] handle pointer to app info handle
922 * @param[out]pkg_name to hold pkgid value
923 * @return 0 if success, error code(<0) if fail\n
925 int pkgmgr_appinfo_get_pkgname(pkgmgr_appinfo_h handle, char **pkg_name);
928 * @brief This API gets pkgid of the given appid.
930 * This API is for package-manager client application.\n
932 * @param[in] handle pointer to app info handle
933 * @param[out] pkgid to hold pkgid value
934 * @return 0 if success, error code(<0) if fail\n
936 int pkgmgr_appinfo_get_pkgid(pkgmgr_appinfo_h handle, char **pkgid);
939 * @brief This API gets exec of the given appid.
941 * This API is for package-manager client application.\n
943 * @param[in] handle pointer to app info handle
944 * @param[out] exec to hold exec value
945 * @return 0 if success, error code(<0) if fail\n
947 int pkgmgr_appinfo_get_exec(pkgmgr_appinfo_h handle, char **exec);
950 * @brief This API gets icon name of the given appid.
952 * This API is for package-manager client application.\n
954 * @param[in] handle pointer to app info handle
955 * @param[out] icon to hold icon value
956 * @return 0 if success, error code(<0) if fail\n
958 int pkgmgr_appinfo_get_icon(pkgmgr_appinfo_h handle, char **icon);
961 * @brief This API gets label of the given appid.
963 * This API is for package-manager client application.\n
965 * @param[in] handle pointer to app info handle
966 * @param[out] label to hold label value
967 * @return 0 if success, error code(<0) if fail\n
969 int pkgmgr_appinfo_get_label(pkgmgr_appinfo_h handle, char **label);
972 * @brief This API gets package name of the given appid.
974 * This API is for package-manager client application.\n
976 * @param[in] handle pointer to app info handle
977 * @param[out] package to hold package value
978 * @return 0 if success, error code(<0) if fail\n
980 int pkgmgr_appinfo_get_package(pkgmgr_appinfo_h handle, char **package);
983 * @brief This API gets component type of the given appid.
985 * This API is for package-manager client application.\n
987 * @param[in] handle pointer to app info handle
988 * @param[out] component to hold component value
989 * @return 0 if success, error code(<0) if fail\n
991 int pkgmgr_appinfo_get_component(pkgmgr_appinfo_h handle, pkgmgr_app_component *component);
994 * @brief This API gets app type of the given appid.
996 * This API is for package-manager client application.\n
998 * @param[in] handle pointer to app info handle
999 * @param[out] app_type to hold the apptype.
1000 * @return 0 if success, error code(<0) if fail\n
1002 int pkgmgr_appinfo_get_apptype(pkgmgr_appinfo_h handle, char **app_type);
1005 * @brief This API gets nodisplay value of the given appid.
1007 * This API is for package-manager client application.\n
1009 * @param[in] handle pointer to app info handle
1010 * @param[out] nodisplay to hold the nodisplay value
1011 * @return 0 if success, error code(<0) if fail\n
1013 int pkgmgr_appinfo_is_nodisplay(pkgmgr_appinfo_h handle, bool *nodisplay);
1016 * @brief This API gets multiple value of the given appid.
1018 * This API is for package-manager client application.\n
1020 * @param[in] handle pointer to app info handle
1021 * @param[out] multiple to hold the multiple value
1022 * @return 0 if success, error code(<0) if fail\n
1024 int pkgmgr_appinfo_is_multiple(pkgmgr_appinfo_h handle, bool *multiple);
1027 * @brief This API gets taskmanage value of the given appid.
1029 * This API is for package-manager client application.\n
1031 * @param[in] handle pointer to app info handle
1032 * @param[out] taskmanage to hold the taskmanage value
1033 * @return 0 if success, error code(<0) if fail\n
1035 int pkgmgr_appinfo_is_taskmanage(pkgmgr_appinfo_h handle, bool *taskmanage);
1038 * @brief This API gets hwacceleration value of the given appid.
1040 * This API is for package-manager client application.\n
1042 * @param[in] handle pointer to app info handle
1043 * @param[out] hwacceleration to hold the hwacceleration value
1044 * @return 0 if success, error code(<0) if fail\n
1046 int pkgmgr_appinfo_get_hwacceleration(pkgmgr_appinfo_h handle, pkgmgr_hwacceleration_type *hwacceleration);
1049 * @brief This API gets onboot value of the given appid.
1051 * This API is for package-manager client application.\n
1053 * @param[in] handle pointer to app info handle
1054 * @param[out] onboot to hold the onboot value
1055 * @return 0 if success, error code(<0) if fail\n
1057 int pkgmgr_appinfo_is_onboot(pkgmgr_appinfo_h handle, bool *onboot);
1060 * @brief This API gets autorestart value of the given appid.
1062 * This API is for package-manager client application.\n
1064 * @param[in] handle pointer to app info handle
1065 * @param[out] autorestart to hold the autorestart value
1066 * @return 0 if success, error code(<0) if fail\n
1068 int pkgmgr_appinfo_is_autorestart(pkgmgr_appinfo_h handle, bool *autorestart);
1071 * @brief This API destroy the appinfo handle.
1073 * This API is for package-manager client application.\n
1075 * @param[in] handle pointer to app info handle
1076 * @return 0 if success, error code(<0) if fail\n
1078 int pkgmgr_appinfo_destroy_appinfo(pkgmgr_appinfo_h handle);
1081 * @brief This API creates the certinfo handle.
1083 * This API is for package-manager client application.\n
1085 * @param[out] handle pointer to cert info handle
1086 * @return 0 if success, error code(<0) if fail\n
1088 int pkgmgr_pkginfo_create_certinfo(pkgmgr_certinfo_h *handle);
1091 * @brief This API loads cert info in the handle.
1093 * This API is for package-manager client application.\n
1095 * @param[in] handle pointer to cert info handle
1096 * @param[in] pkgid package ID
1097 * @return 0 if success, error code(<0) if fail\n
1099 int pkgmgr_pkginfo_load_certinfo(const char *pkgid, pkgmgr_certinfo_h handle);
1102 * @brief This API gets cert value for corresponding cert type.
1104 * This API is for package-manager client application.\n
1106 * @param[in] handle pointer to cert info handle
1107 * @param[in] cert_type enum value for certificate type
1108 * @param[out] cert_value pointer to store cert value
1109 * @return 0 if success, error code(<0) if fail\n
1111 int pkgmgr_pkginfo_get_cert_value(pkgmgr_certinfo_h handle, pkgmgr_cert_type cert_type, const char **cert_value);
1114 * @brief This API destroys cert info handle freeing all resources.
1116 * This API is for package-manager client application.\n
1118 * @param[in] handle pointer to cert info handle
1119 * @return 0 if success, error code(<0) if fail\n
1121 int pkgmgr_pkginfo_destroy_certinfo(pkgmgr_certinfo_h handle);
1124 * @brief This API gets datacontrol info entry from db.
1126 * This API is for package-manager client application.\n
1128 * @param[in] providerid pointer to providerid
1129 * @param[in] type pointer to type
1130 * @param[out] appid pointer to appid value
1131 * @param[out] access pointer to access value
1132 * @return 0 if success, error code(<0) if fail\n
1134 int pkgmgr_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
1141 #endif /* __PKG_MANAGER_H__ */