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.
24 #ifndef __PKGMGRINFO_PRIVATE_H__
25 #define __PKGMGRINFO_PRIVATE_H__
28 #include <sys/types.h>
32 #include <tzplatform_config.h>
34 #include "pkgmgrinfo_type.h"
35 #include "pkgmgrinfo_basic.h"
38 #define DEPRECATED __attribute__ ((__deprecated__))
42 #define API __attribute__ ((visibility("default")))
48 #define LOG_TAG "PKGMGR_INFO"
50 #define ASC_CHAR(s) (const char *)s
51 #define XML_CHAR(s) (const xmlChar *)s
53 #define MANIFEST_DB tzplatform_mkpath(TZ_SYS_DB, ".pkgmgr_parser.db")
54 #define MAX_QUERY_LEN 4096
55 #define MAX_CERT_TYPE 9
56 #define CERT_DB tzplatform_mkpath(TZ_SYS_DB, ".pkgmgr_cert.db")
57 #define PKG_TYPE_STRING_LEN_MAX 128
58 #define PKG_VERSION_STRING_LEN_MAX 128
59 #define PKG_VALUE_STRING_LEN_MAX 512
60 #define PKG_RW_PATH tzplatform_mkpath(TZ_USER_APP, "")
61 #define PKG_RO_PATH tzplatform_mkpath(TZ_SYS_RO_APP, "")
62 #define BLOCK_SIZE 4096 /*in bytes*/
66 #define PKG_SD_PATH tzplatform_mkpath3(TZ_SYS_STORAGE, "sdcard", "app2sd/")
67 #define PKG_INSTALLATION_PATH tzplatform_mkpath(TZ_USER_APP, "")
69 #define SERVICE_NAME "org.tizen.system.deviced"
70 #define PATH_NAME "/Org/Tizen/System/DeviceD/Mmc"
71 #define INTERFACE_NAME "org.tizen.system.deviced.Mmc"
72 #define METHOD_NAME "RequestMountApp2ext"
74 #define GET_DB(X) (X).dbHandle
76 /*String properties for filtering based on package info*/
77 typedef enum _pkgmgrinfo_pkginfo_filter_prop_str {
78 E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_STR = 101,
79 E_PMINFO_PKGINFO_PROP_PACKAGE_ID = E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_STR,
80 E_PMINFO_PKGINFO_PROP_PACKAGE_TYPE,
81 E_PMINFO_PKGINFO_PROP_PACKAGE_VERSION,
82 E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION,
83 E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE,
84 E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME,
85 E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL,
86 E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF,
87 E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_STR = E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF
88 } pkgmgrinfo_pkginfo_filter_prop_str;
90 /*Boolean properties for filtering based on package info*/
91 typedef enum _pkgmgrinfo_pkginfo_filter_prop_bool {
92 E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_BOOL = 201,
93 E_PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE = E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_BOOL,
94 E_PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD,
95 E_PMINFO_PKGINFO_PROP_PACKAGE_READONLY,
96 E_PMINFO_PKGINFO_PROP_PACKAGE_UPDATE,
97 E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING,
98 E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING,
99 E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_BOOL = E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING
100 } pkgmgrinfo_pkginfo_filter_prop_bool;
102 /*Integer properties for filtering based on package info*/
103 typedef enum _pkgmgrinfo_pkginfo_filter_prop_int {
104 E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_INT = 301,
105 E_PMINFO_PKGINFO_PROP_PACKAGE_SIZE = E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_INT,
106 E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_INT = E_PMINFO_PKGINFO_PROP_PACKAGE_SIZE
107 } pkgmgrinfo_pkginfo_filter_prop_int;
109 /*String properties for filtering based on app info*/
110 typedef enum _pkgmgrinfo_appinfo_filter_prop_str {
111 E_PMINFO_APPINFO_PROP_APP_MIN_STR = 401,
112 E_PMINFO_APPINFO_PROP_APP_ID = E_PMINFO_APPINFO_PROP_APP_MIN_STR,
113 E_PMINFO_APPINFO_PROP_APP_COMPONENT,
114 E_PMINFO_APPINFO_PROP_APP_EXEC,
115 E_PMINFO_APPINFO_PROP_APP_ICON,
116 E_PMINFO_APPINFO_PROP_APP_TYPE,
117 E_PMINFO_APPINFO_PROP_APP_OPERATION,
118 E_PMINFO_APPINFO_PROP_APP_URI,
119 E_PMINFO_APPINFO_PROP_APP_MIME,
120 E_PMINFO_APPINFO_PROP_APP_HWACCELERATION,
121 E_PMINFO_APPINFO_PROP_APP_CATEGORY,
122 E_PMINFO_APPINFO_PROP_APP_SCREENREADER,
123 E_PMINFO_APPINFO_PROP_APP_PACKAGE,
124 E_PMINFO_APPINFO_PROP_APP_MAX_STR = E_PMINFO_APPINFO_PROP_APP_PACKAGE
125 } pkgmgrinfo_appinfo_filter_prop_str;
127 /*Boolean properties for filtering based on app info*/
128 typedef enum _pkgmgrinfo_appinfo_filter_prop_bool {
129 E_PMINFO_APPINFO_PROP_APP_MIN_BOOL = 501,
130 E_PMINFO_APPINFO_PROP_APP_NODISPLAY = E_PMINFO_APPINFO_PROP_APP_MIN_BOOL,
131 E_PMINFO_APPINFO_PROP_APP_MULTIPLE,
132 E_PMINFO_APPINFO_PROP_APP_ONBOOT,
133 E_PMINFO_APPINFO_PROP_APP_AUTORESTART,
134 E_PMINFO_APPINFO_PROP_APP_TASKMANAGE,
135 E_PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION,
136 E_PMINFO_APPINFO_PROP_APP_UI_GADGET,
137 E_PMINFO_APPINFO_PROP_APP_MAX_BOOL = E_PMINFO_APPINFO_PROP_APP_UI_GADGET
138 } pkgmgrinfo_appinfo_filter_prop_bool;
140 /*Integer properties for filtering based on app info*/
141 typedef enum _pkgmgrinfo_appinfo_filter_prop_int {
142 /*Currently No Fields*/
143 E_PMINFO_APPINFO_PROP_APP_MIN_INT = 601,
144 E_PMINFO_APPINFO_PROP_APP_MAX_INT = E_PMINFO_APPINFO_PROP_APP_MIN_INT
145 } pkgmgrinfo_appinfo_filter_prop_int;
147 /*Integer properties for filtering based on app info*/
148 typedef enum _pkgmgrinfo_pkginfo_filter_prop_range {
149 /*Currently No Fields*/
150 E_PMINFO_PKGINFO_PROP_RANGE_MIN_INT = 701,
151 E_PMINFO_PKGINFO_PROP_RANGE_BASIC,
152 E_PMINFO_PKGINFO_PROP_RANGE_MAX_INT = E_PMINFO_PKGINFO_PROP_RANGE_BASIC
153 } pkgmgrinfo_pkginfo_filter_prop_range;
155 typedef struct _pkgmgr_pkginfo_x {
160 struct _pkgmgr_pkginfo_x *prev;
161 struct _pkgmgr_pkginfo_x *next;
164 typedef struct _pkgmgr_appinfo_x {
167 pkgmgrinfo_app_component app_component;
169 uiapplication_x *uiapp_info;
170 serviceapplication_x *svcapp_info;
171 application_x *app_info;
173 struct _pkgmgr_appinfo_x *prev;
174 struct _pkgmgr_appinfo_x *next;
178 typedef struct _pkgmgrinfo_filter_x {
181 } pkgmgrinfo_filter_x;
183 typedef struct _pkgmgrinfo_node_x {
189 typedef struct _pkgmgrinfo_appcontrol_x {
198 } pkgmgrinfo_appcontrol_x;
200 typedef struct _db_handle {
205 extern __thread db_handle manifest_db;
206 extern __thread db_handle cert_db;
208 pkgmgrinfo_pkginfo_filter_prop_str _pminfo_pkginfo_convert_to_prop_str(const char *property);
209 pkgmgrinfo_pkginfo_filter_prop_int _pminfo_pkginfo_convert_to_prop_int(const char *property);
210 pkgmgrinfo_pkginfo_filter_prop_bool _pminfo_pkginfo_convert_to_prop_bool(const char *property);
212 pkgmgrinfo_appinfo_filter_prop_str _pminfo_appinfo_convert_to_prop_str(const char *property);
213 pkgmgrinfo_appinfo_filter_prop_int _pminfo_appinfo_convert_to_prop_int(const char *property);
214 pkgmgrinfo_appinfo_filter_prop_bool _pminfo_appinfo_convert_to_prop_bool(const char *property);
216 pkgmgrinfo_pkginfo_filter_prop_range _pminfo_pkginfo_convert_to_prop_range(const char *property);
218 int _check_create_cert_db(sqlite3 *certdb);
219 int __close_manifest_db(void);
220 int __open_manifest_db(uid_t uid);
221 int __close_cert_db(void);
222 int __open_cert_db(uid_t uid, char* mode);
223 void _save_column_str(sqlite3_stmt *stmt, int idx, const char **str);
224 char *_get_system_locale(void);
225 void __get_filter_condition(gpointer data, char **condition);
227 #endif /* __PKGMGRINFO_PRIVATE_H__ */