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>
28 /* app background category value */
29 #define APP_BG_CATEGORY_USER_DISABLE_FALSE_VAL 0x00000
30 #define APP_BG_CATEGORY_USER_DISABLE_TRUE_VAL 0x00001
31 #define APP_BG_CATEGORY_MEDIA_VAL 0x00002
32 #define APP_BG_CATEGORY_DOWNLOAD_VAL 0x00004
33 #define APP_BG_CATEGORY_BGNETWORK_VAL 0x00008
34 #define APP_BG_CATEGORY_LOCATION_VAL 0x00010
35 #define APP_BG_CATEGORY_SENSOR_VAL 0x00020
36 #define APP_BG_CATEGORY_IOTCOMM_VAL 0x00040
37 #define APP_BG_CATEGORY_SYSTEM_VAL 0x00080
39 #define APP_BG_CATEGORY_USER_DISABLE_FALSE_STR "enable"
40 #define APP_BG_CATEGORY_USER_DISABLE_TRUE_STR "disable"
41 #define APP_BG_CATEGORY_MEDIA_STR "media"
42 #define APP_BG_CATEGORY_DOWNLOAD_STR "download"
43 #define APP_BG_CATEGORY_BGNETWORK_STR "background-network"
44 #define APP_BG_CATEGORY_LOCATION_STR "location"
45 #define APP_BG_CATEGORY_SENSOR_STR "sensor"
46 #define APP_BG_CATEGORY_IOTCOMM_STR "iot-communication"
47 #define APP_BG_CATEGORY_SYSTEM "system"
49 /* Integer property for support-mode */
50 #define APP_SUPPORT_MODE_ULTRA_POWER_SAVING_VAL 0x00001
51 #define APP_SUPPORT_MODE_COOL_DOWN_VAL 0x00002
52 #define APP_SUPPORT_MODE_SCREEN_READER_VAL 0x00004
54 /* String property for support-mode */
55 #define APP_SUPPORT_MODE_ULTRA_POWER_SAVING_STR "ultra-power-saving"
56 #define APP_SUPPORT_MODE_COOL_DOWN_STR "cool-down"
57 #define APP_SUPPORT_MODE_SCREEN_READER_STR "screen-reader"
60 * @brief A type to retrieve uid information from the manifest handle
64 } pkgmgrinfo_uidinfo_t;
67 * @brief A handle to insert certificate information
69 typedef void *pkgmgrinfo_instcertinfo_h;
72 * @brief Certificate Types to be used for setting information
75 PMINFO_SET_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
76 PMINFO_SET_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
77 PMINFO_SET_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
78 PMINFO_SET_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
79 PMINFO_SET_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
80 PMINFO_SET_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
81 PMINFO_SET_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
82 PMINFO_SET_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
83 PMINFO_SET_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
84 } pkgmgrinfo_instcert_type;
87 PMINFO_CERT_COMPARE_MATCH,
88 PMINFO_CERT_COMPARE_MISMATCH,
89 PMINFO_CERT_COMPARE_LHS_NO_CERT,
90 PMINFO_CERT_COMPARE_RHS_NO_CERT,
91 PMINFO_CERT_COMPARE_BOTH_NO_CERT,
92 PMINFO_CERT_COMPARE_ERROR,
93 } pkgmgrinfo_cert_compare_result_type_e;
96 PMINFO_APPINFO_GET_LABEL = 0x0001,
97 PMINFO_APPINFO_GET_ICON = 0x0002,
98 PMINFO_APPINFO_GET_CATEGORY = 0x0004,
99 PMINFO_APPINFO_GET_APP_CONTROL = 0x0008,
100 PMINFO_APPINFO_GET_DATA_CONTROL = 0x0010,
101 PMINFO_APPINFO_GET_METADATA = 0x0020,
102 PMINFO_APPINFO_GET_SPLASH_SCREEN = 0x0040,
103 PMINFO_APPINFO_GET_ALL = 0x007F
104 } pkgmgrinfo_appinfo_get_option;
107 PMINFO_PKGINFO_GET_LABEL = 0x0001,
108 PMINFO_PKGINFO_GET_ICON = 0x0002,
109 PMINFO_PKGINFO_GET_AUTHOR = 0x0004,
110 PMINFO_PKGINFO_GET_DESCRIPTION = 0x0008,
111 PMINFO_PKGINFO_GET_PRIVILEGE = 0x0010,
112 PMINFO_PKGINFO_GET_ALL = 0x001F
113 } pkgmgrinfo_pkginfo_get_option;
116 * @brief API return values
119 PMINFO_R_ENOENT = -3, /**< No result */
120 PMINFO_R_EINVAL = -2, /**< Invalid argument */
121 PMINFO_R_ERROR = -1, /**< General error */
122 PMINFO_R_OK = 0 /**< General success */
126 * @brief Value to be used when filtering based on install location
128 #define PMINFO_PKGINFO_INSTALL_LOCATION_AUTO "LOCATION_AUTO"
131 * @brief Value to be used when filtering based on install location
133 #define PMINFO_PKGINFO_INSTALL_LOCATION_INTERNAL "LOCATION_INTERNAL"
136 * @brief Value to be used when filtering based on install location
138 #define PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL "LOCATION_EXTERNAL"
141 PMINFO_HWACCELERATION_OFF = 0, /**< Don't use hardware acceleration*/
142 PMINFO_HWACCELERATION_ON = 1, /**< Use hardware acceleration*/
143 PMINFO_HWACCELERATION_DEFAULT = 2 /**< Follow system setting for hardware acceleration */
144 } pkgmgrinfo_app_hwacceleration;
147 PMINFO_SCREENREADER_OFF = 0, /**< Don't use screen reader*/
148 PMINFO_SCREENREADER_ON = 1, /**< Use screen reader*/
149 PMINFO_SCREENREADER_USE_SYSTEM_SETTING = 2 /**< Follow system setting for screen reader */
150 } pkgmgrinfo_app_screenreader;
153 PMINFO_RECENTIMAGE_USE_ICON = 0, /**<Use icon for recent image*/
154 PMINFO_RECENTIMAGE_USE_CAPTURE = 1, /**< Use capture for recent image*/
155 PMINFO_RECENTIMAGE_USE_NOTHING = 2 /**< Don't use recent image */
156 } pkgmgrinfo_app_recentimage;
159 * @brief A handle to get package information
161 typedef void *pkgmgrinfo_pkginfo_h;
164 * @brief A handle to get application information
166 typedef void *pkgmgrinfo_appinfo_h;
169 * @brief A handle to get certificate information
171 typedef void *pkgmgrinfo_certinfo_h;
174 * @brief A handle to filter package information
176 typedef void *pkgmgrinfo_pkginfo_filter_h;
179 * @brief A handle to filter application information
181 typedef void *pkgmgrinfo_appinfo_filter_h;
184 * @brief A handle to filter application metadata information
186 typedef void *pkgmgrinfo_appinfo_metadata_filter_h;
189 * @brief A handle to get appcontrol information
191 typedef void *pkgmgrinfo_appcontrol_h;
194 * @brief type definition.
196 typedef void pkgmgrinfo_client;
199 * @fn int (*pkgmgrinfo_pkg_list_cb) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
201 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
203 * @param[in] handle the pkginfo handle
204 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
206 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
208 * @see pkgmgrinfo_pkginfo_get_list()
209 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
211 typedef int (*pkgmgrinfo_pkg_list_cb) (const pkgmgrinfo_pkginfo_h handle,
215 * @fn int (*pkgmgrinfo_app_list_cb) (const pkgmgrinfo_appinfo_h handle, void *user_data)
217 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
219 * @param[in] handle the appinfo handle
220 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
222 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
224 * @see pkgmgrinfo_appinfo_get_list()
225 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
226 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
228 typedef int (*pkgmgrinfo_app_list_cb) (const pkgmgrinfo_appinfo_h handle,
232 * @fn int (*pkgmgrinfo_app_category_list_cb) (const char *category_name, void *user_data)
234 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
236 * @param[in] category_name the name of the category
237 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
239 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
241 * @see pkgmgrinfo_appinfo_foreach_category()
243 typedef int (*pkgmgrinfo_app_category_list_cb) (const char *category_name,
247 * @fn int (*pkgmgrinfo_app_permission_list_cb) (const char *permission_type, void *user_data)
249 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
251 * @param[in] permission_name the name of the permission
252 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
254 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
256 * @see pkgmgrinfo_appinfo_foreach_category()
258 typedef int (*pkgmgrinfo_app_permission_list_cb) (const char *permission_type,
262 * @fn int (*pkgmgrinfo_pkg_privilege_list_cb) (const char *privilege_name, void *user_data)
264 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
266 * @param[in] privilege_name the name of the privilege
267 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_privilege()
269 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
271 * @see pkgmgrinfo_pkginfo_foreach_privilege()
273 typedef int (*pkgmgrinfo_pkg_privilege_list_cb) (const char *privilege_name,
277 * @fn int (*pkgmgrinfo_app_metadata_list_cb) (const char *metadata_key, const char *metadata_value, void *user_data)
279 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
281 * @param[in] metadata_name the name of the metadata
282 * @param[in] metadata_value the value of the metadata
283 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
285 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
287 * @see pkgmgrinfo_appinfo_foreach_metadata()
289 typedef int (*pkgmgrinfo_app_metadata_list_cb) (const char *metadata_key,
290 const char *metadata_value, void *user_data);
293 * @fn int (*pkgmgrinfo_app_control_list_cb) (pkgmgrinfo_appcontrol_h handle, void *user_data)
295 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
297 * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
298 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
300 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
302 * @see pkgmgrinfo_appinfo_foreach_appcontrol()
304 typedef int (*pkgmgrinfo_app_control_list_cb) (const char *operation, const char *uri, const char *mime,
308 * @fn int (*pkgmgrinfo_app_background_category_list_cb) (const char *category_name, void *user_data)
310 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_background_category()
312 * @param[in] category_name retrieved background category name
313 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_background_category
315 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
317 * @see pkgmgrinfo_appinfo_foreach_background_category()
319 typedef int (*pkgmgrinfo_app_background_category_list_cb) (const char *category_name, void *user_data);
322 * @fn int (*pkgmgrinfo_app_splash_screen_list_cb)(const char *src,
323 * const char *type, const char *orientation,
324 * const char *indicatordisplay, const char *color_depth,
326 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_splash_screen()
328 * @param[in] src the source of the splashscreen
329 * @param[in] type the type of the splashscreen
330 * @param[in] orientation the orientation of the splashscreen
331 * @param[in] indicatordisplay the indicator-display of the splashscreen
332 * @param[in] operation the app-control operation of the splashscreen
333 * @param[in] color_depth the color-depth of the splashscreen
334 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_splash_screen()
336 * @return 0 if success, negative value(<0) if fail, Callback is not called if return value is negative.\n
338 * @see pkgmgrinfo_appinfo_foreach_splash_screen()
340 typedef int (*pkgmgrinfo_app_splash_screen_list_cb)(const char *src,
341 const char *type, const char *orientation,
342 const char *indicatordisplay, const char *operation,
343 const char *color_depth, void *user_data);
345 typedef int (*pkgmgrinfo_handler)(uid_t target_uid, int req_id, const char *pkg_type,
346 const char *pkgid, const char *key,
347 const char *val, const void *pmsg, void *data);
351 * @brief Install Location Types
354 PMINFO_INSTALL_LOCATION_AUTO = 0, /**< Auto*/
355 PMINFO_INSTALL_LOCATION_INTERNAL_ONLY, /**< Internal Installation*/
356 PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL, /**< External Installation*/
357 } pkgmgrinfo_install_location;
360 * @brief Application Component Types
363 PMINFO_ALL_APP = 0, /**< All Application*/
364 PMINFO_UI_APP, /**< UI Application*/
365 PMINFO_SVC_APP, /**< Service Application*/
366 PMINFO_WIDGET_APP, /**< Widget Application*/
367 PMINFO_WATCH_APP, /**< Watch Application*/
368 } pkgmgrinfo_app_component;
371 * @brief Application Storage Types
374 PMINFO_INTERNAL_STORAGE = 0, /**< Internal Storage*/
375 PMINFO_EXTERNAL_STORAGE = 1, /**< External Storage*/
376 } pkgmgrinfo_installed_storage;
379 * @brief Certificate Types to be used for getting information
382 PMINFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
383 PMINFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
384 PMINFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
385 PMINFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
386 PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
387 PMINFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
388 PMINFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
389 PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
390 PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
391 } pkgmgrinfo_cert_type;
394 * @brief Install Location Types to be used when setting data in DB
397 INSTALL_INTERNAL = 0, /**< Internal Installation*/
398 INSTALL_EXTERNAL, /**< External Installation*/
402 * @brief permission Types
405 PMINFO_PERMISSION_NORMAL = 0, /**< permission normal*/
406 PMINFO_PERMISSION_SIGNATURE, /**< permission type is signature*/
407 PMINFO_PERMISSION_PRIVILEGE, /**< permission type is privilege*/
408 } pkgmgrinfo_permission_type;
414 } pkgmgrinfo_client_type;