Implement support_mode related feature
[platform/core/appfw/pkgmgr-info.git] / include / pkgmgrinfo_private.h
index e661e42..776cd89 100644 (file)
@@ -63,6 +63,7 @@
 #define BLOCK_SIZE      4096 /*in bytes*/
 #define BUFSIZE 4096
 #define ROOT_UID 0
+#define APPFW_UID 301
 
 #define PKG_SD_PATH tzplatform_mkpath3(TZ_SYS_STORAGE, "sdcard", "app2sd/")
 #define PKG_INSTALLATION_PATH tzplatform_mkpath(TZ_USER_APP, "")
@@ -98,7 +99,9 @@ typedef enum _pkgmgrinfo_pkginfo_filter_prop_bool {
        E_PMINFO_PKGINFO_PROP_PACKAGE_UPDATE,
        E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING,
        E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_BOOL = E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING
+       E_PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE,
+       E_PMINFO_PKGINFO_PROP_PACKAGE_DISABLE,
+       E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_BOOL = E_PMINFO_PKGINFO_PROP_PACKAGE_DISABLE
 } pkgmgrinfo_pkginfo_filter_prop_bool;
 
 /*Integer properties for filtering based on package info*/
@@ -123,6 +126,7 @@ typedef enum _pkgmgrinfo_appinfo_filter_prop_str {
        E_PMINFO_APPINFO_PROP_APP_CATEGORY,
        E_PMINFO_APPINFO_PROP_APP_SCREENREADER,
        E_PMINFO_APPINFO_PROP_APP_PACKAGE,
+       E_PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE,
        E_PMINFO_APPINFO_PROP_APP_METADATA_KEY,
        E_PMINFO_APPINFO_PROP_APP_METADATA_VALUE,
        E_PMINFO_APPINFO_PROP_APP_MAX_STR = E_PMINFO_APPINFO_PROP_APP_METADATA_VALUE
@@ -138,14 +142,18 @@ typedef enum _pkgmgrinfo_appinfo_filter_prop_bool {
        E_PMINFO_APPINFO_PROP_APP_TASKMANAGE,
        E_PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION,
        E_PMINFO_APPINFO_PROP_APP_UI_GADGET,
-       E_PMINFO_APPINFO_PROP_APP_MAX_BOOL = E_PMINFO_APPINFO_PROP_APP_UI_GADGET
+       E_PMINFO_APPINFO_PROP_APP_DISABLE,
+       E_PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE,
+       E_PMINFO_APPINFO_PROP_APP_MAX_BOOL = E_PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE
 } pkgmgrinfo_appinfo_filter_prop_bool;
 
 /*Integer properties for filtering based on app info*/
 typedef enum _pkgmgrinfo_appinfo_filter_prop_int {
        /*Currently No Fields*/
        E_PMINFO_APPINFO_PROP_APP_MIN_INT = 601,
-       E_PMINFO_APPINFO_PROP_APP_MAX_INT = E_PMINFO_APPINFO_PROP_APP_MIN_INT
+       E_PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER = E_PMINFO_APPINFO_PROP_APP_MIN_INT,
+       E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE,
+       E_PMINFO_APPINFO_PROP_APP_MAX_INT = E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE
 } pkgmgrinfo_appinfo_filter_prop_int;
 
 /*Integer properties for filtering based on app info*/
@@ -156,26 +164,29 @@ typedef enum _pkgmgrinfo_pkginfo_filter_prop_range {
        E_PMINFO_PKGINFO_PROP_RANGE_MAX_INT = E_PMINFO_PKGINFO_PROP_RANGE_BASIC
 } pkgmgrinfo_pkginfo_filter_prop_range;
 
+typedef enum _pkgmgrinfo_pkginfo_join_flag {
+       E_PMINFO_PKGINFO_JOIN_LOCALIZED_INFO = 0x0001,
+       E_PMINFO_PKGINFO_JOIN_PRIVILEGE_INFO = 0x0002,
+} pkgmgrinfo_pkginfo_join_flag;
+
+typedef enum _pkgmgrinfo_appinfo_join_flag {
+       E_PMINFO_APPINFO_JOIN_LOCALIZED_INFO = 0x0001,
+       E_PMINFO_APPINFO_JOIN_CATEGORY = 0x0002,
+       E_PMINFO_APPINFO_JOIN_APP_CONTROL = 0x0004,
+       E_PMINFO_APPINFO_JOIN_METADATA = 0x0008,
+} pkgmgrinfo_appinfo_join_flag;
+
 typedef struct _pkgmgr_pkginfo_x {
        uid_t uid;
        package_x *pkg_info;
        char *locale;
-
-       struct _pkgmgr_pkginfo_x *prev;
-       struct _pkgmgr_pkginfo_x *next;
 } pkgmgr_pkginfo_x;
 
 typedef struct _pkgmgr_appinfo_x {
        const char *package;
        char *locale;
        pkgmgrinfo_app_component app_component;
-       union {
-               uiapplication_x *uiapp_info;
-               serviceapplication_x *svcapp_info;
-               application_x *app_info;
-       };
-       struct _pkgmgr_appinfo_x *prev;
-       struct _pkgmgr_appinfo_x *next;
+       application_x *app_info;
 } pkgmgr_appinfo_x;
 
 /*For filter APIs*/
@@ -224,8 +235,24 @@ int __close_manifest_db(void);
 int __open_manifest_db(uid_t uid, bool readonly);
 int __close_cert_db(void);
 int __open_cert_db(uid_t uid, bool readonly);
-void _save_column_str(sqlite3_stmt *stmt, int idx, const char **str);
+void _save_column_int(sqlite3_stmt *stmt, int idx, int *i);
+void _save_column_str(sqlite3_stmt *stmt, int idx, char **str);
 char *_get_system_locale(void);
-void __get_filter_condition(gpointer data, char **condition);
+int __get_filter_condition(gpointer data, char **condition, GList **param);
+int _add_icon_info_into_list(const char *locale, char *value, GList **icon);
+int _add_label_info_into_list(const char *locale, char *value, GList **label);
+int __pkginfo_check_installed_storage(package_x *pkginfo);
+int __appinfo_check_installed_storage(application_x *appinfo);
+
+#define REGULAR_USER 5000
+static inline uid_t _getuid(void)
+{
+       uid_t uid = getuid();
+
+       if (uid < REGULAR_USER)
+               return tzplatform_getuid(TZ_SYS_GLOBALAPP_USER);
+       else
+               return uid;
+}
 
 #endif  /* __PKGMGRINFO_PRIVATE_H__ */