Release version 0.13.5
[platform/core/appfw/pkgmgr-info.git] / include / pkgmgr-info.h
index 5bb8bd4..9be5008 100644 (file)
@@ -99,6 +99,8 @@ extern "C" {
 #define        PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD             "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
  /** Boolean property for filtering based on package info*/
 #define        PMINFO_PKGINFO_PROP_PACKAGE_READONLY            "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
+   /** Boolean property for filtering based on package info*/
+#define        PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM              "PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM"
   /** Boolean property for filtering based on package info*/
 #define        PMINFO_PKGINFO_PROP_PACKAGE_UPDATE              "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
   /** Boolean property for filtering based on package info*/
@@ -141,6 +143,8 @@ 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_PRIVILEGE   "PMINFO_APPINFO_PROP_PRIVILEGE"
 
 /** Integer property for filtering app support mode */
 #define        PMINFO_APPINFO_PROP_APP_SUPPORT_MODE            "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
@@ -165,6 +169,8 @@ extern "C" {
 #define        PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
  /** Boolean property for filtering based on app info*/
 #define        PMINFO_APPINFO_PROP_APP_CHECK_STORAGE   "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
+/** Boolean property for filtering based on app info*/
+#define        PMINFO_APPINFO_PROP_PKG_DISABLE "PMINFO_APPINFO_PROP_PKG_DISABLE"
 
  /** will be updated*/
  /** string property for filtering based on pkg info*/
@@ -175,7 +181,6 @@ const char *getIconPath(uid_t uid, bool readonly);
 char *getUserPkgParserDBPath(void);
 char *getUserPkgParserDBPathUID(uid_t uid);
 char *getUserPkgCertDBPath(void);
-char *getUserPkgCertDBPathUID(uid_t uid);
 const char *getUserManifestPath(uid_t uid, bool readonly);
 
 /**
@@ -2391,6 +2396,7 @@ static int get_tpk_pkg_count()
  */
 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
+
 /**
  * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
                        pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
@@ -2436,6 +2442,51 @@ static int list_privilege(const char *package, char *privilege)
 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
                        pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
 
+/**
+ * @fn int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
+                       pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
+ * @brief      This API gets the list of appdefined privilege for a particular package
+ *
+ * @par                This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ * @param[in]  handle          pointer to the package info handle.
+ * @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
+ * @pre                pkgmgrinfo_pkginfo_get_pkginfo()
+ * @post               pkgmgrinfo_pkginfo_destroy_pkginfo()
+ * @code
+int privilege_func(const char *name, const char *license_path, void *user_data)
+{
+       printf("appdefined privilege : %s", name);
+       if (license_path)
+               printf("licensed privilege, lecense path : %s", license_path);
+       return 0;
+}
+
+static int list_appdefined_privilege(const char *package)
+{
+       int ret = 0;
+       pkgmgrinfo_pkginfo_h handle;
+       ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
+       if (ret != PMINFO_R_OK)
+               return -1;
+       ret = pkgmgrinfo_pkginfo_foreach_appdefined_privilege(handle, privilege_func, NULL);
+       if (ret != PMINFO_R_OK) {
+               pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+               return -1;
+       }
+       pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+       return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
+                       pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
+
 /* TODO: add doxygen comment here */
 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
 
@@ -3408,45 +3459,6 @@ static int get_app_notification_icon(const char *appid)
 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
 
 /**
- * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
- * @brief      This API gets the setting icon of the application
- *
- * @par                This API is for package-manager client application
- * @par Sync (or) Async : Synchronous API
- *
- * @param[in] handle           pointer to the application info handle.
- * @param[out] path            pointer to hold setting icon
- * @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                pkgmgrinfo_appinfo_get_appinfo()
- * @post               pkgmgrinfo_appinfo_destroy_appinfo()
- * @see                pkgmgrinfo_appinfo_get_appid()
- * @see                pkgmgrinfo_appinfo_is_multiple()
- * @code
-static int get_app_setting_icon(const char *appid)
-{
-       int ret = 0;
-       char *setting_icon = NULL;
-       pkgmgrinfo_appinfo_h handle;
-       ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
-       if (ret != PMINFO_R_OK)
-               return -1;
-       ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
-       if (ret != PMINFO_R_OK) {
-               pkgmgrinfo_appinfo_destroy_appinfo(handle);
-               return -1;
-       }
-       printf("setting icon : %s\n", setting_icon);
-       pkgmgrinfo_appinfo_destroy_appinfo(handle);
-       return 0;
-}
- * @endcode
- */
-int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
-
-/**
  * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
  * @brief      This API gets the type of recent image on app-tray
  *
@@ -3859,6 +3871,28 @@ 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
  *
@@ -4162,50 +4196,6 @@ static int get_app_support_mode(const char *appid)
  */
 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
 
-/**
- * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
-                       pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
- * @brief      This API gets the list of permission for a particular application
- *
- * @par                This API is for package-manager client application
- * @par Sync (or) Async : Synchronous API
- * @param[in]  handle          pointer to the application info handle.
- * @param[in]  permission_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
- * @pre                pkgmgrinfo_appinfo_get_appinfo()
- * @post               pkgmgrinfo_appinfo_destroy_appinfo()
- * @code
-int permission_func(const char *name, void *user_data)
-{
-       if (strcmp(name, (char *)user_data) == 0)
-               return -1;
-       else
-               return 0;
-}
-
-static int list_permission(const char *appid, char *permission)
-{
-       int ret = 0;
-       pkgmgrinfo_appinfo_h handle;
-       ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
-       if (ret != PMINFO_R_OK)
-               return -1;
-       ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
-       if (ret != PMINFO_R_OK) {
-               pkgmgrinfo_appinfo_destroy_appinfo(handle);
-               return -1;
-       }
-       pkgmgrinfo_appinfo_destroy_appinfo(handle);
-       return 0;
-}
- * @endcode
- */
-int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
-                       pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
 
 /**
  * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
@@ -4299,6 +4289,33 @@ static int list_metadata(const char *appid, char *key)
 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
                        pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
 
+/**
+ * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
+ *                     const char *operation,
+ *                     pkgmgrinfo_pkg_privilege_list_cb privilege_func,
+ *                     void *user_data);
+ * @brief      This API gets the list of privileges for a particular
+ *             appllication's app_control
+ *
+ * @par                This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ * @param[in]  appid           application id
+ * @param[in]  operation       operation of appcontrol
+ * @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_usr_foreach_appcontrol_privileges(const char *appid,
+               const char *operation,
+               pkgmgrinfo_pkg_privilege_list_cb privilege_func,
+               void *user_data, uid_t uid);
+int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
+               const char *operation,
+               pkgmgrinfo_pkg_privilege_list_cb privilege_func,
+               void *user_data);
 
 /**
  * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
@@ -4354,6 +4371,9 @@ static int check_operation(const char *appid, char *operation)
 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
                        pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
 
+int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
+                       pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
+
 /**
  * @brief
  */
@@ -6193,6 +6213,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
 **/