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.
23 #ifndef __PKGMGRINFO_TYPE_H__
24 #define __PKGMGRINFO_TYPE_H__
26 #include <sys/types.h>
29 * @brief A type to retrieve uid information from the manifest handle
33 } pkgmgrinfo_uidinfo_t;
36 * @brief A handle to insert certificate information
38 typedef void* pkgmgrinfo_instcertinfo_h;
41 * @brief Certificate Types to be used for setting information
44 PMINFO_SET_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
45 PMINFO_SET_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
46 PMINFO_SET_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
47 PMINFO_SET_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
48 PMINFO_SET_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
49 PMINFO_SET_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
50 PMINFO_SET_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
51 PMINFO_SET_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
52 PMINFO_SET_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
53 }pkgmgrinfo_instcert_type;
56 PMINFO_CERT_COMPARE_MATCH,
57 PMINFO_CERT_COMPARE_MISMATCH,
58 PMINFO_CERT_COMPARE_LHS_NO_CERT,
59 PMINFO_CERT_COMPARE_RHS_NO_CERT,
60 PMINFO_CERT_COMPARE_BOTH_NO_CERT,
61 PMINFO_CERT_COMPARE_ERROR,
62 } pkgmgrinfo_cert_compare_result_type_e;
65 * @brief API return values
68 PMINFO_R_ENOENT = -3, /**< No result */
69 PMINFO_R_EINVAL = -2, /**< Invalid argument */
70 PMINFO_R_ERROR = -1, /**< General error */
71 PMINFO_R_OK = 0 /**< General success */
75 * @brief Value to be used when filtering based on install location
77 #define PMINFO_PKGINFO_INSTALL_LOCATION_AUTO "LOCATION_AUTO"
80 * @brief Value to be used when filtering based on install location
82 #define PMINFO_PKGINFO_INSTALL_LOCATION_INTERNAL "LOCATION_INTERNAL"
85 * @brief Value to be used when filtering based on install location
87 #define PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL "LOCATION_EXTERNAL"
90 * @brief Value to be used when filtering based on app-component
92 #define PMINFO_APPINFO_UI_APP "UI_APP"
95 * @brief Value to be used when filtering based on app-component
97 #define PMINFO_APPINFO_SVC_APP "SVC_APP"
100 PMINFO_HWACCELERATION_NOT_USE_GL = 0, /**< Don't use hardware acceleration*/
101 PMINFO_HWACCELERATION_USE_GL = 1, /**< Use hardware acceleration*/
102 PMINFO_HWACCELERATION_USE_SYSTEM_SETTING = 2 /**< Follow system setting for hardware acceleration */
103 }pkgmgrinfo_app_hwacceleration;
106 PMINFO_SCREENREADER_OFF = 0, /**< Don't use screen reader*/
107 PMINFO_SCREENREADER_ON = 1, /**< Use screen reader*/
108 PMINFO_SCREENREADER_USE_SYSTEM_SETTING = 2 /**< Follow system setting for screen reader */
109 }pkgmgrinfo_app_screenreader;
112 PMINFO_RECENTIMAGE_USE_ICON = 0, /**<Use icon for recent image*/
113 PMINFO_RECENTIMAGE_USE_CAPTURE = 1, /**< Use capture for recent image*/
114 PMINFO_RECENTIMAGE_USE_NOTHING = 2 /**< Don't use recent image */
115 }pkgmgrinfo_app_recentimage;
118 * @brief A handle to get package information
120 typedef void* pkgmgrinfo_pkginfo_h;
123 * @brief A handle to get application information
125 typedef void* pkgmgrinfo_appinfo_h;
128 * @brief A handle to get certificate information
130 typedef void* pkgmgrinfo_certinfo_h;
133 * @brief A handle to insert package information
135 typedef void* pkgmgrinfo_pkgdbinfo_h;
138 * @brief A handle to filter package information
140 typedef void* pkgmgrinfo_pkginfo_filter_h;
143 * @brief A handle to filter application information
145 typedef void* pkgmgrinfo_appinfo_filter_h;
148 * @brief A handle to filter application metadata information
150 typedef void* pkgmgrinfo_appinfo_metadata_filter_h;
153 * @brief A handle to get appcontrol information
155 typedef void* pkgmgrinfo_appcontrol_h;
158 * @brief type definition.
160 typedef void pkgmgrinfo_client;
163 * @fn int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
165 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
167 * @param[in] handle the pkginfo handle
168 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
170 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
172 * @see pkgmgrinfo_pkginfo_get_list()
173 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
175 typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle,
179 * @fn int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data)
181 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
183 * @param[in] handle the appinfo handle
184 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
186 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
188 * @see pkgmgrinfo_appinfo_get_list()
189 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
190 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
192 typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle,
196 * @fn int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data)
198 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
200 * @param[in] category_name the name of the category
201 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
203 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
205 * @see pkgmgrinfo_appinfo_foreach_category()
207 typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name,
211 * @fn int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type, void *user_data)
213 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
215 * @param[in] permission_name the name of the permission
216 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
218 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
220 * @see pkgmgrinfo_appinfo_foreach_category()
222 typedef int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type,
226 * @fn int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name, void *user_data)
228 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
230 * @param[in] privilege_name the name of the privilege
231 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_privilege()
233 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
235 * @see pkgmgrinfo_pkginfo_foreach_privilege()
237 typedef int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name,
241 * @fn int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data)
243 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
245 * @param[in] metadata_name the name of the metadata
246 * @param[in] metadata_value the value of the metadata
247 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
249 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
251 * @see pkgmgrinfo_appinfo_foreach_metadata()
253 typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key,
254 const char *metadata_value, void *user_data);
257 * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
259 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
261 * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
262 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
264 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
266 * @see pkgmgrinfo_appinfo_foreach_appcontrol()
268 typedef int (*pkgmgrinfo_app_control_list_cb ) (const char *operation, const char *uri, const char *mime,
272 * @fn int (*pkgmgrinfo_app_background_category_list_cb ) (const char *category_name, void *user_data)
274 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_background_category()
276 * @param[in] category_name retrieved background category name
277 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_background_category
279 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
281 * @see pkgmgrinfo_appinfo_foreach_background_category()
283 typedef int (*pkgmgrinfo_app_background_category_list_cb ) (const char *category_name, void *user_data);
285 typedef int (*pkgmgrinfo_handler)(uid_t target_uid, int req_id, const char *pkg_type,
286 const char *pkgid, const char *key,
287 const char *val, const void *pmsg, void *data);
291 * @brief Install Location Types
294 PMINFO_INSTALL_LOCATION_AUTO = 0, /**< Auto*/
295 PMINFO_INSTALL_LOCATION_INTERNAL_ONLY, /**< Internal Installation*/
296 PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL, /**< External Installation*/
297 } pkgmgrinfo_install_location;
300 * @brief Application Component Types
303 PMINFO_ALL_APP = 0, /**< All Application*/
304 PMINFO_UI_APP, /**< UI Application*/
305 PMINFO_SVC_APP, /**< Service Application*/
306 } pkgmgrinfo_app_component;
309 * @brief Application Storage Types
312 PMINFO_INTERNAL_STORAGE = 0, /**< Internal Storage*/
313 PMINFO_EXTERNAL_STORAGE = 1, /**< External Storage*/
314 } pkgmgrinfo_installed_storage;
317 * @brief Certificate Types to be used for getting information
320 PMINFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
321 PMINFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
322 PMINFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
323 PMINFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
324 PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
325 PMINFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
326 PMINFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
327 PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
328 PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
329 } pkgmgrinfo_cert_type;
332 * @brief Install Location Types to be used when setting data in DB
335 INSTALL_INTERNAL = 0, /**< Internal Installation*/
336 INSTALL_EXTERNAL, /**< External Installation*/
340 * @brief permission Types
343 PMINFO_PERMISSION_NORMAL = 0, /**< permission normal*/
344 PMINFO_PERMISSION_SIGNATURE, /**< permission type is signature*/
345 PMINFO_PERMISSION_PRIVILEGE, /**< permission type is privilege*/
346 } pkgmgrinfo_permission_type;
352 } pkgmgrinfo_client_type;