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 activates package.
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 package id
382 * @return request_id (>0) if success, error code(<0) if fail\n
383 * @retval PKGMGR_R_OK success
384 * @retval PKGMGR_R_EINVAL invalid argument
385 * @retval PKGMGR_R_ECOMM communication error
387 int pkgmgr_client_activate(pkgmgr_client *pc, const char *pkg_type,
391 * @brief This API deactivates package.
393 * This API is for package-manager client application.\n
395 * @param[in] pc pkgmgr_client
396 * @param[in] pkg_type package type
397 * @param[in] pkgid package id
398 * @return request_id (>0) if success, error code(<0) if fail\n
399 * @retval PKGMGR_R_OK success
400 * @retval PKGMGR_R_EINVAL invalid argument
401 * @retval PKGMGR_R_ECOMM communication error
403 int pkgmgr_client_deactivate(pkgmgr_client *pc, const char *pkg_type,
407 * @brief This API activates package.
409 * This API is for package-manager client application.\n
411 * @param[in] pc pkgmgr_client
412 * @param[in] appid applicaiton id
413 * @return request_id (>0) if success, error code(<0) if fail\n
414 * @retval PKGMGR_R_OK success
415 * @retval PKGMGR_R_EINVAL invalid argument
416 * @retval PKGMGR_R_ECOMM communication error
418 int pkgmgr_client_activate_app(pkgmgr_client *pc, const char *appid);
421 * @brief This API activates package.
423 * This API is for package-manager client application.\n
425 * @param[in] pc pkgmgr_client
426 * @param[in] appid applicaiton id
427 * @param[in] argv argument vector
428 * @return request_id (>0) if success, error code(<0) if fail\n
429 * @retval PKGMGR_R_OK success
430 * @retval PKGMGR_R_EINVAL invalid argument
431 * @retval PKGMGR_R_ECOMM communication error
433 int pkgmgr_client_activate_appv(pkgmgr_client * pc, const char *appid, char *const argv[]);
436 * @brief This API deactivates package.
438 * This API is for package-manager client application.\n
440 * @param[in] pc pkgmgr_client
441 * @param[in] appid applicaiton id
442 * @return request_id (>0) if success, error code(<0) if fail\n
443 * @retval PKGMGR_R_OK success
444 * @retval PKGMGR_R_EINVAL invalid argument
445 * @retval PKGMGR_R_ECOMM communication error
447 int pkgmgr_client_deactivate_app(pkgmgr_client *pc, const char *appid);
450 * @brief This API deletes application's private data.
452 * This API is for package-manager client application.\n
454 * @param[in] pc pkgmgr_client
455 * @param[in] pkg_type package type
456 * @param[in] pkgid package id
457 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
458 * @return request_id (>0) if success, error code(<0) if fail\n
459 * @retval PKGMGR_R_OK success
460 * @retval PKGMGR_R_EINVAL invalid argument
461 * @retval PKGMGR_R_ECOMM communication error
463 int pkgmgr_client_clear_user_data(pkgmgr_client *pc, const char *pkg_type,
464 const char *appid, pkgmgr_mode mode);
467 * @brief This API request to listen the pkgmgr's broadcasting
469 * This API is for package-manager client application.\n
471 * @param[in] pc pkgmgr_client
472 * @param[in] event_cb user callback
473 * @param[in] data user data
474 * @return request_id (>0) if success, error code(<0) if fail\n
475 * @retval PKGMGR_R_OK success
476 * @retval PKGMGR_R_EINVAL invalid argument
478 int pkgmgr_client_listen_status(pkgmgr_client *pc, pkgmgr_handler event_cb,
482 * @brief This API broadcasts pkgmgr's status
484 * This API is for package-manager client application.\n
486 * @param[in] pc pkgmgr_client
487 * @param[in] pkg_type package type
488 * @param[in] pkgid package id
489 * @param[in] key key to broadcast
490 * @param[in] val value to broadcast
491 * @return 0 if success, error code(<0) if fail\n
492 * @retval PKGMGR_R_OK success
493 * @retval PKGMGR_R_EINVAL invalid argument
495 int pkgmgr_client_broadcast_status(pkgmgr_client *pc, const char *pkg_type,
496 const char *pkgid, const char *key,
500 * @brief This API gets the package's information.
502 * This API is for package-manager client application.\n
504 * @param[in] pkg_path package file path to get infomation
505 * @return package entry pointer if success, NULL if fail\n
507 pkgmgr_info *pkgmgr_client_check_pkginfo_from_file(const char *pkg_path);
510 * @brief This API get package information value
512 * This API is for package-manager client application.\n
514 * @param[in] pkg_info pointer for package info entry
515 * @return 0 if success, error code(<0) if fail\n
517 int pkgmgr_client_free_pkginfo(pkgmgr_info * pkg_info);
520 * @brief This API requests service
522 * This API is for package-manager client application.\n
524 * @param[in] service_type pkgmgr_request_service_type
525 * @param[in] service_mode mode which is used for addtional mode selection
526 * @param[in] pc pkgmgr_client
527 * @param[in] pkg_type package type
528 * @param[in] pkgid package id
529 * @param[in] custom_info custom information which is used for addtional information
530 * @param[in] event_cb user callback
531 * @param[in] data user data
532 * @return request_id (>0) if success, error code(<0) if fail\n
533 * @retval PKGMGR_R_OK success
534 * @retval PKGMGR_R_EINVAL invalid argument
535 * @retval PKGMGR_R_ECOMM communication error
537 int pkgmgr_client_request_service(pkgmgr_request_service_type service_type, int service_mode,
538 pkgmgr_client * pc, const char *pkg_type, const char *pkgid,
539 const char *custom_info, pkgmgr_handler event_cb, void *data);
542 * @brief This API provides package list
544 * This API is for package-manager client application.\n
546 * @param[in] iter_fn iteration function for list
547 * @param[in] data user data
548 * @return 0 if success, error code(<0) if fail\n
549 * @retval PKGMGR_R_OK success
550 * @retval PKGMGR_R_EINVAL invalid argument
551 * @retval PKGMGR_R_ERROR internal error
553 int pkgmgr_get_pkg_list(pkgmgr_iter_fn iter_fn, void *data);
557 * @defgroup pkg_list APIs to get package information
560 * API to get package information
564 * @addtogroup pkg_list
570 * @brief This API gets the package's information.
572 * This API is for package-manager client application.\n
574 * @param[in] pkg_type package type for the package to get infomation
575 * @param[in] pkgid package id for the package to get infomation
576 * @return package entry pointer if success, NULL if fail\n
578 pkgmgr_info * pkgmgr_info_new(const char *pkg_type, const char *pkgid);
581 * @brief This API gets the package's information.
583 * This API is for package-manager client application.\n
585 * @param[in] pkg_type package type for the package to get infomation
586 * @param[in] pkg_path package file path to get infomation
587 * @return package entry pointer if success, NULL if fail\n
589 pkgmgr_info * pkgmgr_info_new_from_file(const char *pkg_type,
590 const char *pkg_path);
593 * @brief This API get package information value
595 * This API is for package-manager client application.\n
597 * @param[in] pkg_info pointer for package info entry
598 * @param[in] key key for package info field
599 * @return string value if success, NULL if fail\n
601 char * pkgmgr_info_get_string(pkgmgr_info * pkg_info, const char *key);
604 * @brief This API get package information value
606 * This API is for package-manager client application.\n
608 * @param[in] pkg_info pointer for package info entry
609 * @return 0 if success, error code(<0) if fail\n
611 int pkgmgr_info_free(pkgmgr_info * pkg_info);
614 * @brief This API gets list of installed applications.
616 * This API is for package-manager client application.\n
618 * @param[in] pkg_list_cb iteration function for list
619 * @param[in] user_data user data to be passed to callback function
620 * @return 0 if success, error code(<0) if fail\n
622 int pkgmgr_pkginfo_get_list(pkgmgr_info_pkg_list_cb pkg_list_cb, void *user_data);
625 * @brief This API get package info entry from db
627 * This API is for package-manager client application.\n
629 * @param[in] pkgid pointer to package id
630 * @param[out] handle pointer to the package info handle.
631 * @return 0 if success, error code(<0) if fail\n
633 int pkgmgr_pkginfo_get_pkginfo(const char *pkgid, pkgmgr_pkginfo_h *handle);
636 * @brief This API gets type of the given package.
638 * This API is for package-manager client application.\n
640 * @param[in] handle pointer to package info handle
641 * @param[out] type to hold package type.
642 * @return 0 if success, error code(<0) if fail\n
644 int pkgmgr_pkginfo_get_pkgname(pkgmgr_pkginfo_h handle, char **pkg_name);
647 * @brief This API gets id of the given package.
649 * This API is for package-manager client application.\n
651 * @param[in] handle pointer to package info handle
652 * @param[out]pkgid to hold package id.
653 * @return 0 if success, error code(<0) if fail\n
655 int pkgmgr_pkginfo_get_pkgid(pkgmgr_pkginfo_h handle, char **pkgid);
658 * @brief This API gets type of the given package.
660 * This API is for package-manager client application.\n
662 * @param[in] handle pointer to package info handle
663 * @param[out] type to hold package type.
664 * @return 0 if success, error code(<0) if fail\n
666 int pkgmgr_pkginfo_get_type(pkgmgr_pkginfo_h handle, char **type);
669 * @brief This API gets version of the given package.
671 * This API is for package-manager client application.\n
673 * @param[in] handle pointer to package info handle
674 * @param[out] version to hold package version.
675 * @return 0 if success, error code(<0) if fail\n
677 int pkgmgr_pkginfo_get_version(pkgmgr_pkginfo_h handle, char **version);
680 * @brief This API gets install location of the given package.
682 * This API is for package-manager client application.\n
684 * @param[in] handle pointer to package info handle
685 * @param[out] location to hold install location.
686 * @return 0 if success, error code(<0) if fail\n
688 int pkgmgr_pkginfo_get_install_location(pkgmgr_pkginfo_h handle, pkgmgr_install_location *location);
691 * @brief This API gets package size of the given package in case of external installation.
692 * size will be 0 if package install location is internal-only.
693 * size will be 0 if package install location is prefer-external but size is not specified in manifest file.
694 * Application should check the return value and use it distinguish the above cases.
696 * This API is for package-manager client application.\n
698 * @param[in] handle pointer to package info handle
699 * @param[out] size to hold package size.
700 * @return 0 if success, error code(<0) if fail\n
703 int pkgmgr_pkginfo_get_package_size(pkgmgr_pkginfo_h handle, int *size);
706 * @brief This API gets icon of the given package.
708 * This API is for package-manager client application.\n
710 * @param[in] handle pointer to package info handle
711 * @param[out] icon to hold package icon.
712 * @return 0 if success, error code(<0) if fail\n
714 int pkgmgr_pkginfo_get_icon(pkgmgr_pkginfo_h handle, char **icon);
717 * @brief This API gets label of the given package.
719 * This API is for package-manager client application.\n
721 * @param[in] handle pointer to package info handle
722 * @param[out] label to hold package label.
723 * @return 0 if success, error code(<0) if fail\n
725 int pkgmgr_pkginfo_get_label(pkgmgr_pkginfo_h handle, char **label);
728 * @brief This API gets desription of the given package.
730 * This API is for package-manager client application.\n
732 * @param[in] handle pointer to package info handle
733 * @param[out] description to hold package description.
734 * @return 0 if success, error code(<0) if fail\n
736 int pkgmgr_pkginfo_get_description(pkgmgr_pkginfo_h handle, char **description);
739 * @brief This API gets author's name of the given package.
741 * This API is for package-manager client application.\n
743 * @param[in] handle pointer to package info handle
744 * @param[out] author_name to hold author's name.
745 * @return 0 if success, error code(<0) if fail\n
747 int pkgmgr_pkginfo_get_author_name(pkgmgr_pkginfo_h handle, char **author_name);
750 * @brief This API gets author's email of the given package.
752 * This API is for package-manager client application.\n
754 * @param[in] handle pointer to package info handle
755 * @param[out] author_email to hold author's email id.
756 * @return 0 if success, error code(<0) if fail\n
758 int pkgmgr_pkginfo_get_author_email(pkgmgr_pkginfo_h handle, char **author_email);
761 * @brief This API gets author's href of the given package.
763 * This API is for package-manager client application.\n
765 * @param[in] handle pointer to package info handle
766 * @param[out] author_href to hold author's href.
767 * @return 0 if success, error code(<0) if fail\n
769 int pkgmgr_pkginfo_get_author_href(pkgmgr_pkginfo_h handle, char **author_href);
772 * @brief This API gets removable of the given package.
774 * This API is for package-manager client application.\n
776 * @param[in] handle pointer to package info handle
777 * @param[out] removable to hold removable value.
778 * @return 0 if success, error code(<0) if fail\n
780 int pkgmgr_pkginfo_is_removable(pkgmgr_pkginfo_h handle, bool *removable);
783 * @brief This API gets preload of the given package.
785 * This API is for package-manager client application.\n
787 * @param[in] handle pointer to package info handle
788 * @param[out] preload to hold preload value
789 * @return 0 if success, error code(<0) if fail\n
791 int pkgmgr_pkginfo_is_preload(pkgmgr_pkginfo_h handle, bool *preload);
794 * @brief This API gets readonly value of the given package.
796 * This API is for package-manager client application.\n
798 * @param[in] handle pointer to package info handle
799 * @param[out] readonly to hold readonly value
800 * @return 0 if success, error code(<0) if fail\n
802 int pkgmgr_pkginfo_is_readonly(pkgmgr_pkginfo_h handle, bool *readonly);
805 * @brief This API gets accessible of the given package.
807 * This API is for package-manager client application.\n
809 * @param[in] pkgid id of package
810 * @param[out]accessible accessible of package
811 * @return 0 if success, error code(<0) if fail\n
813 int pkgmgr_pkginfo_is_accessible(pkgmgr_pkginfo_h handle, bool *accessible);
816 * @brief This API destroy the pacakge info handle
818 * This API is for package-manager client application.\n
820 * @param[in] handle pointer to package info handle
821 * @return 0 if success, error code(<0) if fail\n
823 int pkgmgr_pkginfo_destroy_pkginfo(pkgmgr_pkginfo_h handle);
826 * @brief This API gets installed storage of the given package.
828 * This API is for package-manager client application.\n
830 * @param[in] pkgid id of package
831 * @param[out] storage storage of package
832 * @return 0 if success, error code(<0) if fail\n
834 int pkgmgr_pkginfo_get_installed_storage(pkgmgr_pkginfo_h handle, pkgmgr_installed_storage *storage);
837 * @brief This API gets installed time of the given package.
839 * This API is for package-manager client application.\n
841 * @param[in] handle pointer to package info handle
842 * @param[out] installed_time installed time of package
843 * @return 0 if success, error code(<0) if fail\n
845 int pkgmgr_pkginfo_get_installed_time(pkgmgr_pkginfo_h handle, int *installed_time);
848 * @brief This API gets list of ui-application/service application of the given package.
850 * This API is for package-manager client application.\n
852 * @param[in] handle pointer to package info handle
853 * @param[in] component application component type.
854 * @param[in] app_func application's callback function.
855 * @param[in] user_data user data to be passed to callback function
856 * @return 0 if success, error code(<0) if fail\n
858 int pkgmgr_appinfo_get_list(pkgmgr_pkginfo_h handle, pkgmgr_app_component component,
859 pkgmgr_info_app_list_cb app_func, void *user_data);
862 * @brief This API gets list of category for ui-application/service application.
864 * This API is for package-manager client application.\n
866 * @param[in] handle pointer to package info handle
867 * @param[in] category_func callback function.
868 * @param[in] user_data user data to be passed to callback function
869 * @return 0 if success, error code(<0) if fail\n
871 int pkgmgr_appinfo_foreach_category(pkgmgr_appinfo_h handle, pkgmgr_info_app_category_list_cb category_func,
875 * @brief This API gets application info entry from db.
877 * This API is for package-manager client application.\n
879 * @param[in] appid application id
880 * @param[out] handle pointer to app info handle
881 * @return 0 if success, error code(<0) if fail\n
883 int pkgmgr_appinfo_get_appinfo(const char *appid, pkgmgr_appinfo_h *handle);
886 * @brief This API gets appid of the given appid.
888 * This API is for package-manager client application.\n
890 * @param[in] handle pointer to app info handle
891 * @param[out] appid to hold appid value
892 * @return 0 if success, error code(<0) if fail\n
894 int pkgmgr_appinfo_get_appid(pkgmgr_appinfo_h handle, char **appid);
897 * @brief This API gets pkgid of the given appid.
899 * This API is for package-manager client application.\n
901 * @param[in] handle pointer to app info handle
902 * @param[out]pkg_name to hold pkgid value
903 * @return 0 if success, error code(<0) if fail\n
905 int pkgmgr_appinfo_get_pkgname(pkgmgr_appinfo_h handle, char **pkg_name);
908 * @brief This API gets pkgid of the given appid.
910 * This API is for package-manager client application.\n
912 * @param[in] handle pointer to app info handle
913 * @param[out] pkgid to hold pkgid value
914 * @return 0 if success, error code(<0) if fail\n
916 int pkgmgr_appinfo_get_pkgid(pkgmgr_appinfo_h handle, char **pkgid);
919 * @brief This API gets exec of the given appid.
921 * This API is for package-manager client application.\n
923 * @param[in] handle pointer to app info handle
924 * @param[out] exec to hold exec value
925 * @return 0 if success, error code(<0) if fail\n
927 int pkgmgr_appinfo_get_exec(pkgmgr_appinfo_h handle, char **exec);
930 * @brief This API gets icon name of the given appid.
932 * This API is for package-manager client application.\n
934 * @param[in] handle pointer to app info handle
935 * @param[out] icon to hold icon value
936 * @return 0 if success, error code(<0) if fail\n
938 int pkgmgr_appinfo_get_icon(pkgmgr_appinfo_h handle, char **icon);
941 * @brief This API gets label of the given appid.
943 * This API is for package-manager client application.\n
945 * @param[in] handle pointer to app info handle
946 * @param[out] label to hold label value
947 * @return 0 if success, error code(<0) if fail\n
949 int pkgmgr_appinfo_get_label(pkgmgr_appinfo_h handle, char **label);
952 * @brief This API gets package name of the given appid.
954 * This API is for package-manager client application.\n
956 * @param[in] handle pointer to app info handle
957 * @param[out] package to hold package value
958 * @return 0 if success, error code(<0) if fail\n
960 int pkgmgr_appinfo_get_package(pkgmgr_appinfo_h handle, char **package);
963 * @brief This API gets component type of the given appid.
965 * This API is for package-manager client application.\n
967 * @param[in] handle pointer to app info handle
968 * @param[out] component to hold component value
969 * @return 0 if success, error code(<0) if fail\n
971 int pkgmgr_appinfo_get_component(pkgmgr_appinfo_h handle, pkgmgr_app_component *component);
974 * @brief This API gets app type of the given appid.
976 * This API is for package-manager client application.\n
978 * @param[in] handle pointer to app info handle
979 * @param[out] app_type to hold the apptype.
980 * @return 0 if success, error code(<0) if fail\n
982 int pkgmgr_appinfo_get_apptype(pkgmgr_appinfo_h handle, char **app_type);
985 * @brief This API gets nodisplay value of the given appid.
987 * This API is for package-manager client application.\n
989 * @param[in] handle pointer to app info handle
990 * @param[out] nodisplay to hold the nodisplay value
991 * @return 0 if success, error code(<0) if fail\n
993 int pkgmgr_appinfo_is_nodisplay(pkgmgr_appinfo_h handle, bool *nodisplay);
996 * @brief This API gets multiple value of the given appid.
998 * This API is for package-manager client application.\n
1000 * @param[in] handle pointer to app info handle
1001 * @param[out] multiple to hold the multiple value
1002 * @return 0 if success, error code(<0) if fail\n
1004 int pkgmgr_appinfo_is_multiple(pkgmgr_appinfo_h handle, bool *multiple);
1007 * @brief This API gets taskmanage value of the given appid.
1009 * This API is for package-manager client application.\n
1011 * @param[in] handle pointer to app info handle
1012 * @param[out] taskmanage to hold the taskmanage value
1013 * @return 0 if success, error code(<0) if fail\n
1015 int pkgmgr_appinfo_is_taskmanage(pkgmgr_appinfo_h handle, bool *taskmanage);
1018 * @brief This API gets hwacceleration value of the given appid.
1020 * This API is for package-manager client application.\n
1022 * @param[in] handle pointer to app info handle
1023 * @param[out] hwacceleration to hold the hwacceleration value
1024 * @return 0 if success, error code(<0) if fail\n
1026 int pkgmgr_appinfo_get_hwacceleration(pkgmgr_appinfo_h handle, pkgmgr_hwacceleration_type *hwacceleration);
1029 * @brief This API gets onboot value of the given appid.
1031 * This API is for package-manager client application.\n
1033 * @param[in] handle pointer to app info handle
1034 * @param[out] onboot to hold the onboot value
1035 * @return 0 if success, error code(<0) if fail\n
1037 int pkgmgr_appinfo_is_onboot(pkgmgr_appinfo_h handle, bool *onboot);
1040 * @brief This API gets autorestart value of the given appid.
1042 * This API is for package-manager client application.\n
1044 * @param[in] handle pointer to app info handle
1045 * @param[out] autorestart to hold the autorestart value
1046 * @return 0 if success, error code(<0) if fail\n
1048 int pkgmgr_appinfo_is_autorestart(pkgmgr_appinfo_h handle, bool *autorestart);
1051 * @brief This API destroy the appinfo handle.
1053 * This API is for package-manager client application.\n
1055 * @param[in] handle pointer to app info handle
1056 * @return 0 if success, error code(<0) if fail\n
1058 int pkgmgr_appinfo_destroy_appinfo(pkgmgr_appinfo_h handle);
1061 * @brief This API creates the certinfo handle.
1063 * This API is for package-manager client application.\n
1065 * @param[out] handle pointer to cert info handle
1066 * @return 0 if success, error code(<0) if fail\n
1068 int pkgmgr_pkginfo_create_certinfo(pkgmgr_certinfo_h *handle);
1071 * @brief This API loads cert info in the handle.
1073 * This API is for package-manager client application.\n
1075 * @param[in] handle pointer to cert info handle
1076 * @param[in] pkgid package ID
1077 * @return 0 if success, error code(<0) if fail\n
1079 int pkgmgr_pkginfo_load_certinfo(const char *pkgid, pkgmgr_certinfo_h handle);
1082 * @brief This API gets cert value for corresponding cert type.
1084 * This API is for package-manager client application.\n
1086 * @param[in] handle pointer to cert info handle
1087 * @param[in] cert_type enum value for certificate type
1088 * @param[out] cert_value pointer to store cert value
1089 * @return 0 if success, error code(<0) if fail\n
1091 int pkgmgr_pkginfo_get_cert_value(pkgmgr_certinfo_h handle, pkgmgr_cert_type cert_type, const char **cert_value);
1094 * @brief This API destroys cert info handle freeing all resources.
1096 * This API is for package-manager client application.\n
1098 * @param[in] handle pointer to cert info handle
1099 * @return 0 if success, error code(<0) if fail\n
1101 int pkgmgr_pkginfo_destroy_certinfo(pkgmgr_certinfo_h handle);
1104 * @brief This API gets datacontrol info entry from db.
1106 * This API is for package-manager client application.\n
1108 * @param[in] providerid pointer to providerid
1109 * @param[in] type pointer to type
1110 * @param[out] appid pointer to appid value
1111 * @param[out] access pointer to access value
1112 * @return 0 if success, error code(<0) if fail\n
1114 int pkgmgr_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
1121 #endif /* __PKG_MANAGER_H__ */