Add extended storage type for update installed storage
[platform/core/appfw/pkgmgr-info.git] / include / pkgmgrinfo_type.h
1 /*
2  * pkgmgr-info
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 #include <sys/types.h>
27
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
38
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"
48
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
53
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"
58
59 /**
60  * @brief A type to retrieve uid information from the manifest handle
61  */
62 typedef struct {
63         uid_t uid;
64 } pkgmgrinfo_uidinfo_t;
65
66 /**
67  * @brief A handle to insert certificate information
68  */
69 typedef void *pkgmgrinfo_instcertinfo_h;
70
71 /**
72  * @brief Certificate Types to be used for setting information
73  */
74 typedef enum {
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;
85
86 typedef enum {
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;
94
95 typedef enum {
96         PMINFO_APPINFO_GET_BASICINFO = 0x0001,
97         PMINFO_APPINFO_GET_LABEL = 0x0002,
98         PMINFO_APPINFO_GET_ICON = 0x0004,
99         PMINFO_APPINFO_GET_CATEGORY = 0x0008,
100         PMINFO_APPINFO_GET_APP_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;
105
106 typedef enum {
107         PMINFO_PKGINFO_GET_BASICINFO = 0x0001,
108         PMINFO_PKGINFO_GET_LABEL = 0x0002,
109         PMINFO_PKGINFO_GET_ICON = 0x0004,
110         PMINFO_PKGINFO_GET_AUTHOR = 0x0008,
111         PMINFO_PKGINFO_GET_DESCRIPTION = 0x0010,
112         PMINFO_PKGINFO_GET_PRIVILEGE = 0x0020,
113         PMINFO_PKGINFO_GET_APPDEFINED_PRIVILEGE = 0x0040,
114         PMINFO_PKGINFO_GET_ALL = 0x007F
115 } pkgmgrinfo_pkginfo_get_option;
116
117 /**
118  * @brief API return values
119  */
120 enum {
121         PMINFO_R_ENOENT = -3,           /**< No result */
122         PMINFO_R_EINVAL = -2,           /**< Invalid argument */
123         PMINFO_R_ERROR = -1,            /**< General error */
124         PMINFO_R_OK = 0                 /**< General success */
125 };
126
127 /**
128  * @brief Value to be used when filtering based on install location
129  */
130 #define PMINFO_PKGINFO_INSTALL_LOCATION_AUTO            "LOCATION_AUTO"
131
132 /**
133  * @brief Value to be used when filtering based on install location
134  */
135 #define PMINFO_PKGINFO_INSTALL_LOCATION_INTERNAL        "LOCATION_INTERNAL"
136
137 /**
138  * @brief Value to be used when filtering based on install location
139  */
140 #define PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL        "LOCATION_EXTERNAL"
141
142 /**
143  * @brief Value to be used when get/set update information
144  */
145 #define PMINFO_UPDATEINFO_TYPE_FORCE    "force"
146
147 /**
148  * @brief Value to be used when get/set update information
149  */
150 #define PMINFO_UPDATEINFO_TYPE_OPTIONAL "optional"
151
152 /**
153  * @brief Value to be used when get/set update information
154  */
155 #define PMINFO_UPDATEINFO_TYPE_NONE     "none"
156
157 typedef enum {
158         PMINFO_UPDATEINFO_NONE = 0,             /**<No update info exists*/
159         PMINFO_UPDATEINFO_FORCE,                /**<Don't launch application if it's not updated*/
160         PMINFO_UPDATEINFO_OPTIONAL              /**<Update exists but not force user to update it*/
161 } pkgmgrinfo_updateinfo_update_type;
162
163 typedef enum {
164         PMINFO_HWACCELERATION_OFF = 0,          /**< Don't use hardware acceleration*/
165         PMINFO_HWACCELERATION_ON = 1,           /**< Use hardware acceleration*/
166         PMINFO_HWACCELERATION_DEFAULT = 2               /**< Follow system setting for hardware acceleration */
167 } pkgmgrinfo_app_hwacceleration;
168
169 typedef enum {
170         PMINFO_SCREENREADER_OFF = 0,            /**< Don't use screen reader*/
171         PMINFO_SCREENREADER_ON = 1,             /**< Use screen reader*/
172         PMINFO_SCREENREADER_USE_SYSTEM_SETTING = 2              /**< Follow system setting for screen reader */
173 } pkgmgrinfo_app_screenreader;
174
175 typedef enum {
176         PMINFO_RECENTIMAGE_USE_ICON = 0,                /**<Use icon for recent image*/
177         PMINFO_RECENTIMAGE_USE_CAPTURE = 1,             /**< Use capture for recent image*/
178         PMINFO_RECENTIMAGE_USE_NOTHING = 2              /**< Don't use recent image */
179 } pkgmgrinfo_app_recentimage;
180
181 /**
182  * @brief A handle to get package information
183  */
184 typedef void *pkgmgrinfo_pkginfo_h;
185
186 /**
187  * @brief A handle to get application information
188  */
189 typedef void *pkgmgrinfo_appinfo_h;
190
191 /**
192  * @brief A handle to get certificate information
193  */
194 typedef void *pkgmgrinfo_certinfo_h;
195
196 /**
197  * @brief A handle to filter package information
198  */
199 typedef void *pkgmgrinfo_pkginfo_filter_h;
200
201 /**
202  * @brief A handle to get/set package update information
203  */
204 typedef void *pkgmgrinfo_updateinfo_h;
205
206 /**
207  * @brief A handle to filter application information
208  */
209 typedef void *pkgmgrinfo_appinfo_filter_h;
210
211 /**
212  * @brief A handle to filter application metadata  information
213  */
214 typedef void *pkgmgrinfo_appinfo_metadata_filter_h;
215
216 /**
217  * @brief A handle to get appcontrol information
218  */
219 typedef void *pkgmgrinfo_appcontrol_h;
220
221 /**
222  * @brief A handle to get package archive information
223  */
224 typedef void *pkgmgrinfo_archiveinfo_h;
225
226 /**
227  * @brief type definition.
228  */
229 typedef void pkgmgrinfo_client;
230
231 /**
232  * @fn int (*pkgmgrinfo_foreach_updateinfo_cb) (const pkgmgrinfo_updateinfo_h handle, void *user_data)
233  *
234  * @brief Specifies the type of function passed to pkgmgrinfo_updateinfo_foreach_updateinfo()
235  *
236  * @param[in] handle the package update info handle
237  * @param[in] user_data user data passed to pkgmgrinfo_foreach_pkg_update info()
238  *
239  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
240  *
241  * @see  pkgmgrinfo_updateinfo_foreach_updateinfo()
242  */
243 typedef int (*pkgmgrinfo_foreach_updateinfo_cb) (const pkgmgrinfo_updateinfo_h handle,
244                                                         void *user_data);
245
246 /**
247  * @fn int (*pkgmgrinfo_pkg_list_cb) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
248  *
249  * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
250  *
251  * @param[in] handle the pkginfo handle
252  * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
253  *
254  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
255  *
256  * @see  pkgmgrinfo_pkginfo_get_list()
257  * @see  pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
258  */
259 typedef int (*pkgmgrinfo_pkg_list_cb) (const pkgmgrinfo_pkginfo_h handle,
260                                                         void *user_data);
261
262 /**
263  * @fn int (*pkgmgrinfo_app_list_cb) (const pkgmgrinfo_appinfo_h handle, void *user_data)
264  *
265  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
266  *
267  * @param[in] handle the appinfo handle
268  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
269  *
270  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
271  *
272  * @see  pkgmgrinfo_appinfo_get_list()
273  * @see  pkgmgrinfo_appinfo_filter_foreach_appinfo()
274  * @see  pkgmgrinfo_appinfo_metadata_filter_foreach()
275  */
276 typedef int (*pkgmgrinfo_app_list_cb) (const pkgmgrinfo_appinfo_h handle,
277                                                         void *user_data);
278
279 /**
280  * @fn int (*pkgmgrinfo_app_category_list_cb) (const char *category_name, void *user_data)
281  *
282  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
283  *
284  * @param[in] category_name the name of the category
285  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
286  *
287  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
288  *
289  * @see  pkgmgrinfo_appinfo_foreach_category()
290  */
291 typedef int (*pkgmgrinfo_app_category_list_cb) (const char *category_name,
292                                                         void *user_data);
293
294 /**
295  * @fn int (*pkgmgrinfo_pkg_privilege_list_cb) (const char *privilege_name, void *user_data)
296  *
297  * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
298  *
299  * @param[in] privilege_name the name of the privilege
300  * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_privilege()
301  *
302  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
303  *
304  * @see  pkgmgrinfo_pkginfo_foreach_privilege()
305  */
306 typedef int (*pkgmgrinfo_pkg_privilege_list_cb) (const char *privilege_name,
307                                                         void *user_data);
308
309 /**
310  * @fn int (*pkgmgrinfo_pkg_appdefined_privilege_list_cb) (const char *privilege_name, const char *license_path, void *user_data)
311  *
312  * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_appdefined_privilege()
313  *
314  * @param[in] privilege_name the name of the privilege
315  * @param[in] license_path the path of the license
316  * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_appdefined_privilege()
317  *
318  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
319  *
320  * @see  pkgmgrinfo_pkginfo_foreach_appdefined_privilege()
321  */
322 typedef int (*pkgmgrinfo_pkg_appdefined_privilege_list_cb) (const char *privilege_name,
323                                                         const char *license_path,
324                                                         void *user_data);
325
326 /**
327  * @fn int (*pkgmgrinfo_app_metadata_list_cb) (const char *metadata_key, const char *metadata_value, void *user_data)
328  *
329  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
330  *
331  * @param[in] metadata_name the name of the metadata
332  * @param[in] metadata_value the value of the metadata
333  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
334  *
335  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
336  *
337  * @see  pkgmgrinfo_appinfo_foreach_metadata()
338  */
339 typedef int (*pkgmgrinfo_app_metadata_list_cb) (const char *metadata_key,
340                                                         const char *metadata_value, void *user_data);
341
342 /**
343  * @fn int (*pkgmgrinfo_app_control_list_cb) (pkgmgrinfo_appcontrol_h handle, void *user_data)
344  *
345  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
346  *
347  * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
348  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
349  *
350  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
351  *
352  * @see  pkgmgrinfo_appinfo_foreach_appcontrol()
353  */
354 typedef int (*pkgmgrinfo_app_control_list_cb) (const char *operation, const char *uri, const char *mime,
355                                                         void *user_data);
356
357 /**
358  * @fn int (*pkgmgrinfo_app_background_category_list_cb) (const char *category_name, void *user_data)
359  *
360  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_background_category()
361  *
362  * @param[in] category_name retrieved background category name
363  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_background_category
364  *
365  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
366  *
367  * @see  pkgmgrinfo_appinfo_foreach_background_category()
368  */
369 typedef int (*pkgmgrinfo_app_background_category_list_cb) (const char *category_name, void *user_data);
370
371 /**
372  * @fn int (*pkgmgrinfo_app_splash_screen_list_cb)(const char *src,
373  *              const char *type, const char *orientation,
374  *              const char *indicatordisplay, const char *color_depth,
375  *              void *user_data);
376  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_splash_screen()
377  *
378  * @param[in] src the source of the splashscreen
379  * @param[in] type the type of the splashscreen
380  * @param[in] orientation the orientation of the splashscreen
381  * @param[in] indicatordisplay the indicator-display of the splashscreen
382  * @param[in] operation the app-control operation of the splashscreen
383  * @param[in] color_depth the color-depth of the splashscreen
384  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_splash_screen()
385  *
386  * @return 0 if success, negative value(<0) if fail, Callback is not called if return value is negative.\n
387  *
388  * @see pkgmgrinfo_appinfo_foreach_splash_screen()
389  */
390 typedef int (*pkgmgrinfo_app_splash_screen_list_cb)(const char *src,
391                 const char *type, const char *orientation,
392                 const char *indicatordisplay, const char *operation,
393                 const char *color_depth, void *user_data);
394
395 /**
396  * @brief Install Location Types
397  */
398 typedef enum {
399         PMINFO_INSTALL_LOCATION_AUTO = 0,               /**< Auto*/
400         PMINFO_INSTALL_LOCATION_INTERNAL_ONLY,          /**< Internal Installation*/
401         PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL,                /**< External Installation*/
402 } pkgmgrinfo_install_location;
403
404 /**
405  * @brief Application Component Types
406  */
407 typedef enum {
408         PMINFO_ALL_APP = 0,     /**< All Application*/
409         PMINFO_UI_APP,          /**< UI Application*/
410         PMINFO_SVC_APP,         /**< Service Application*/
411         PMINFO_WIDGET_APP,      /**< Widget Application*/
412         PMINFO_WATCH_APP,  /**< Watch Application*/
413 } pkgmgrinfo_app_component;
414
415 /**
416  * @brief Application Storage Types
417  */
418 typedef enum {
419         PMINFO_INTERNAL_STORAGE = 0,            /**< Internal Storage*/
420         PMINFO_EXTERNAL_STORAGE = 1,            /**< External Storage*/
421         PMINFO_EXTENDED_STORAGE = 2,            /**< Extended Storage*/
422 } pkgmgrinfo_installed_storage;
423
424 /**
425  * @brief Certificate Types to be used for getting information
426  */
427 typedef enum {
428         PMINFO_AUTHOR_ROOT_CERT = 0,            /**< Author Root Certificate*/
429         PMINFO_AUTHOR_INTERMEDIATE_CERT = 1,            /**< Author Intermediate Certificate*/
430         PMINFO_AUTHOR_SIGNER_CERT = 2,          /**< Author Signer Certificate*/
431         PMINFO_DISTRIBUTOR_ROOT_CERT = 3,               /**< Distributor Root Certificate*/
432         PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4,               /**< Distributor Intermediate Certificate*/
433         PMINFO_DISTRIBUTOR_SIGNER_CERT = 5,             /**< Distributor Signer Certificate*/
434         PMINFO_DISTRIBUTOR2_ROOT_CERT = 6,              /**< End Entity Root Certificate*/
435         PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7,              /**< End Entity Intermediate Certificate*/
436         PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8,            /**< End Entity Signer Certificate*/
437 } pkgmgrinfo_cert_type;
438
439 /**
440  * @brief version comparison Types
441  */
442 typedef enum {
443         PMINFO_VERSION_OLD = -1,
444         PMINFO_VERSION_SAME,
445         PMINFO_VERSION_NEW,
446 } pkgmgrinfo_version_compare_type;
447
448 /**
449  * @brief Install Location Types to be used when setting data in DB
450  */
451 typedef enum {
452         INSTALL_INTERNAL = 0,           /**< Internal Installation*/
453         INSTALL_EXTERNAL,               /**< External Installation*/
454         INSTALL_EXTENDED,               /**< Extended Installation*/
455 } INSTALL_LOCATION;
456
457 /**
458  * @brief permission Types
459  */
460 typedef enum {
461         PMINFO_PERMISSION_NORMAL = 0,           /**< permission normal*/
462         PMINFO_PERMISSION_SIGNATURE,            /**< permission type is signature*/
463         PMINFO_PERMISSION_PRIVILEGE,            /**< permission type is privilege*/
464 } pkgmgrinfo_permission_type;
465
466 #endif