X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fpkgmgr-info.h;h=781a1ab94f0a0e7635c202dc6b9beedd25033f84;hb=refs%2Fchanges%2F10%2F129210%2F19;hp=bbd7d8ae542141f543659d864f7faaa02b27276a;hpb=8a0c1f5d39d26356588bc979424c28dd801492bf;p=platform%2Fcore%2Fappfw%2Fpkgmgr-info.git diff --git a/include/pkgmgr-info.h b/include/pkgmgr-info.h index bbd7d8a..781a1ab 100644 --- a/include/pkgmgr-info.h +++ b/include/pkgmgr-info.h @@ -141,13 +141,7 @@ extern "C" { #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE" /** String property for filtering based on app info*/ #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE" - /** String property for filtering based on app info*/ -#define PMINFO_APPINFO_PROP_APP_METADATA_KEY "PMINFO_APPINFO_PROP_APP_METADATA_KEY" - /** String property for filtering based on app info*/ -#define PMINFO_APPINFO_PROP_APP_METADATA_VALUE "PMINFO_APPINFO_PROP_APP_METADATA_VALUE" - /** Integer property for filtering app disabled by user*/ -#define PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER "PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER_VALUE" /** Integer property for filtering app support mode */ #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE" @@ -626,6 +620,47 @@ static int get_zip_mount_file(const char *pkgid) int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file); /** + * @fn int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path) + * @brief This API gets package external image path associated with the package + * if package is installed in external storage. + * Otherwise, the return value will be PMINFO_R_ENOENT. + * + * @par This API is for package-manager client application + * @par Sync (or) Async : Synchronous API + * + * @param[in] handle pointer to the pkginfo handle. + * @param[out] ext_image_path pointer to hold external image path + * @return 0 if success, error code(<0) if fail + * @retval PMINFO_R_OK success + * @retval PMINFO_R_EINVAL invalid argument + * @retval PMINFO_R_ERROR internal error + * @revall PMINFO_R_ENOENT no valid data + * @pre pkgmgrinfo_pkginfo_get_pkginfo() + * @post pkgmgrinfo_pkginfo_destroy_pkginfo() + * @see pkgmgrinfo_pkginfo_get_pkgid() + * @code +static int get_external_image_path(const char *pkgid) +{ + int ret = 0; + char *ext_image_path = NULL; + pkgmgrinfo_pkginfo_h handle = NULL; + ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle); + if (ret != PMINFO_R_OK) + return -1; + ret = pkgmgrinfo_pkginfo_get_external_image_path(handle, &ext_image_path); + if (ret != PMINFO_R_OK) { + pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + return -1; + } + printf("external image path is: %s\n", ext_image_path); + pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + return 0; +} + * @endcode + */ +int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path); + +/** * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location) * @brief This API gets the package install location from the package ID * @@ -1018,6 +1053,302 @@ static int get_pkg_installed_time(const char *pkgid) int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time); /** + * @fn int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle) + * @brief This API creates the update info handle + * + * @par This API is for package-manager client application + * @par Sync (or) Async : Synchronous API + * + * @param[out] handle pointer to package update info handle + * @return 0 if success, error code(<0) if fail + * @retval PMINFO_R_OK success + * @retval PMINFO_R_EINVAL invalid argument + * @retval PMINFO_R_ERROR internal error + * @post pkgmgrinfo_updateinfo_destroy() + * @see pkgmgrinfo_updateinfo_set_pkgid() + * @see pkgmgrinfo_updateinfo_set_version() + * @see pkgmgrinfo_updateinfo_set_type() + * @see pkgmgr_client_register_pkg_updateinfo() + * @code +static int updateinfo_handle_create() +{ + int ret = 0; + + pkgmgrinfo_updateinfo_h handle; + ret = pkgmgrinfo_updateinfo_create(&handle); + if (ret != PMINFO_R_OK) + return -1; + pkgmgrinfo_update_infodestroy(handle); + return 0; +} + * @endcode + */ +int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle); + +/** + * @fn int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle) + * @brief This API destroy the update info handle + * + * @par This API is for package-manager client application + * @par Sync (or) Async : Synchronous API + * + * @param[in] handle pointer to package update info handle + * @return 0 if success, error code(<0) if fail + * @retval PMINFO_R_OK success + * @retval PMINFO_R_EINVAL invalid argument + * @pre pkgmgrinfo_updateinfo_create() + * @see pkgmgr_client_register_pkg_updateinfo() + * @code +static int updateinfo_handle_destroy(pkgmgrinfo_updateinfo_h handle) +{ + int ret = 0; + + ret = pkgmgrinfo_updateinfo_destroy(handle); + if (ret != PMINFO_R_OK) + return -1; + return 0; +} + * @endcode + */ +int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle); + +/** + * @fn int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle) + * @brief This API creates the package update information handle from db + * + * @par This API is for package-manager client application + * @par Sync (or) Async : Synchronous API + * + * @param[in] pkgid pointer to package ID + * @param[in] uid the addressee user id of the instruction + * @param[out] update_handle pointer to the package update info handle. + * @return 0 if success, error code(<0) if fail + * @retval PMINFO_R_OK success + * @retval PMINFO_R_EINVAL invalid argument + * @retval PMINFO_R_ERROR internal error + * @pre None + * @post pkgmgrinfo_updateinfo_destroy() + * @see pkgmgrinfo_updateinfo_get_pkgid() + * @see pkgmgrinfo_updateinfo_get_version() + * @see pkgmgrinfo_updateinfo_get_update_type() + * @code +static int get_pkg_update_info(const char *pkgid) +{ + int ret = 0; + char *version; + pkgmgrinfo_updateinfo_h handle; + ret = pkgmgrinfo_updateinfo_get_updateinfo(pkgid, &handle); + if (ret != PMINFO_R_OK) + return -1; + ret = pkgmgrinfo_updateinfo_get_version(handle, &version); + if (ret != PMINFO_R_OK) { + pkgmgrinfo_updateinfo_destroy(handle); + return -1; + } + printf("pkg update version: %s\n", version + pkgmgrinfo_updateinfo_destroy(handle); + return 0; +} + * @endcode + */ +int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle); +int pkgmgrinfo_updateinfo_get_usr_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle, uid_t uid); + +/** + * @fn int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid) + * @brief This API sets given pkgid into handle + * + * @par This API is for package-manager client application + * @par Sync (or) Async : Synchronous API + * + * @param[in] handle pointer to package update info handle + * @param[in] pkgid package id + * @return 0 if success, error code(<0) if fail + * @retval PMINFO_R_OK success + * @retval PMINFO_R_EINVAL invalid argument + * @retval PMINFO_R_ERROR internal error + * @code +static int set_pkgid_to_handle(pkgmgrinfo_updateinfo_h handle, const char *pkgid) +{ + int ret = 0; + + ret = pkgmgrinfo_updateinfo_set_pkgid(handle, pkgid); + if (ret != PMINFO_R_OK) + return -1; + return 0; +} + * @endcode + */ +int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid); + +/** + * @fn int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version) + * @brief This API sets given version into handle + * + * @par This API is for package-manager client application + * @par Sync (or) Async : Synchronous API + * + * @param[in] handle pointer to package update info handle + * @param[in] version update version + * @return 0 if success, error code(<0) if fail + * @retval PMINFO_R_OK success + * @retval PMINFO_R_EINVAL invalid argument + * @retval PMINFO_R_ERROR internal error + * @code +static int set_version_to_handle(pkgmgrinfo_updateinfo_h handle, const char *version) +{ + int ret = 0; + + ret = pkgmgrinfo_updateinfo_set_version(handle, version); + if (ret != PMINFO_R_OK) + return -1; + return 0; +} + * @endcode + */ +int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version); + +/** + * @fn int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type) + * @brief This API sets given update type into handle + * + * @par This API is for package-manager client application + * @par Sync (or) Async : Synchronous API + * + * @param[in] handle pointer to package update info handle + * @param[in] type update type + * @return 0 if success, error code(<0) if fail + * @retval PMINFO_R_OK success + * @retval PMINFO_R_EINVAL invalid argument + * @retval PMINFO_R_ERROR internal error + * @code +static int set_type_to_handle(pkgmgrinfo_updateinfo_h handle, pkgmgrinfo_updateinfo_update_type type) +{ + int ret = 0; + + ret = pkgmgrinfo_updateinfo_set_type(handle, type); + if (ret != PMINFO_R_OK) + return -1; + return 0; +} + * @endcode + */ +int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type); + +/** + * @fn int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid) + * @brief This API retrieves the pkgid from given update info + * + * @par This API is for package-manager client application + * @par Sync (or) Async : Synchronous API + * + * @param[in] handle pointer to package update info handle + * @param[out] pkgid package id + * @return 0 if success, error code(<0) if fail + * @retval PMINFO_R_OK success + * @retval PMINFO_R_EINVAL invalid argument + * @retval PMINFO_R_ERROR internal error + * @code +static int get_pkgid_from_handle(pkgmgrinfo_updateinfo_h handle) +{ + int ret = 0; + char *pkgid; + + ret = pkgmgrinfo_updateinfo_get_pkgid(handle, &pkgid); + if (ret != PMINFO_R_OK) + return -1; + return 0; +} + * @endcode + */ +int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid); + +/** + * @fn int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version) + * @brief This API retrieves the version from given update info + * + * @par This API is for package-manager client application + * @par Sync (or) Async : Synchronous API + * + * @param[in] handle pointer to package update info handle + * @param[out] version update version + * @return 0 if success, error code(<0) if fail + * @retval PMINFO_R_OK success + * @retval PMINFO_R_EINVAL invalid argument + * @retval PMINFO_R_ERROR internal error + * @code +static int get_version_from_handle(pkgmgrinfo_updateinfo_h handle) +{ + int ret = 0; + char *version; + + ret = pkgmgrinfo_updateinfo_get_version(handle, &version); + if (ret != PMINFO_R_OK) + return -1; + return 0; +} + * @endcode + */ +int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version); + +/** + * @fn int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type) + * @brief This API retrieves the update type from given update info + * + * @par This API is for package-manager client application + * @par Sync (or) Async : Synchronous API + * + * @param[in] handle pointer to package update info handle + * @param[out] type update type + * @return 0 if success, error code(<0) if fail + * @retval PMINFO_R_OK success + * @retval PMINFO_R_EINVAL invalid argument + * @retval PMINFO_R_ERROR internal error + * @code +static int get_type_from_handle(pkgmgrinfo_updateinfo_h handle) +{ + int ret = 0; + pkgmgrinfo_updateinfo_update_type *type; + + ret = pkgmgrinfo_updateinfo_get_type(handle, &type); + if (ret != PMINFO_R_OK) + return -1; + return 0; +} + * @endcode + */ +int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type); + + +/** + * @fn int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data) + * @brief This API retrieve the update informations and invoke given callback for it. + * + * @par This API is for package-manager client application + * @par Sync (or) Async : Synchronous API + * + * @param[in] callback callback to be invoked for each retrieved informations + * @param[in] user_data user data to be passed to callback + * @return 0 if success, error code(<0) if fail + * @retval PMINFO_R_OK success + * @retval PMINFO_R_EINVAL invalid argument + * @retval PMINFO_R_ERROR internal error + * @code +static int foreach_pkg_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback) +{ + int ret = 0; + + ret = pkgmgrinfo_updateinfo_foreach_updateinfo(callback, NULL); + if (ret != PMINFO_R_OK) + return -1; + return 0; +} + * @endcode + */ +int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data); +int pkgmgrinfo_updateinfo_usr_foreach_updateinfo(uid_t uid, pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data); + +/** * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode) * @brief This API gets the launch mode of package from the package ID * @@ -3507,6 +3838,49 @@ int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appi int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid); /** + * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted); + * @brief This API gets the information about trusted datacontrol + * + * @par This API is for package-manager client application + * @par Sync (or) Async : Synchronous API + * + * @param[in] providerid pointer to the providerid of datacontrol. + * @param[out] appid pointer to hold appid, need to free after using + * @param[out] is_trusted pointer to hold whether it provides trusted datacontrol + * @return 0 if success, error code(<0) if fail + * @retval PMINFO_R_OK success + * @retval PMINFO_R_EINVAL invalid argument + * @retval PMINFO_R_ERROR internal error + * @endcode + */ +int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, + const char *type, char **appid, bool *is_trusted); +int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid, + const char *type, uid_t uid, char **appid, bool *is_trusted); + +/** + * @fn int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type, + pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data); + * @brief This API retrieves the privileges and invokes given callback for each privilege. + * + * @par This API is for package-manager client application + * @par Sync (or) Async : Synchronous API + * + * @param[in] providerid pointer to the providerid of datacontrol. + * @param[in] type pointer to the type of dataconltrol. + * @param[in] privilege_func callback function for list + * @param[in] user_data user data to be passed to callback function + * @return 0 if success, error code(<0) if fail + * @retval PMINFO_R_OK success + * @retval PMINFO_R_EINVAL invalid argument + * @retval PMINFO_R_ERROR internal error + */ +int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type, + pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data); +int pkgmgrinfo_appinfo_usr_foreach_datacontrol_privileges(const char *providerid, const char *type, + pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data, uid_t uid); + +/** * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid) * @brief This API gets the alias_appid of the application * @@ -4775,6 +5149,38 @@ int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global); int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display); /** + * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid) + * @brief This API gets the application 'setup_appid' value from the app ID + * + * @par This API is for package-manager client application + * @par Sync (or) Async : Synchronous API + * + * @param[in] handle pointer to application info handle + * @param[out] setup_appid pointer to hold package setup_appid value + * @return 0 if success, error code(<0) if fail + * @retval PMINFO_R_OK success + * @retval PMINFO_R_EINVAL invalid argument + * @retval PMINFO_R_ERROR internal error + */ +int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid); + +/** + * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient) + * @brief This API gets the application 'support_ambient' value from the app ID + * + * @par This API is for package-manager client application + * @par Sync (or) Async : Synchronous API + * + * @param[in] handle pointer to application info handle + * @param[out] support_ambient pointer to hold package support_ambient value + * @return 0 if success, error code(<0) if fail + * @retval PMINFO_R_OK success + * @retval PMINFO_R_EINVAL invalid argument + * @retval PMINFO_R_ERROR internal error + */ +int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient); + +/** * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle) * @brief This API destroys the application information handle freeing up all the resources * @@ -5790,6 +6196,10 @@ static int set_app_installed_storage(const char *appid, INSTALL_LOCATION locatio int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path); int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid); +/* version compare */ +int pkgmgrinfo_compare_package_version(const char *current_version, + const char *target_version, pkgmgrinfo_version_compare_type *res); + /** * @brief TEMP */ @@ -5805,6 +6215,27 @@ int pkgmgrinfo_appinfo_get_usr_installed_list_full( int pkgmgrinfo_appinfo_get_installed_list_full( pkgmgrinfo_app_list_cb app_func, int flag, void *user_data); + +int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path, + pkgmgrinfo_archiveinfo_h *handle); +int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle); +int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle, + const char **pkgid); +int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle, + const char **type); +int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle, + const char **version); +int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle, + const char **api_version); +int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle, + const char **description); +int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle, + const char **label); +int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle, + const char **author); +int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle, + const unsigned char **icon, size_t *size); + /** * @pkgmgrinfo client API end **/