tizen 2.4 release
[framework/appfw/pkgmgr-info.git] / include / pkgmgrinfo_type.h
1 /*
2  * pkgmgrinfo_type
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
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>
8  *
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
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
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.
20  *
21  */
22
23 #ifndef __PKGMGRINFO_TYPE_H__
24 #define __PKGMGRINFO_TYPE_H__
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 /** Integer property for mode*/
31 #define PMINFO_SUPPORT_MODE_ULTRA_POWER_SAVING          0x00000001
32 #define PMINFO_SUPPORT_MODE_COOL_DOWN                           0x00000002
33 #define PMINFO_SUPPORT_MODE_SCREEN_READER                       0x00000004
34 #define PMINFO_SUPPORT_MODE_ACTIVATION_STUB                     0x00000008
35
36 #define PMINFO_SUPPORT_FEATURE_MULTI_WINDOW                     0x00000001
37 #define PMINFO_SUPPORT_FEATURE_OOM_TERMINATION          0x00000002
38 #define PMINFO_SUPPORT_FEATURE_LARGE_MEMORY                     0x00000004
39 #define PMINFO_SUPPORT_FEATURE_HIGH_PRIORITY            0x00000008
40
41 #define PMINFO_SUPPORT_CATEGORY_LOCK_APP                        0x00000001
42 #define PMINFO_SUPPORT_CATEGORY_HOME_APP                        0x00000002
43 #define PMINFO_SUPPORT_CATEGORY_IME_APP                         0x00000004
44
45 /*app background category value */
46 #define APP_BG_CATEGORY_USER_DISABLE_FALSE_VAL          0x00000
47 #define APP_BG_CATEGORY_USER_DISABLE_TRUE_VAL           0x00001
48 #define APP_BG_CATEGORY_MEDIA_VAL                                       0x00002
49 #define APP_BG_CATEGORY_DOWNLOAD_VAL                            0x00004
50 #define APP_BG_CATEGORY_BGNETWORK_VAL                           0x00008
51 #define APP_BG_CATEGORY_LOCATION_VAL                            0x00010
52 #define APP_BG_CATEGORY_SENSOR_VAL                                      0x00020
53 #define APP_BG_CATEGORY_IOTCOMM_VAL                                     0x00040
54 #define APP_BG_CATEGORY_SYSTEM_VAL                                      0x00080
55
56 #define APP_BG_CATEGORY_USER_DISABLE_FALSE_STR          "enable"
57 #define APP_BG_CATEGORY_USER_DISABLE_TRUE_STR           "disable"
58 #define APP_BG_CATEGORY_MEDIA_STR                                       "media"
59 #define APP_BG_CATEGORY_DOWNLOAD_STR                            "download"
60 #define APP_BG_CATEGORY_BGNETWORK_STR                           "background-network"
61 #define APP_BG_CATEGORY_LOCATION_STR                            "location"
62 #define APP_BG_CATEGORY_SENSOR_STR                                      "sensor"
63 #define APP_BG_CATEGORY_IOTCOMM_STR                             "iot-communication"
64 #define APP_BG_CATEGORY_SYSTEM                                          "system"
65
66
67 /**
68  * @brief A handle to insert certificate information
69  */
70 typedef void* pkgmgrinfo_instcertinfo_h;
71
72 /**
73  * @brief A handle to get package information
74  */
75 typedef void* pkgmgrinfo_pkginfo_h;
76
77 /**
78  * @brief A handle to get application information
79  */
80 typedef void* pkgmgrinfo_appinfo_h;
81
82 /**
83  * @brief A handle to get certificate information
84  */
85 typedef void* pkgmgrinfo_certinfo_h;
86
87 /**
88  * @brief A handle to insert package information
89  */
90 typedef void* pkgmgrinfo_pkgdbinfo_h;
91
92 /**
93  * @brief A handle to filter package information
94  */
95 typedef void* pkgmgrinfo_pkginfo_filter_h;
96
97 /**
98  * @brief A handle to filter application information
99  */
100 typedef void* pkgmgrinfo_appinfo_filter_h;
101
102 /**
103  * @brief A handle to filter application metadata  information
104  */
105 typedef void* pkgmgrinfo_appinfo_metadata_filter_h;
106
107 /**
108  * @brief A handle to get appcontrol information
109  */
110 typedef void* pkgmgrinfo_appcontrol_h;
111
112 typedef void pkgmgrinfo_client;
113
114 /**
115  * @brief Certificate Types to be used for setting information
116  */
117 typedef enum {
118         PMINFO_SET_AUTHOR_ROOT_CERT = 0,                /**< Author Root Certificate*/
119         PMINFO_SET_AUTHOR_INTERMEDIATE_CERT = 1,                /**< Author Intermediate Certificate*/
120         PMINFO_SET_AUTHOR_SIGNER_CERT = 2,              /**< Author Signer Certificate*/
121         PMINFO_SET_DISTRIBUTOR_ROOT_CERT = 3,           /**< Distributor Root Certificate*/
122         PMINFO_SET_DISTRIBUTOR_INTERMEDIATE_CERT = 4,           /**< Distributor Intermediate Certificate*/
123         PMINFO_SET_DISTRIBUTOR_SIGNER_CERT = 5,         /**< Distributor Signer Certificate*/
124         PMINFO_SET_DISTRIBUTOR2_ROOT_CERT = 6,          /**< End Entity Root Certificate*/
125         PMINFO_SET_DISTRIBUTOR2_INTERMEDIATE_CERT = 7,          /**< End Entity Intermediate Certificate*/
126         PMINFO_SET_DISTRIBUTOR2_SIGNER_CERT = 8,                /**< End Entity Signer Certificate*/
127 }pkgmgrinfo_instcert_type;
128
129 typedef enum {
130         PMINFO_CERT_COMPARE_MATCH,
131         PMINFO_CERT_COMPARE_MISMATCH,
132         PMINFO_CERT_COMPARE_LHS_NO_CERT,
133         PMINFO_CERT_COMPARE_RHS_NO_CERT,
134         PMINFO_CERT_COMPARE_BOTH_NO_CERT,
135         PMINFO_CERT_COMPARE_ERROR,
136 } pkgmgrinfo_cert_compare_result_type_e;
137
138 /**
139  * @brief API return values
140  */
141 enum {
142         PMINFO_R_EINVAL = -2,           /**< Invalid argument */
143         PMINFO_R_ERROR = -1,            /**< General error */
144         PMINFO_R_OK = 0                 /**< General success */
145 };
146
147 typedef enum {
148         PMINFO_HWACCELERATION_OFF = 0,          /**< Don't use hardware acceleration*/
149         PMINFO_HWACCELERATION_ON = 1,           /**< Use hardware acceleration*/
150         PMINFO_HWACCELERATION_DEFAULT = 2               /**< Follow system setting for hardware acceleration */
151 }pkgmgrinfo_app_hwacceleration;
152
153 typedef enum {
154         PMINFO_SCREENREADER_OFF = 0,            /**< Don't use screen reader*/
155         PMINFO_SCREENREADER_ON = 1,             /**< Use screen reader*/
156         PMINFO_SCREENREADER_USE_SYSTEM_SETTING = 2              /**< Follow system setting for screen reader */
157 }pkgmgrinfo_app_screenreader;
158
159 typedef enum {
160         PMINFO_RECENTIMAGE_USE_ICON = 0,                /**<Use icon for recent image*/
161         PMINFO_RECENTIMAGE_USE_CAPTURE = 1,             /**< Use capture for recent image*/
162         PMINFO_RECENTIMAGE_USE_NOTHING = 2              /**< Don't use recent image */
163 }pkgmgrinfo_app_recentimage;
164
165 /**
166  * @brief Install Location Types
167  */
168 typedef enum {
169         PMINFO_INSTALL_LOCATION_AUTO = 0,               /**< Auto*/
170         PMINFO_INSTALL_LOCATION_INTERNAL_ONLY,          /**< Internal Installation*/
171         PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL,                /**< External Installation*/
172 }pkgmgrinfo_install_location;
173
174 /**
175  * @brief Application Component Types
176  */
177 typedef enum {
178         PMINFO_ALL_APP = 0,     /**< All Application*/
179         PMINFO_UI_APP,          /**< UI Application*/
180         PMINFO_SVC_APP,         /**< Service Application*/
181 }pkgmgrinfo_app_component;
182
183 /**
184  * @brief Application Storage Types
185  */
186 typedef enum {
187         PMINFO_INTERNAL_STORAGE = 0,            /**< Internal Storage*/
188         PMINFO_EXTERNAL_STORAGE = 1,            /**< External Storage*/
189 }pkgmgrinfo_installed_storage;
190
191 /**
192  * @brief Certificate Types to be used for getting information
193  */
194 typedef enum {
195         PMINFO_AUTHOR_ROOT_CERT = 0,            /**< Author Root Certificate*/
196         PMINFO_AUTHOR_INTERMEDIATE_CERT = 1,            /**< Author Intermediate Certificate*/
197         PMINFO_AUTHOR_SIGNER_CERT = 2,          /**< Author Signer Certificate*/
198         PMINFO_DISTRIBUTOR_ROOT_CERT = 3,               /**< Distributor Root Certificate*/
199         PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4,               /**< Distributor Intermediate Certificate*/
200         PMINFO_DISTRIBUTOR_SIGNER_CERT = 5,             /**< Distributor Signer Certificate*/
201         PMINFO_DISTRIBUTOR2_ROOT_CERT = 6,              /**< End Entity Root Certificate*/
202         PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7,              /**< End Entity Intermediate Certificate*/
203         PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8,            /**< End Entity Signer Certificate*/
204 }pkgmgrinfo_cert_type;
205
206 /**
207  * @brief Install Location Types to be used when setting data in DB
208  */
209 typedef enum {
210         INSTALL_INTERNAL = 0,           /**< Internal Installation*/
211         INSTALL_EXTERNAL,               /**< External Installation*/
212 } INSTALL_LOCATION;
213
214 /**
215  * @brief permission Types
216  */
217 typedef enum {
218         PMINFO_PERMISSION_NORMAL = 0,            /**< permission normal*/
219         PMINFO_PERMISSION_SIGNATURE,     /**< permission type is signature*/
220         PMINFO_PERMISSION_PRIVILEGE,     /**< permission type is privilege*/
221 }pkgmgrinfo_permission_type;
222
223
224 typedef enum {
225         PMINFO_REQUEST = 0,
226         PMINFO_LISTENING,
227         PMINFO_BROADCAST,
228 }pkgmgrinfo_client_type;
229
230 /**
231  * @fn int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
232  *
233  * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
234  *
235  * @param[in] handle the pkginfo handle
236  * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
237  *
238  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
239  *
240  * @see  pkgmgrinfo_pkginfo_get_list()
241  * @see  pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
242  */
243 typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data);
244
245 /**
246  * @fn int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data)
247  *
248  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
249  *
250  * @param[in] handle the appinfo handle
251  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
252  *
253  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
254  *
255  * @see  pkgmgrinfo_appinfo_get_list()
256  * @see  pkgmgrinfo_appinfo_filter_foreach_appinfo()
257  * @see  pkgmgrinfo_appinfo_metadata_filter_foreach()
258  */
259 typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data);
260
261 /**
262  * @fn int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data)
263  *
264  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
265  *
266  * @param[in] category_name the name of the category
267  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
268  *
269  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
270  *
271  * @see  pkgmgrinfo_appinfo_foreach_category()
272  */
273 typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data);
274
275 /**
276  * @fn int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type, void *user_data)
277  *
278  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
279  *
280  * @param[in] permission_name the name of the permission
281  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
282  *
283  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
284  *
285  * @see  pkgmgrinfo_appinfo_foreach_category()
286  */
287 typedef int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type, void *user_data);
288
289 /**
290  * @fn int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name, void *user_data)
291  *
292  * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
293  *
294  * @param[in] privilege_name the name of the privilege
295  * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_privilege()
296  *
297  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
298  *
299  * @see  pkgmgrinfo_pkginfo_foreach_privilege()
300  */
301 typedef int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name, void *user_data);
302
303 /**
304  * @fn int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data)
305  *
306  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
307  *
308  * @param[in] metadata_name the name of the metadata
309  * @param[in] metadata_value the value of the metadata
310  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
311  *
312  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
313  *
314  * @see  pkgmgrinfo_appinfo_foreach_metadata()
315  */
316 typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data);
317
318 /**
319  * @fn int (*pkgmgrinfo_app_control_list_cb ) const char *operation, const char *uri, const char *mime, void *user_data)
320  *
321  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
322  *
323  * @param[in] operation, retrieved operation
324  * @param[in] uri, retrieved uri
325  * @param[in] mime, retrieved mime
326  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
327  *
328  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
329  *
330  * @see  pkgmgrinfo_appinfo_foreach_appcontrol()
331  */
332 typedef int (*pkgmgrinfo_app_control_list_cb ) (const char *operation, const char *uri, const char *mime, void *user_data);
333
334 /**
335  * @fn int (*pkgmgrinfo_app_background_category_list_cb ) (const char *category_name, void *user_data)
336  *
337  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_background_category()
338  *
339  * @param[in] category_name retrieved background category name
340  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_background_category
341  *
342  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
343  *
344  * @see  pkgmgrinfo_appinfo_foreach_background_category()
345  */
346 typedef int (*pkgmgrinfo_app_background_category_list_cb ) (const char *category_name, void *user_data);
347
348 /**
349  * @brief type definition.
350  */
351 typedef int (*pkgmgrinfo_handler)(int req_id, const char *pkg_type,
352                                 const char *pkgid, const char *key,
353                                 const char *val, const void *pmsg, void *data);
354
355 typedef int (*pkgmgrinfo_handler_zone)(int req_id, const char *pkg_type,
356                                 const char *pkgid, const char *key,
357                                 const char *val, const void *pmsg, void *data, const char *zone);
358 #ifdef __cplusplus
359 }
360 #endif
361 #endif /* __PKGPMGRINFO_TYPE_H__ */