Include "sys/types.h" at pkgmgr-info.h
[platform/core/appfw/pkgmgr-info.git] / include / pkgmgr-info.h
old mode 100755 (executable)
new mode 100644 (file)
index f08cd9e..a82ab8b
@@ -48,6 +48,8 @@
 
 #include <errno.h>
 #include <stdbool.h>
+#include <unistd.h>
+#include <sys/types.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -2523,6 +2525,41 @@ static int get_app_label(const char *appid)
 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h  handle, char **label);
 
 /**
+ * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
+ * @brief      This API gets exactly matched label by given appid and locale
+ *
+ * @par                This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in]  appid   pointer to appid
+ * @param[in]  locale  pointer to locale
+ * @param[out] label           pointer to hold app label
+ * @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_localed_label(const char *appid, const char *locale)
+{
+       int ret = 0;
+       char *label = NULL;
+
+       ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
+       if (ret != PMINFO_R_OK)
+               return -1;
+
+       printf("localed label: %s\n", label);
+
+       free(label);
+
+       return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
+int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
+
+/**
  * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
  * @brief      This API gets the component of the application
  *
@@ -3831,6 +3868,44 @@ static int get_app_submode(const char *appid)
 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
 
 /**
+ * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
+ * @brief      This API checks if the application has the given category
+ *
+ * @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]  category        category
+ * @param[out] exist           value Gets whether the application has the given category
+ * @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 is_category_exist(const char *appid, const char *category)
+{
+       int ret = 0;
+       pkgmgrinfo_appinfo_h handle;
+       bool exist = false;
+
+       ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
+       if (ret != PMINFO_R_OK)
+               return -1;
+
+       ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
+       if (ret != PMINFO_R_OK) {
+               pkgmgrinfo_appinfo_destroy_appinfo(handle);
+               return -1;
+       }
+
+       pkgmgrinfo_appinfo_destroy_appinfo(handle);
+       return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
+
+/**
  * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
  * @brief      This API destroys the application information handle freeing up all the resources
  *