4df7bc417c10445180d95c3c7efd0429ac33ecad
[platform/core/appfw/pkgmgr-info.git] / include / pkgmgr-info.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
24
25
26
27 /**
28  * @file                pkgmgr-info.h
29  * @author              Sewook Park <sewook7.park@samsung.com>
30  * @author              Shobhit Srivastava <shobhit.s@samsung.com>
31  * @version             0.1
32  * @brief               This file declares API of pkgmgr-info library
33  *
34  * @addtogroup          APPLICATION_FRAMEWORK
35  * @{
36  *
37  * @defgroup            PackageManagerInfo
38  * @section             Header Header file to include:
39  * @code
40  * #include             <pkgmgr-info.h>
41  * @endcode
42  *
43  * @}
44  */
45
46 #ifndef __PKG_INFO_H__
47 #define __PKG_INFO_H__
48
49 #include <errno.h>
50 #include <stdbool.h>
51 #include <glib.h>
52 #include <unistd.h>
53 #include <sys/types.h>
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59
60 /**
61  * @mainpage
62  *
63  * This is package information library
64  *
65  * Package Information Library is used to get package related information.\n
66  * It uses the package manifest information database to get any package related information\n
67  * It also provides API to set information in the package info database\n
68  *
69  */
70
71 /**
72  * @file        pkgmgr-info.h
73  * @brief       Package Information Library Header File
74  *
75  * Generated by    Sewook Park <sewook7.park@samsung.com>
76  */
77
78 /**
79  * @brief A type to retrieve uid information from the manifest handle
80  */
81 typedef struct {
82         uid_t uid;
83 } pkgmgrinfo_uidinfo_t;
84
85 /**
86  * @brief A handle to insert certificate information
87  */
88 typedef void* pkgmgrinfo_instcertinfo_h;
89
90 /**
91  * @brief Certificate Types to be used for setting information
92  */
93 typedef enum {
94         PMINFO_SET_AUTHOR_ROOT_CERT = 0,                /**< Author Root Certificate*/
95         PMINFO_SET_AUTHOR_INTERMEDIATE_CERT = 1,                /**< Author Intermediate Certificate*/
96         PMINFO_SET_AUTHOR_SIGNER_CERT = 2,              /**< Author Signer Certificate*/
97         PMINFO_SET_DISTRIBUTOR_ROOT_CERT = 3,           /**< Distributor Root Certificate*/
98         PMINFO_SET_DISTRIBUTOR_INTERMEDIATE_CERT = 4,           /**< Distributor Intermediate Certificate*/
99         PMINFO_SET_DISTRIBUTOR_SIGNER_CERT = 5,         /**< Distributor Signer Certificate*/
100         PMINFO_SET_DISTRIBUTOR2_ROOT_CERT = 6,          /**< End Entity Root Certificate*/
101         PMINFO_SET_DISTRIBUTOR2_INTERMEDIATE_CERT = 7,          /**< End Entity Intermediate Certificate*/
102         PMINFO_SET_DISTRIBUTOR2_SIGNER_CERT = 8,                /**< End Entity Signer Certificate*/
103 }pkgmgrinfo_instcert_type;
104
105 typedef enum {
106         PMINFO_CERT_COMPARE_MATCH,
107         PMINFO_CERT_COMPARE_MISMATCH,
108         PMINFO_CERT_COMPARE_LHS_NO_CERT,
109         PMINFO_CERT_COMPARE_RHS_NO_CERT,
110         PMINFO_CERT_COMPARE_BOTH_NO_CERT,
111         PMINFO_CERT_COMPARE_ERROR,
112 } pkgmgrinfo_cert_compare_result_type_e;
113
114 /**
115  * @brief API return values
116  */
117 enum {
118         PMINFO_R_EINVAL = -2,           /**< Invalid argument */
119         PMINFO_R_ERROR = -1,            /**< General error */
120         PMINFO_R_OK = 0                 /**< General success */
121 };
122
123 /**
124  * @brief Value to be used when filtering based on install location
125  */
126 #define PMINFO_PKGINFO_INSTALL_LOCATION_AUTO            "LOCATION_AUTO"
127
128 /**
129  * @brief Value to be used when filtering based on install location
130  */
131 #define PMINFO_PKGINFO_INSTALL_LOCATION_INTERNAL        "LOCATION_INTERNAL"
132
133 /**
134  * @brief Value to be used when filtering based on install location
135  */
136 #define PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL        "LOCATION_EXTERNAL"
137
138 /**
139  * @brief Value to be used when filtering based on app-component
140  */
141 #define PMINFO_APPINFO_UI_APP                           "UI_APP"
142
143 /**
144  * @brief Value to be used when filtering based on app-component
145  */
146 #define PMINFO_APPINFO_SVC_APP                          "SVC_APP"
147
148 typedef enum {
149         PMINFO_HWACCELERATION_NOT_USE_GL = 0,           /**< Don't use hardware acceleration*/
150         PMINFO_HWACCELERATION_USE_GL = 1,               /**< Use hardware acceleration*/
151         PMINFO_HWACCELERATION_USE_SYSTEM_SETTING = 2            /**< Follow system setting for hardware acceleration */
152 }pkgmgrinfo_app_hwacceleration;
153
154 typedef enum {
155         PMINFO_SCREENREADER_OFF = 0,            /**< Don't use screen reader*/
156         PMINFO_SCREENREADER_ON = 1,             /**< Use screen reader*/
157         PMINFO_SCREENREADER_USE_SYSTEM_SETTING = 2              /**< Follow system setting for screen reader */
158 }pkgmgrinfo_app_screenreader;
159
160 typedef enum {
161         PMINFO_RECENTIMAGE_USE_ICON = 0,                /**<Use icon for recent image*/
162         PMINFO_RECENTIMAGE_USE_CAPTURE = 1,             /**< Use capture for recent image*/
163         PMINFO_RECENTIMAGE_USE_NOTHING = 2              /**< Don't use recent image */
164 }pkgmgrinfo_app_recentimage;
165
166 /**
167  * @brief A handle to get package information
168  */
169 typedef void* pkgmgrinfo_pkginfo_h;
170
171 /**
172  * @brief A handle to get application information
173  */
174 typedef void* pkgmgrinfo_appinfo_h;
175
176 /**
177  * @brief A handle to get certificate information
178  */
179 typedef void* pkgmgrinfo_certinfo_h;
180
181 /**
182  * @brief A handle to insert package information
183  */
184 typedef void* pkgmgrinfo_pkgdbinfo_h;
185
186 /**
187  * @brief A handle to filter package information
188  */
189 typedef void* pkgmgrinfo_pkginfo_filter_h;
190
191 /**
192  * @brief A handle to filter application information
193  */
194 typedef void* pkgmgrinfo_appinfo_filter_h;
195
196 /**
197  * @brief A handle to filter application metadata  information
198  */
199 typedef void* pkgmgrinfo_appinfo_metadata_filter_h;
200
201 /**
202  * @brief A handle to get appcontrol information
203  */
204 typedef void* pkgmgrinfo_appcontrol_h;
205
206 /**
207  * @fn int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
208  *
209  * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
210  *
211  * @param[in] handle the pkginfo handle
212  * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
213  *
214  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
215  *
216  * @see  pkgmgrinfo_pkginfo_get_list()
217  * @see  pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
218  */
219 typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle,
220                                                         void *user_data);
221
222 /**
223  * @fn int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data)
224  *
225  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
226  *
227  * @param[in] handle the appinfo handle
228  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
229  *
230  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
231  *
232  * @see  pkgmgrinfo_appinfo_get_list()
233  * @see  pkgmgrinfo_appinfo_filter_foreach_appinfo()
234  * @see  pkgmgrinfo_appinfo_metadata_filter_foreach()
235  */
236 typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle,
237                                                         void *user_data);
238
239 /**
240  * @fn int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data)
241  *
242  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
243  *
244  * @param[in] category_name the name of the category
245  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
246  *
247  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
248  *
249  * @see  pkgmgrinfo_appinfo_foreach_category()
250  */
251 typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name,
252                                                         void *user_data);
253
254 /**
255  * @fn int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type, void *user_data)
256  *
257  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
258  *
259  * @param[in] permission_name the name of the permission
260  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
261  *
262  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
263  *
264  * @see  pkgmgrinfo_appinfo_foreach_category()
265  */
266 typedef int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type,
267                                                         void *user_data);
268
269 /**
270  * @fn int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name, void *user_data)
271  *
272  * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
273  *
274  * @param[in] privilege_name the name of the privilege
275  * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_privilege()
276  *
277  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
278  *
279  * @see  pkgmgrinfo_pkginfo_foreach_privilege()
280  */
281 typedef int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name,
282                                                         void *user_data);
283
284 /**
285  * @fn int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data)
286  *
287  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
288  *
289  * @param[in] metadata_name the name of the metadata
290  * @param[in] metadata_value the value of the metadata
291  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
292  *
293  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
294  *
295  * @see  pkgmgrinfo_appinfo_foreach_metadata()
296  */
297 typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key,
298                                                         const char *metadata_value, void *user_data);
299
300 /**
301  * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
302  *
303  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
304  *
305  * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
306  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
307  *
308  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
309  *
310  * @see  pkgmgrinfo_appinfo_foreach_appcontrol()
311  */
312 typedef int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle,
313                                                         void *user_data);
314
315 typedef struct eventsystem_info {
316         char *appid;
317         char *event_name;
318 } eventsystem_info_s;
319
320 /**
321  * @brief Install Location Types
322  */
323 typedef enum {
324         PMINFO_INSTALL_LOCATION_AUTO = 0,               /**< Auto*/
325         PMINFO_INSTALL_LOCATION_INTERNAL_ONLY,          /**< Internal Installation*/
326         PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL,                /**< External Installation*/
327 }pkgmgrinfo_install_location;
328
329 /**
330  * @brief Application Component Types
331  */
332 typedef enum {
333         PMINFO_ALL_APP = 0,     /**< All Application*/
334         PMINFO_UI_APP,          /**< UI Application*/
335         PMINFO_SVC_APP,         /**< Service Application*/
336 }pkgmgrinfo_app_component;
337
338 /**
339  * @brief Application Storage Types
340  */
341 typedef enum {
342         PMINFO_INTERNAL_STORAGE = 0,            /**< Internal Storage*/
343         PMINFO_EXTERNAL_STORAGE = 1,            /**< External Storage*/
344 }pkgmgrinfo_installed_storage;
345
346 /**
347  * @brief Certificate Types to be used for getting information
348  */
349 typedef enum {
350         PMINFO_AUTHOR_ROOT_CERT = 0,            /**< Author Root Certificate*/
351         PMINFO_AUTHOR_INTERMEDIATE_CERT = 1,            /**< Author Intermediate Certificate*/
352         PMINFO_AUTHOR_SIGNER_CERT = 2,          /**< Author Signer Certificate*/
353         PMINFO_DISTRIBUTOR_ROOT_CERT = 3,               /**< Distributor Root Certificate*/
354         PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4,               /**< Distributor Intermediate Certificate*/
355         PMINFO_DISTRIBUTOR_SIGNER_CERT = 5,             /**< Distributor Signer Certificate*/
356         PMINFO_DISTRIBUTOR2_ROOT_CERT = 6,              /**< End Entity Root Certificate*/
357         PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7,              /**< End Entity Intermediate Certificate*/
358         PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8,            /**< End Entity Signer Certificate*/
359 }pkgmgrinfo_cert_type;
360
361 /**
362  * @brief Install Location Types to be used when setting data in DB
363  */
364 typedef enum {
365         INSTALL_INTERNAL = 0,           /**< Internal Installation*/
366         INSTALL_EXTERNAL,               /**< External Installation*/
367 } INSTALL_LOCATION;
368
369  /**
370   * @brief permission Types
371   */
372  typedef enum {
373          PMINFO_PERMISSION_NORMAL = 0,           /**< permission normal*/
374          PMINFO_PERMISSION_SIGNATURE,    /**< permission type is signature*/
375          PMINFO_PERMISSION_PRIVILEGE,    /**< permission type is privilege*/
376  }pkgmgrinfo_permission_type;
377
378
379  /** String property for filtering based on package info*/
380 #define PMINFO_PKGINFO_PROP_PACKAGE_ID          "PMINFO_PKGINFO_PROP_PACKAGE_ID"
381  /** String property for filtering based on package info*/
382 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE        "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
383  /** String property for filtering based on package info*/
384 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION     "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
385  /** String property for filtering based on package info*/
386 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION            "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
387   /** String property for filtering based on package info*/
388 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE           "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
389  /** String property for filtering based on package info*/
390 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME         "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
391  /** String property for filtering based on package info*/
392 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL                "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
393  /** String property for filtering based on package info*/
394 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF         "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
395
396  /** Boolean property for filtering based on package info*/
397 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE           "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
398  /** Boolean property for filtering based on package info*/
399 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD             "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
400  /** Boolean property for filtering based on package info*/
401 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY            "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
402   /** Boolean property for filtering based on package info*/
403 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE              "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
404   /** Boolean property for filtering based on package info*/
405 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING          "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
406    /** Boolean property for filtering based on package info*/
407 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING           "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
408
409  /** Integer property for filtering based on package info*/
410 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE                "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
411
412  /** String property for filtering based on app info*/
413 #define PMINFO_APPINFO_PROP_APP_ID              "PMINFO_APPINFO_PROP_APP_ID"
414  /** String property for filtering based on app info*/
415 #define PMINFO_APPINFO_PROP_APP_COMPONENT               "PMINFO_APPINFO_PROP_APP_COMPONENT"
416  /** String property for filtering based on app info*/
417 #define PMINFO_APPINFO_PROP_APP_EXEC            "PMINFO_APPINFO_PROP_APP_EXEC"
418  /** String property for filtering based on app info*/
419 #define PMINFO_APPINFO_PROP_APP_ICON            "PMINFO_APPINFO_PROP_APP_ICON"
420  /** String property for filtering based on app info*/
421 #define PMINFO_APPINFO_PROP_APP_TYPE            "PMINFO_APPINFO_PROP_APP_TYPE"
422  /** String property for filtering based on app info*/
423 #define PMINFO_APPINFO_PROP_APP_OPERATION       "PMINFO_APPINFO_PROP_APP_OPERATION"
424  /** String property for filtering based on app info*/
425 #define PMINFO_APPINFO_PROP_APP_URI                     "PMINFO_APPINFO_PROP_APP_URI"
426  /** String property for filtering based on app info*/
427 #define PMINFO_APPINFO_PROP_APP_MIME            "PMINFO_APPINFO_PROP_APP_MIME"
428  /** String property for filtering based on app info*/
429 #define PMINFO_APPINFO_PROP_APP_CATEGORY        "PMINFO_APPINFO_PROP_APP_CATEGORY"
430  /** String property for filtering based on app info*/
431 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION  "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
432   /** String property for filtering based on app info*/
433 #define PMINFO_APPINFO_PROP_APP_SCREENREADER    "PMINFO_APPINFO_PROP_APP_SCREENREADER"
434
435  /** Boolean property for filtering based on app info*/
436 #define PMINFO_APPINFO_PROP_APP_NODISPLAY               "PMINFO_APPINFO_PROP_APP_NODISPLAY"
437  /** Boolean property for filtering based on app info*/
438 #define PMINFO_APPINFO_PROP_APP_MULTIPLE                "PMINFO_APPINFO_PROP_APP_MULTIPLE"
439  /** Boolean property for filtering based on app info*/
440 #define PMINFO_APPINFO_PROP_APP_ONBOOT                  "PMINFO_APPINFO_PROP_APP_ONBOOT"
441  /** Boolean property for filtering based on app info*/
442 #define PMINFO_APPINFO_PROP_APP_AUTORESTART     "PMINFO_APPINFO_PROP_APP_AUTORESTART"
443  /** Boolean property for filtering based on app info*/
444 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE      "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
445  /** Boolean property for filtering based on app info*/
446 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
447
448  /** will be updated*/
449  /** string property for filtering based on pkg info*/
450 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
451
452 /* For multiuser support */
453 char *getIconPath(uid_t uid);
454 char *getUserPkgParserDBPath(void);
455 char *getUserPkgParserDBPathUID(uid_t uid);
456 char *getUserPkgCertDBPath(void);
457 char *getUserPkgCertDBPathUID(uid_t uid);
458 const char* getUserDesktopPath(uid_t uid);
459 const char* getUserManifestPath(uid_t uid);
460
461 /**
462  * @fn  int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
463  * @fn  int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
464  * @brief       This API gets list of installed packages
465  *
466  * @par         This API is for package-manager client application
467  * @par Sync (or) Async : Synchronous API
468  * @param[in]   pkg_list_cb     iteration function for list
469  * @param[in]   user_data       user data to be passed to callback function
470  * @param[in]   uid     the addressee user id of the instruction
471  * @return      0 if success, error code(<0) if fail
472  * @retval      PMINFO_R_OK     success
473  * @retval      PMINFO_R_EINVAL invalid argument
474  * @retval      PMINFO_R_ERROR  internal error
475  * @pre         None
476  * @post        None
477  * @code
478 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
479 {
480         char *pkgid1 = NULL;
481         char *pkgid2 = NULL;
482         pkgid1 = (char *)user_data;
483         pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
484         if (strcmp(pkgid1, pkgid2) == 0) {
485                 return -1;
486         } else {
487                 return 0;
488         }
489 }
490
491 static int list_pkgs()
492 {
493         int ret = 0;
494         char *name = "helloworld";
495         ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
496         if (ret != PMINFO_R_OK) {
497                 return -1;
498         }
499         return 0;
500 }
501  * @endcode
502  */
503 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
504 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
505 /**
506  * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
507  * @brief       This API creates the package information handle from db
508  *
509  * @par         This API is for package-manager client application
510  * @par Sync (or) Async : Synchronous API
511  *
512  * @param[in]   pkgid   pointer to package ID
513  * @param[in]   uid     the addressee user id of the instruction
514  * @param[out] handle           pointer to the package info handle.
515  * @return      0 if success, error code(<0) if fail
516  * @retval      PMINFO_R_OK     success
517  * @retval      PMINFO_R_EINVAL invalid argument
518  * @retval      PMINFO_R_ERROR  internal error
519  * @pre         None
520  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
521  * @see         pkgmgrinfo_pkginfo_get_pkgid()
522  * @see         pkgmgrinfo_pkginfo_is_removable()
523  * @code
524 static int get_pkg_type(const char *pkgid)
525 {
526         int ret = 0;
527         char *type = NULL;
528         pkgmgrinfo_pkginfo_h handle;
529         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
530         if (ret != PMINFO_R_OK)
531                 return -1;
532         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
533         if (ret != PMINFO_R_OK) {
534                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
535                 return -1;
536         }
537         printf("pkgtype: %s\n", type);
538         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
539         return 0;
540 }
541  * @endcode
542  */
543 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
544 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
545
546 /**
547  * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
548  * @brief       This API gets the package name from the package ID
549  *
550  * @par         This API is for package-manager client application
551  * @par Sync (or) Async : Synchronous API
552  *
553  * @param[in]   handle  pointer to package info handle
554  * @param[out]  pkg_name        pointer to hold package name
555  * @return      0 if success, error code(<0) if fail
556  * @retval      PMINFO_R_OK     success
557  * @retval      PMINFO_R_EINVAL invalid argument
558  * @retval      PMINFO_R_ERROR  internal error
559  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
560  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
561  * @see         pkgmgrinfo_pkginfo_get_type()
562  * @see         pkgmgrinfo_pkginfo_is_removable()
563  * @code
564 static int get_pkg_name(const char *pkgid)
565 {
566         int ret = 0;
567         char *pkgname = NULL;
568         pkgmgrinfo_pkginfo_h handle;
569         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
570         if (ret != PMINFO_R_OK)
571                 return -1;
572         ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
573         if (ret != PMINFO_R_OK) {
574                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
575                 return -1;
576         }
577         printf("pkgname: %s\n", pkgname);
578         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
579         return 0;
580 }
581  * @endcode
582  */
583 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
584
585 /**
586  * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
587  * @brief       This API gets the package id from the package ID
588  *
589  * @par         This API is for package-manager client application
590  * @par Sync (or) Async : Synchronous API
591  *
592  * @param[in]   handle  pointer to package info handle
593  * @param[out]  pkgid   pointer to hold package id
594  * @return      0 if success, error code(<0) if fail
595  * @retval      PMINFO_R_OK     success
596  * @retval      PMINFO_R_EINVAL invalid argument
597  * @retval      PMINFO_R_ERROR  internal error
598  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
599  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
600  * @see         pkgmgrinfo_pkginfo_get_type()
601  * @see         pkgmgrinfo_pkginfo_is_removable()
602  * @code
603 static int get_pkgid(const char *pkgid)
604 {
605         int ret = 0;
606         char *pkg_id = NULL;
607         pkgmgrinfo_pkginfo_h handle;
608         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
609         if (ret != PMINFO_R_OK)
610                 return -1;
611         ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
612         if (ret != PMINFO_R_OK) {
613                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
614                 return -1;
615         }
616         printf("pkg id: %s\n", pkg_id);
617         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
618         return 0;
619 }
620  * @endcode
621  */
622 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
623
624 /**
625  * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
626  * @brief       This API gets the package type from the package ID
627  *
628  * @par         This API is for package-manager client application
629  * @par Sync (or) Async : Synchronous API
630  *
631  * @param[in]   handle  pointer to package info handle
632  * @param[out] type             pointer to hold package type
633  * @return      0 if success, error code(<0) if fail
634  * @retval      PMINFO_R_OK     success
635  * @retval      PMINFO_R_EINVAL invalid argument
636  * @retval      PMINFO_R_ERROR  internal error
637  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
638  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
639  * @see         pkgmgrinfo_pkginfo_get_pkgid()
640  * @see         pkgmgrinfo_pkginfo_is_removable()
641  * @code
642 static int get_pkg_type(const char *pkgid)
643 {
644         int ret = 0;
645         char *type = NULL;
646         pkgmgrinfo_pkginfo_h handle;
647         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
648         if (ret != PMINFO_R_OK)
649                 return -1;
650         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
651         if (ret != PMINFO_R_OK) {
652                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
653                 return -1;
654         }
655         printf("pkgtype: %s\n", type);
656         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
657         return 0;
658 }
659  * @endcode
660  */
661 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
662
663 /**
664  * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
665  * @brief       This API gets the package version from the package ID
666  *
667  * @par         This API is for package-manager client application
668  * @par Sync (or) Async : Synchronous API
669  *
670  * @param[in]   handle  pointer to package info handle
671  * @param[out] version          pointer to hold package version
672  * @return      0 if success, error code(<0) if fail
673  * @retval      PMINFO_R_OK     success
674  * @retval      PMINFO_R_EINVAL invalid argument
675  * @retval      PMINFO_R_ERROR  internal error
676  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
677  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
678  * @see         pkgmgrinfo_pkginfo_get_pkgid()
679  * @see         pkgmgrinfo_pkginfo_is_removable()
680  * @code
681 static int get_pkg_version(const char *pkgid)
682 {
683         int ret = 0;
684         char *version = NULL;
685         pkgmgrinfo_pkginfo_h handle;
686         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
687         if (ret != PMINFO_R_OK)
688                 return -1;
689         ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
690         if (ret != PMINFO_R_OK) {
691                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
692                 return -1;
693         }
694         printf("pkg version: %s\n", version);
695         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
696         return 0;
697 }
698  * @endcode
699  */
700 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
701
702 /**
703  * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
704  * @brief       This API gets the package install location from the package ID
705  *
706  * @par         This API is for package-manager client application
707  * @par Sync (or) Async : Synchronous API
708  *
709  * @param[in] handle    pointer to package info handle
710  * @param[out] location         pointer to hold package install location
711  * @return      0 if success, error code(<0) if fail
712  * @retval      PMINFO_R_OK     success
713  * @retval      PMINFO_R_EINVAL invalid argument
714  * @retval      PMINFO_R_ERROR  internal error
715  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
716  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
717  * @see         pkgmgrinfo_pkginfo_get_pkgid()
718  * @see         pkgmgrinfo_pkginfo_is_removable()
719  * @code
720 static int get_pkg_install_location(const char *pkgid)
721 {
722         int ret = 0;
723         pkgmgrinfo_install_location location;
724         pkgmgrinfo_pkginfo_h handle;
725         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
726         if (ret != PMINFO_R_OK)
727                 return -1;
728         ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
729         if (ret != PMINFO_R_OK) {
730                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
731                 return -1;
732         }
733         printf("pkg install location: %d\n", location);
734         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
735         return 0;
736 }
737  * @endcode
738  */
739 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
740
741 /**
742  * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
743  * @brief       This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
744  size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
745  the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
746  *
747  * @par         This API is for package-manager client application
748  * @par Sync (or) Async : Synchronous API
749  *
750  * @param[in]   handle  pointer to package info handle
751  * @param[out] size             pointer to hold package size
752  * @return      0 if success, error code(<0) if fail
753  * @retval      PMINFO_R_OK     success
754  * @retval      PMINFO_R_EINVAL invalid argument
755  * @retval      PMINFO_R_ERROR  internal error
756  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
757  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
758  * @see         pkgmgrinfo_pkginfo_get_pkgid()
759  * @see         pkgmgrinfo_pkginfo_is_removable()
760  * @code
761 static int get_pkg_size(const char *pkgid)
762 {
763         int ret = 0;
764         int size = 0;
765         pkgmgrinfo_pkginfo_h handle;
766         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
767         if (ret != PMINFO_R_OK)
768                 return -1;
769         ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
770         if (ret != PMINFO_R_OK) {
771                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
772                 return -1;
773         }
774         printf("pkgsize: %d\n", size);
775         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
776         return 0;
777 }
778  * @endcode
779  */
780 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
781
782 /**
783  * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
784  * @brief       This API gets the installed package total size on the target.
785  *
786  * @par         This API is for package-manager client application
787  * @par Sync (or) Async : Synchronous API
788  *
789  * @param[in]   handle  pointer to package info handle
790  * @param[out] size             pointer to hold package total size
791  * @return      0 if success, error code(<0) if fail
792  * @retval      PMINFO_R_OK     success
793  * @retval      PMINFO_R_EINVAL invalid argument
794  * @retval      PMINFO_R_ERROR  internal error
795  * @code
796 static int get_pkg_total_size(const char *pkgid)
797 {
798         int ret = 0;
799         int size = 0;
800         pkgmgrinfo_pkginfo_h handle;
801         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
802         if (ret != PMINFO_R_OK)
803                 return -1;
804         ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
805         if (ret != PMINFO_R_OK) {
806                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
807                 return -1;
808         }
809         printf("pkg total size: %d\n", size);
810         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
811         return 0;
812 }
813  * @endcode
814  */
815  int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
816
817 /**
818  * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
819  * @brief       This API gets the installed package data size on the target.
820  *
821  * @par         This API is for package-manager client application
822  * @par Sync (or) Async : Synchronous API
823  *
824  * @param[in]   handle  pointer to package info handle
825  * @param[out] size             pointer to hold package data size
826  * @return      0 if success, error code(<0) if fail
827  * @retval      PMINFO_R_OK     success
828  * @retval      PMINFO_R_EINVAL invalid argument
829  * @retval      PMINFO_R_ERROR  internal error
830  * @code
831 static int get_pkg_data_size(const char *pkgid)
832 {
833         int ret = 0;
834         int size = 0;
835         pkgmgrinfo_pkginfo_h handle;
836         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
837         if (ret != PMINFO_R_OK)
838                 return -1;
839         ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
840         if (ret != PMINFO_R_OK) {
841                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
842                 return -1;
843         }
844         printf("pkg data size: %d\n", size);
845         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
846         return 0;
847 }
848  * @endcode
849  */
850  int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
851
852 /**
853  * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
854  * @brief       This API gets the package icon from the package ID
855  *
856  * @par         This API is for package-manager client application
857  * @par Sync (or) Async : Synchronous API
858  *
859  * @param[in]   handle  pointer to package info handle
860  * @param[out] icon             pointer to hold package icon
861  * @return      0 if success, error code(<0) if fail
862  * @retval      PMINFO_R_OK     success
863  * @retval      PMINFO_R_EINVAL invalid argument
864  * @retval      PMINFO_R_ERROR  internal error
865  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
866  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
867  * @see         pkgmgrinfo_pkginfo_get_pkgid()
868  * @see         pkgmgrinfo_pkginfo_is_removable()
869  * @code
870 static int get_pkg_icon(const char *pkgid)
871 {
872         int ret = 0;
873         char *icon = NULL;
874         pkgmgrinfo_pkginfo_h handle;
875         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
876         if (ret != PMINFO_R_OK)
877                 return -1;
878         ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
879         if (ret != PMINFO_R_OK) {
880                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
881                 return -1;
882         }
883         printf("pkg icon: %s\n", icon);
884         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
885         return 0;
886 }
887  * @endcode
888  */
889 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
890
891 /**
892  * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
893  * @brief       This API gets the package label from the package ID
894  *
895  * @par         This API is for package-manager client application
896  * @par Sync (or) Async : Synchronous API
897  *
898  * @param[in]   handle  pointer to package info handle
899  * @param[out] label            pointer to hold package label
900  * @return      0 if success, error code(<0) if fail
901  * @retval      PMINFO_R_OK     success
902  * @retval      PMINFO_R_EINVAL invalid argument
903  * @retval      PMINFO_R_ERROR  internal error
904  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
905  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
906  * @see         pkgmgrinfo_pkginfo_get_pkgid()
907  * @see         pkgmgrinfo_pkginfo_is_removable()
908  * @code
909 static int get_pkg_label(const char *pkgid)
910 {
911         int ret = 0;
912         char *label = NULL;
913         pkgmgrinfo_pkginfo_h handle;
914         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
915         if (ret != PMINFO_R_OK)
916                 return -1;
917         ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
918         if (ret != PMINFO_R_OK) {
919                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
920                 return -1;
921         }
922         printf("pkg label: %s\n", label);
923         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
924         return 0;
925 }
926  * @endcode
927  */
928 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
929
930 /**
931  * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
932  * @brief       This API gets the package description from the package ID
933  *
934  * @par         This API is for package-manager client application
935  * @par Sync (or) Async : Synchronous API
936  *
937  * @param[in]   handle  pointer to package info handle
938  * @param[out] description              pointer to hold package description
939  * @return      0 if success, error code(<0) if fail
940  * @retval      PMINFO_R_OK     success
941  * @retval      PMINFO_R_EINVAL invalid argument
942  * @retval      PMINFO_R_ERROR  internal error
943  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
944  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
945  * @see         pkgmgrinfo_pkginfo_get_pkgid()
946  * @see         pkgmgrinfo_pkginfo_is_removable()
947  * @code
948 static int get_pkg_description(const char *pkgid)
949 {
950         int ret = 0;
951         char *description = NULL;
952         pkgmgrinfo_pkginfo_h handle;
953         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
954         if (ret != PMINFO_R_OK)
955                 return -1;
956         ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
957         if (ret != PMINFO_R_OK) {
958                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
959                 return -1;
960         }
961         printf("pkg description: %s\n", description);
962         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
963         return 0;
964 }
965  * @endcode
966  */
967 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
968
969 /**
970  * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
971  * @brief       This API gets the package's author name from the package ID
972  *
973  * @par         This API is for package-manager client application
974  * @par Sync (or) Async : Synchronous API
975  *
976  * @param[in]   handle  pointer to package info handle
977  * @param[out] author_name              pointer to hold package author name
978  * @return      0 if success, error code(<0) if fail
979  * @retval      PMINFO_R_OK     success
980  * @retval      PMINFO_R_EINVAL invalid argument
981  * @retval      PMINFO_R_ERROR  internal error
982  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
983  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
984  * @see         pkgmgrinfo_pkginfo_get_pkgid()
985  * @see         pkgmgrinfo_pkginfo_is_removable()
986  * @code
987 static int get_pkg_author_name(const char *pkgid)
988 {
989         int ret = 0;
990         char *author_name = NULL;
991         pkgmgrinfo_pkginfo_h handle;
992         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
993         if (ret != PMINFO_R_OK)
994                 return -1;
995         ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
996         if (ret != PMINFO_R_OK) {
997                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
998                 return -1;
999         }
1000         printf("pkg author name: %s\n", author_name);
1001         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1002         return 0;
1003 }
1004  * @endcode
1005  */
1006 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
1007
1008 /**
1009  * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
1010  * @brief       This API gets the package's author email from the package ID
1011  *
1012  * @par         This API is for package-manager client application
1013  * @par Sync (or) Async : Synchronous API
1014  *
1015  * @param[in]   handle  pointer to package info handle
1016  * @param[out] author_email             pointer to hold package author email
1017  * @return      0 if success, error code(<0) if fail
1018  * @retval      PMINFO_R_OK     success
1019  * @retval      PMINFO_R_EINVAL invalid argument
1020  * @retval      PMINFO_R_ERROR  internal error
1021  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1022  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1023  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1024  * @see         pkgmgrinfo_pkginfo_is_removable()
1025  * @code
1026 static int get_pkg_author_email(const char *pkgid)
1027 {
1028         int ret = 0;
1029         char *author_email = NULL;
1030         pkgmgrinfo_pkginfo_h handle;
1031         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1032         if (ret != PMINFO_R_OK)
1033                 return -1;
1034         ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
1035         if (ret != PMINFO_R_OK) {
1036                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1037                 return -1;
1038         }
1039         printf("pkg author email: %s\n", author_email);
1040         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1041         return 0;
1042 }
1043  * @endcode
1044  */
1045 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
1046
1047 /**
1048  * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
1049  * @brief       This API gets the package's author href from the package ID
1050  *
1051  * @par         This API is for package-manager client application
1052  * @par Sync (or) Async : Synchronous API
1053  *
1054  * @param[in]   handle  pointer to package info handle
1055  * @param[out] author_href              pointer to hold package author href
1056  * @return      0 if success, error code(<0) if fail
1057  * @retval      PMINFO_R_OK     success
1058  * @retval      PMINFO_R_EINVAL invalid argument
1059  * @retval      PMINFO_R_ERROR  internal error
1060  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1061  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1062  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1063  * @see         pkgmgrinfo_pkginfo_is_removable()
1064  * @code
1065 static int get_pkg_author_href(const char *pkgid)
1066 {
1067         int ret = 0;
1068         char *author_href = NULL;
1069         pkgmgrinfo_pkginfo_h handle;
1070         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1071         if (ret != PMINFO_R_OK)
1072                 return -1;
1073         ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
1074         if (ret != PMINFO_R_OK) {
1075                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1076                 return -1;
1077         }
1078         printf("pkg author href: %s\n", author_href);
1079         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1080         return 0;
1081 }
1082  * @endcode
1083  */
1084 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1085
1086 /**
1087  * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1088  * @brief       This API gets the package installed storagae value from the package ID
1089  *
1090  * @par         This API is for package-manager client application
1091  * @par Sync (or) Async : Synchronous API
1092  *
1093  * @param[in]   handle  pointer to package info handle
1094  * @param[out] storage          pointer to hold package installed storage
1095  * @return      0 if success, error code(<0) if fail
1096  * @retval      PMINFO_R_OK     success
1097  * @retval      PMINFO_R_EINVAL invalid argument
1098  * @retval      PMINFO_R_ERROR  internal error
1099  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1100  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1101  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1102  * @see         pkgmgrinfo_pkginfo_is_removable()
1103  * @code
1104 static int get_pkg_installed_storage(const char *pkgid)
1105 {
1106         int ret = 0;
1107         pkgmgrinfo_installed_storage storage;
1108         pkgmgrinfo_pkginfo_h handle;
1109         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1110         if (ret != PMINFO_R_OK)
1111                 return -1;
1112         ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1113         if (ret != PMINFO_R_OK) {
1114                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1115                 return -1;
1116         }
1117         printf("pkg installed storage: %d\n", storage);
1118         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1119         return 0;
1120 }
1121  * @endcode
1122  */
1123 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1124
1125 /**
1126  * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1127  * @brief       This API gets the installed time of package from the package ID
1128  *
1129  * @par         This API is for package-manager client application
1130  * @par Sync (or) Async : Synchronous API
1131  *
1132  * @param[in]   handle  pointer to package info handle
1133  * @param[out] installed_time           pointer to hold installed time of package
1134  * @return      0 if success, error code(<0) if fail
1135  * @retval      PMINFO_R_OK     success
1136  * @retval      PMINFO_R_EINVAL invalid argument
1137  * @retval      PMINFO_R_ERROR  internal error
1138  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1139  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1140  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1141  * @see         pkgmgrinfo_pkginfo_is_removable()
1142  * @code
1143 static int get_pkg_installed_time(const char *pkgid)
1144 {
1145         int ret = 0;
1146         int installed_time = 0;
1147         pkgmgrinfo_pkginfo_h handle;
1148         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1149         if (ret != PMINFO_R_OK)
1150                 return -1;
1151         ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1152         if (ret != PMINFO_R_OK) {
1153                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1154                 return -1;
1155         }
1156         printf("installed_time: %d\n", installed_time);
1157         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1158         return 0;
1159 }
1160  * @endcode
1161  */
1162 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1163
1164 /**
1165  * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1166  * @brief       This API gets the launch mode of package from the package ID
1167  *
1168  * @par         This API is for package-manager client application
1169  * @par Sync (or) Async : Synchronous API
1170  *
1171  * @param[in]   handle  pointer to package info handle
1172  * @param[out] mode             pointer to hold launch mode of package
1173  * @return      0 if success, error code(<0) if fail
1174  * @retval      PMINFO_R_OK     success
1175  * @retval      PMINFO_R_EINVAL invalid argument
1176  * @retval      PMINFO_R_ERROR  internal error
1177  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1178  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1179  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1180  * @see         pkgmgrinfo_pkginfo_is_removable()
1181  * @code
1182 static int get_pkg_launch_mode(const char *pkgid)
1183 {
1184         int ret = 0;
1185         char *launch_mode = NULL;
1186         pkgmgrinfo_pkginfo_h handle;
1187         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1188         if (ret != PMINFO_R_OK)
1189                 return -1;
1190         ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1191         if (ret != PMINFO_R_OK) {
1192                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1193                 return -1;
1194         }
1195         printf("launch mode: %s\n", mode);
1196         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1197         return 0;
1198 }
1199  * @endcode
1200  */
1201 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1202
1203 /**
1204  * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1205  * @brief       This API gets the store client id of package from the package ID
1206  *
1207  * @par         This API is for package-manager client application
1208  * @par Sync (or) Async : Synchronous API
1209  *
1210  * @param[in]   handle  pointer to package info handle
1211  * @param[out] storeclientid            pointer to hold store client id of package
1212  * @return      0 if success, error code(<0) if fail
1213  * @retval      PMINFO_R_OK     success
1214  * @retval      PMINFO_R_EINVAL invalid argument
1215  * @retval      PMINFO_R_ERROR  internal error
1216  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1217  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1218  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1219  * @see         pkgmgrinfo_pkginfo_is_removable()
1220  * @code
1221 static int get_pkg_storeclientid(const char *pkgid)
1222 {
1223         int ret = 0;
1224         char *storeclientid = 0;
1225         pkgmgrinfo_pkginfo_h handle;
1226         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1227         if (ret != PMINFO_R_OK)
1228                 return -1;
1229         ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1230         if (ret != PMINFO_R_OK) {
1231                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1232                 return -1;
1233         }
1234         printf(store client id: %s\n", storeclientid);
1235         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1236         return 0;
1237 }
1238  * @endcode
1239  */
1240 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1241
1242 /**
1243  * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1244  * @brief       This API gets the main app id of package from the package ID
1245  *
1246  * @par         This API is for package-manager client application
1247  * @par Sync (or) Async : Synchronous API
1248  *
1249  * @param[in]   handle  pointer to package info handle
1250  * @param[out] mainappid                pointer to hold main app id of package
1251  * @return      0 if success, error code(<0) if fail
1252  * @retval      PMINFO_R_OK     success
1253  * @retval      PMINFO_R_EINVAL invalid argument
1254  * @retval      PMINFO_R_ERROR  internal error
1255  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1256  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1257  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1258  * @see         pkgmgrinfo_pkginfo_is_removable()
1259  * @code
1260 static int get_pkg_mainappid(const char *pkgid)
1261 {
1262         int ret = 0;
1263         char *mainappid = 0;
1264         pkgmgrinfo_pkginfo_h handle;
1265         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1266         if (ret != PMINFO_R_OK)
1267                 return -1;
1268         ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1269         if (ret != PMINFO_R_OK) {
1270                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1271                 return -1;
1272         }
1273         printf(main app id: %s\n", mainappid);
1274         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1275         return 0;
1276 }
1277  * @endcode
1278  */
1279 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1280
1281 /**
1282  * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1283  * @brief       This API gets the url of package from the package ID
1284  *
1285  * @par         This API is for package-manager client application
1286  * @par Sync (or) Async : Synchronous API
1287  *
1288  * @param[in]   handle  pointer to package info handle
1289  * @param[out] url              pointer to hold url of package
1290  * @return      0 if success, error code(<0) if fail
1291  * @retval      PMINFO_R_OK     success
1292  * @retval      PMINFO_R_EINVAL invalid argument
1293  * @retval      PMINFO_R_ERROR  internal error
1294  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1295  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1296  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1297  * @see         pkgmgrinfo_pkginfo_is_removable()
1298  * @code
1299 static int get_pkg_url(const char *pkgid)
1300 {
1301         int ret = 0;
1302         char *url = 0;
1303         pkgmgrinfo_pkginfo_h handle;
1304         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1305         if (ret != PMINFO_R_OK)
1306                 return -1;
1307         ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1308         if (ret != PMINFO_R_OK) {
1309                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1310                 return -1;
1311         }
1312         printf("url : %s\n", url);
1313         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1314         return 0;
1315 }
1316  * @endcode
1317  */
1318 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1319
1320
1321 /**
1322  * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1323  * @brief       This API gets the root path of package
1324  *
1325  * @par Sync (or) Async : Synchronous API
1326  *
1327  * @param[in] handle            pointer to package info handle
1328  * @param[out] path             pointer to hold root path of package
1329  * @return      0 if success, error code(<0) if fail
1330  * @retval      PMINFO_R_OK     success
1331  * @retval      PMINFO_R_EINVAL invalid argument
1332  * @retval      PMINFO_R_ERROR  internal error
1333  * @code
1334 static int get_root_path(const char *pkgid)
1335 {
1336         int ret = 0;
1337         char *path = 0;
1338         pkgmgrinfo_pkginfo_h handle;
1339         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1340         if (ret != PMINFO_R_OK)
1341                 return -1;
1342
1343         ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1344         if (ret != PMINFO_R_OK) {
1345                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1346                 return -1;
1347         }
1348         printf("path : %s\n", path);
1349         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1350
1351         return 0;
1352 }
1353  * @endcode
1354  */
1355 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1356
1357
1358 /**
1359  * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1360  * @brief       This API gets the csc path of package
1361  *
1362  * @par Sync (or) Async : Synchronous API
1363  *
1364  * @param[in] handle            pointer to package info handle
1365  * @param[out] path             pointer to hold csc path of package
1366  * @return      0 if success, error code(<0) if fail
1367  * @retval      PMINFO_R_OK     success
1368  * @retval      PMINFO_R_EINVAL invalid argument
1369  * @retval      PMINFO_R_ERROR  internal error
1370  * @code
1371 static int get_csc_path(const char *pkgid)
1372 {
1373         int ret = 0;
1374         char *path = 0;
1375         pkgmgrinfo_pkginfo_h handle;
1376         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1377         if (ret != PMINFO_R_OK)
1378                 return -1;
1379
1380         ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1381         if (ret != PMINFO_R_OK) {
1382                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1383                 return -1;
1384         }
1385         printf("path : %s\n", path);
1386         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1387
1388         return 0;
1389 }
1390  * @endcode
1391  */
1392 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1393
1394 /**
1395  * @fn int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1396  * @brief       This API compare the cert information from given package id
1397  *
1398  * @par         This API is for package-manager client application
1399  * @par Sync (or) Async : Synchronous API
1400  *
1401  * @param[in]   lhs_package_id  pointer to first package ID
1402  * @param[in]   rhs_package_id  pointer to second package ID
1403  * @param[out] compare_result           pointer to the compare result.
1404  * @return      0 if success, error code(<0) if fail
1405  * @retval      PMINFO_R_OK     success
1406  * @retval      PMINFO_R_EINVAL invalid argument
1407  * @retval      PMINFO_R_ERROR  internal error
1408  * @pre         None
1409  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1410  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1411  * @see         pkgmgrinfo_pkginfo_is_removable()
1412  * @code
1413 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1414 {
1415         int ret = 0;
1416         pkgmgrinfo_cert_compare_result_type_e result;
1417
1418         ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1419         if (ret != PMINFO_R_OK) {
1420                 return -1;
1421         }
1422         printf("result: %d\n", result);
1423         return 0;
1424 }
1425  * @endcode
1426  */
1427 int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1428 int pkgmgrinfo_pkginfo_compare_usr_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1429 /**
1430  * @fn int pkgmgrinfo_pkginfo_compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1431  * @brief       This API compare the cert information from given app id
1432  *
1433  * @par         This API is for package-manager client application
1434  * @par Sync (or) Async : Synchronous API
1435  *
1436  * @param[in]   lhs_app_id      pointer to first app ID
1437  * @param[in]   rhs_app_id      pointer to second app ID
1438  * @param[out] compare_result           pointer to the compare result.
1439  * @return      0 if success, error code(<0) if fail
1440  * @retval      PMINFO_R_OK     success
1441  * @retval      PMINFO_R_EINVAL invalid argument
1442  * @retval      PMINFO_R_ERROR  internal error
1443  * @pre         None
1444  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1445  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1446  * @see         pkgmgrinfo_pkginfo_is_removable()
1447  * @code
1448 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1449 {
1450         int ret = 0;
1451         pkgmgrinfo_cert_compare_result_type_e result;
1452
1453         ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1454         if (ret != PMINFO_R_OK) {
1455                 return -1;
1456         }
1457         printf("result: %d\n", result);
1458         return 0;
1459 }
1460  * @endcode
1461  */
1462 int pkgmgrinfo_pkginfo_compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1463 int pkgmgrinfo_pkginfo_compare_usr_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1464 /**
1465  * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1466  * @brief       This API gets the package 'removable' value from the package ID
1467  *
1468  * @par         This API is for package-manager client application
1469  * @par Sync (or) Async : Synchronous API
1470  *
1471  * @param[in]   handle  pointer to package info handle
1472  * @param[out] removable                pointer to hold package removable value
1473  * @return      0 if success, error code(<0) if fail
1474  * @retval      PMINFO_R_OK     success
1475  * @retval      PMINFO_R_EINVAL invalid argument
1476  * @retval      PMINFO_R_ERROR  internal error
1477  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1478  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1479  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1480  * @see         pkgmgrinfo_pkginfo_is_readonly()
1481  * @code
1482 static int get_pkg_removable(const char *pkgid)
1483 {
1484         int ret = 0;
1485         bool removable;
1486         pkgmgrinfo_pkginfo_h handle;
1487         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1488         if (ret != PMINFO_R_OK)
1489                 return -1;
1490         ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1491         if (ret != PMINFO_R_OK) {
1492                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1493                 return -1;
1494         }
1495         printf("pkg removable: %d\n", removable);
1496         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1497         return 0;
1498 }
1499  * @endcode
1500  */
1501 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1502
1503 /**
1504  * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1505  * @brief       This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1506  *
1507  * @par         This API is for package-manager client application
1508  * @par Sync (or) Async : Synchronous API
1509  *
1510  * @param[in]   handle  pointer to package info handle
1511  * @param[out] movable          pointer to hold package movable state
1512  * @return      0 if success, error code(<0) if fail
1513  * @retval      PMINFO_R_OK     success
1514  * @retval      PMINFO_R_EINVAL invalid argument
1515  * @retval      PMINFO_R_ERROR  internal error
1516  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1517  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1518  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1519  * @code
1520 static int get_pkg_movable(const char *pkgid)
1521 {
1522         int ret = 0;
1523         bool movable;
1524         pkgmgrinfo_pkginfo_h handle;
1525         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1526         if (ret != PMINFO_R_OK)
1527                 return -1;
1528         ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1529         if (ret != PMINFO_R_OK) {
1530                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1531                 return -1;
1532         }
1533         printf("pkg movable: %d\n", movable);
1534         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1535         return 0;
1536 }
1537  * @endcode
1538  */
1539 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1540
1541 /**
1542  * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1543  * @brief       This API gets the package 'preload' value from the package ID
1544  *
1545  * @par         This API is for package-manager client application
1546  * @par Sync (or) Async : Synchronous API
1547  *
1548  * @param[in]   handle  pointer to package info handle
1549  * @param[out] preload          pointer to hold package preload value
1550  * @return      0 if success, error code(<0) if fail
1551  * @retval      PMINFO_R_OK     success
1552  * @retval      PMINFO_R_EINVAL invalid argument
1553  * @retval      PMINFO_R_ERROR  internal error
1554  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1555  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1556  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1557  * @see         pkgmgrinfo_pkginfo_is_readonly()
1558  * @code
1559 static int get_pkg_preload(const char *pkgid)
1560 {
1561         int ret = 0;
1562         bool preload;
1563         pkgmgrinfo_pkginfo_h handle;
1564         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1565         if (ret != PMINFO_R_OK)
1566                 return -1;
1567         ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1568         if (ret != PMINFO_R_OK) {
1569                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1570                 return -1;
1571         }
1572         printf("pkg preload: %d\n", preload);
1573         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1574         return 0;
1575 }
1576  * @endcode
1577  */
1578 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1579
1580 /**
1581  * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1582  * @brief       This API gets the value for given handle is system or not
1583  *
1584  * @par         This API is for package-manager client application
1585  * @par Sync (or) Async : Synchronous API
1586  *
1587  * @param[in]   handle  pointer to package info handle
1588  * @param[out] system           pointer to hold  system is or not
1589  * @return      0 if success, error code(<0) if fail
1590  * @retval      PMINFO_R_OK     success
1591  * @retval      PMINFO_R_EINVAL invalid argument
1592  * @retval      PMINFO_R_ERROR  internal error
1593  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1594  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1595  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1596  * @see         pkgmgrinfo_pkginfo_is_readonly()
1597  * @code
1598 static int get_pkg_system(const char *pkgid)
1599 {
1600         int ret = 0;
1601         bool system = false;
1602         pkgmgrinfo_pkginfo_h handle = NULL;
1603         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1604         if (ret != PMINFO_R_OK)
1605                 return -1;
1606         ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1607         if (ret != PMINFO_R_OK) {
1608                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1609                 return -1;
1610         }
1611         printf("pkg system: %d\n", system);
1612         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1613         return 0;
1614 }
1615  * @endcode
1616  */
1617 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1618
1619 /**
1620  * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1621  * @brief       This API gets the package 'readonly' value from the package ID
1622  *
1623  * @par         This API is for package-manager client application
1624  * @par Sync (or) Async : Synchronous API
1625  *
1626  * @param[in]   handle  pointer to package info handle
1627  * @param[out] readonly pointer to hold package readonly value
1628  * @return      0 if success, error code(<0) if fail
1629  * @retval      PMINFO_R_OK     success
1630  * @retval      PMINFO_R_EINVAL invalid argument
1631  * @retval      PMINFO_R_ERROR  internal error
1632  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1633  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1634  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1635  * @see         pkgmgrinfo_pkginfo_is_removable()
1636  * @code
1637 static int get_pkg_readonly(const char *pkgid)
1638 {
1639         int ret = 0;
1640         bool readonly;
1641         pkgmgrinfo_pkginfo_h handle;
1642         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1643         if (ret != PMINFO_R_OK)
1644                 return -1;
1645         ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1646         if (ret != PMINFO_R_OK) {
1647                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1648                 return -1;
1649         }
1650         printf("pkg readonly: %d\n", readonly);
1651         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1652         return 0;
1653 }
1654  * @endcode
1655  */
1656 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1657
1658
1659 /**
1660  * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1661  * @brief       This API gets the package 'upate' value from the package ID
1662  *
1663  * @par         This API is for package-manager client application
1664  * @par Sync (or) Async : Synchronous API
1665  *
1666  * @param[in]   handle  pointer to package info handle
1667  * @param[out] update   pointer to hold package update value
1668  * @return      0 if success, error code(<0) if fail
1669  * @retval      PMINFO_R_OK     success
1670  * @retval      PMINFO_R_EINVAL invalid argument
1671  * @retval      PMINFO_R_ERROR  internal error
1672  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1673  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1674  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1675  * @code
1676 static int get_pkg_update(const char *pkgid)
1677 {
1678         int ret = 0;
1679         bool update;
1680         pkgmgrinfo_pkginfo_h handle;
1681         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1682         if (ret != PMINFO_R_OK)
1683                 return -1;
1684         ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1685         if (ret != PMINFO_R_OK) {
1686                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1687                 return -1;
1688         }
1689         printf("pkg update: %d\n", update);
1690         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1691         return 0;
1692 }
1693  * @endcode
1694  */
1695 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1696
1697
1698 /**
1699  * @fn int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid)
1700  * @brief       This API gets the package 'uid' value from the view table of user database
1701  *
1702  * @par         This API is for package-manager client application
1703  * @par Sync (or) Async : Synchronous API
1704  *
1705  * @param[in]   uid     uid of the user to determine the database
1706  * @param[in]   pkgid   id of the current package
1707  * @return      1 if it a global package, 0 else
1708  */
1709
1710 int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid);
1711
1712
1713 /**
1714  * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1715  * @brief       This API gets the package 'accessible' value from the package ID
1716  *
1717  * @par         This API is for package-manager client application
1718  * @par Sync (or) Async : Synchronous API
1719  *
1720  * @param[in]   handle  pointer to package info handle
1721  * @param[out] accessible       pointer to hold package accessible value
1722  * @return      0 if success, error code(<0) if fail
1723  * @retval      PMINFO_R_OK     success
1724  * @retval      PMINFO_R_EINVAL invalid argument
1725  * @retval      PMINFO_R_ERROR  internal error
1726  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1727  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1728  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1729  * @see         pkgmgrinfo_pkginfo_is_readonly()
1730  * @code
1731 static int get_pkg_accessible(const char *pkgid)
1732 {
1733         int ret = 0;
1734         bool accessible;
1735         pkgmgrinfo_pkginfo_h handle;
1736         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1737         if (ret != PMINFO_R_OK)
1738                 return -1;
1739         ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1740         if (ret != PMINFO_R_OK) {
1741                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1742                 return -1;
1743         }
1744         printf("pkg accessible: %d\n", accessible);
1745         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1746         return 0;
1747 }
1748  * @endcode
1749  */
1750 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1751
1752 /**
1753  * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1754  * @brief       This API destroys the package information handle freeing up all the resources
1755  *
1756  * @par         This API is for package-manager client application
1757  * @par Sync (or) Async : Synchronous API
1758  *
1759  * @param[in]   handle  pointer to the package info handle
1760  * @return      0 if success, error code(<0) if fail
1761  * @retval      PMINFO_R_OK     success
1762  * @retval      PMINFO_R_EINVAL invalid argument
1763  * @retval      PMINFO_R_ERROR  internal error
1764  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1765  * @post                None
1766  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1767  * @see         pkgmgrinfo_pkginfo_is_removable()
1768  * @code
1769 static int get_pkg_type(const char *pkgid)
1770 {
1771         int ret = 0;
1772         char *type = NULL;
1773         pkgmgrinfo_pkginfo_h handle;
1774         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1775         if (ret != PMINFO_R_OK)
1776                 return -1;
1777         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1778         if (ret != PMINFO_R_OK) {
1779                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1780                 return -1;
1781         }
1782         printf("pkgtype: %s\n", type);
1783         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1784         return 0;
1785 }
1786  * @endcode
1787  */
1788 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1789
1790 /**
1791  * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1792  * @brief       This API creates the package information filter handle from db.  All filter properties will be ANDed.
1793  The query will search the entire package information collected from the manifest file of all the installed packages
1794  *
1795  * @par         This API is for package-manager client application
1796  * @par Sync (or) Async : Synchronous API
1797  *
1798  * @param[out] handle           pointer to the package info filter handle.
1799  * @return      0 if success, error code(<0) if fail
1800  * @retval      PMINFO_R_OK     success
1801  * @retval      PMINFO_R_EINVAL invalid argument
1802  * @retval      PMINFO_R_ERROR  internal error
1803  * @pre         None
1804  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1805  * @see         pkgmgrinfo_pkginfo_filter_count()
1806  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1807  * @code
1808 static int get_rpm_pkg_count()
1809 {
1810         int ret = 0;
1811         int count = 0;
1812         pkgmgrinfo_pkginfo_filter_h handle;
1813         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1814         if (ret != PMINFO_R_OK)
1815                 return -1;
1816         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1817         if (ret != PMINFO_R_OK) {
1818                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1819                 return -1;
1820         }
1821         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1822         if (ret != PMINFO_R_OK) {
1823                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1824                 return -1;
1825         }
1826         printf("No of rpm pkgs: %d\n", count);
1827         pkgmgrinfo_pkginfo_filter_destroy(handle);
1828         return 0;
1829 }
1830  * @endcode
1831  */
1832 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1833
1834 /**
1835  * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1836  * @brief       This API destroys the package information filter handle freeing up all the resources
1837  *
1838  * @par         This API is for package-manager client application
1839  * @par Sync (or) Async : Synchronous API
1840  *
1841  * @param[in] handle            pointer to the package info filter handle.
1842  * @return      0 if success, error code(<0) if fail
1843  * @retval      PMINFO_R_OK     success
1844  * @retval      PMINFO_R_EINVAL invalid argument
1845  * @retval      PMINFO_R_ERROR  internal error
1846  * @pre         pkgmgrinfo_pkginfo_filter_create()
1847  * @post                None
1848  * @see         pkgmgrinfo_pkginfo_filter_count()
1849  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1850  * @code
1851 static int get_rpm_pkg_count()
1852 {
1853         int ret = 0;
1854         int count = 0;
1855         pkgmgrinfo_pkginfo_filter_h handle;
1856         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1857         if (ret != PMINFO_R_OK)
1858                 return -1;
1859         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1860         if (ret != PMINFO_R_OK) {
1861                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1862                 return -1;
1863         }
1864         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1865         if (ret != PMINFO_R_OK) {
1866                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1867                 return -1;
1868         }
1869         printf("No of rpm pkgs: %d\n", count);
1870         pkgmgrinfo_pkginfo_filter_destroy(handle);
1871         return 0;
1872 }
1873  * @endcode
1874  */
1875 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1876
1877 /**
1878  * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1879  * @brief       This API adds a boolean filter property to the filter handle
1880  *
1881  * @par         This API is for package-manager client application
1882  * @par Sync (or) Async : Synchronous API
1883  *
1884  * @param[in] handle            pointer to the package info filter handle.
1885  * @param[in] property          boolean property name.
1886  * @param[in] value             value corresponding to the property.
1887  * @return      0 if success, error code(<0) if fail
1888  * @retval      PMINFO_R_OK     success
1889  * @retval      PMINFO_R_EINVAL invalid argument
1890  * @retval      PMINFO_R_ERROR  internal error
1891  * @pre         pkgmgrinfo_pkginfo_filter_create()
1892  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1893  * @see         pkgmgrinfo_pkginfo_filter_count()
1894  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1895  * @code
1896 static int get_preload_pkg_count()
1897 {
1898         int ret = 0;
1899         int count = 0;
1900         pkgmgrinfo_pkginfo_filter_h handle;
1901         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1902         if (ret != PMINFO_R_OK)
1903                 return -1;
1904         ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1905         if (ret != PMINFO_R_OK) {
1906                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1907                 return -1;
1908         }
1909         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1910         if (ret != PMINFO_R_OK) {
1911                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1912                 return -1;
1913         }
1914         printf("No of preload pkgs: %d\n", count);
1915         pkgmgrinfo_pkginfo_filter_destroy(handle);
1916         return 0;
1917 }
1918  * @endcode
1919  */
1920 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1921                 const char *property, const bool value);
1922
1923 /**
1924  * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1925  * @brief       This API adds an integer filter property to the filter handle
1926  *
1927  * @par         This API is for package-manager client application
1928  * @par Sync (or) Async : Synchronous API
1929  *
1930  * @param[in] handle            pointer to the package info filter handle.
1931  * @param[in] property          integer property name.
1932  * @param[in] value             value corresponding to the property.
1933  * @return      0 if success, error code(<0) if fail
1934  * @retval      PMINFO_R_OK     success
1935  * @retval      PMINFO_R_EINVAL invalid argument
1936  * @retval      PMINFO_R_ERROR  internal error
1937  * @pre         pkgmgrinfo_pkginfo_filter_create()
1938  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1939  * @see         pkgmgrinfo_pkginfo_filter_count()
1940  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1941  * @code
1942 static int get_pkg_count()
1943 {
1944         int ret = 0;
1945         int count = 0;
1946         pkgmgrinfo_pkginfo_filter_h handle;
1947         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1948         if (ret != PMINFO_R_OK)
1949                 return -1;
1950         ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1951         if (ret != PMINFO_R_OK) {
1952                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1953                 return -1;
1954         }
1955         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1956         if (ret != PMINFO_R_OK) {
1957                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1958                 return -1;
1959         }
1960         printf("No of preload pkgs: %d\n", count);
1961         pkgmgrinfo_pkginfo_filter_destroy(handle);
1962         return 0;
1963 }
1964  * @endcode
1965  */
1966 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1967                 const char *property, const int value);
1968
1969 /**
1970  * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1971  * @brief       This API adds a string filter property to the filter handle
1972  *
1973  * @par         This API is for package-manager client application
1974  * @par Sync (or) Async : Synchronous API
1975  *
1976  * @param[in] handle            pointer to the package info filter handle.
1977  * @param[in] property          string property name.
1978  * @param[in] value             value corresponding to the property.
1979  * @return      0 if success, error code(<0) if fail
1980  * @retval      PMINFO_R_OK     success
1981  * @retval      PMINFO_R_EINVAL invalid argument
1982  * @retval      PMINFO_R_ERROR  internal error
1983  * @pre         pkgmgrinfo_pkginfo_filter_create()
1984  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1985  * @see         pkgmgrinfo_pkginfo_filter_count()
1986  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1987  * @code
1988 static int get_rpm_pkg_count()
1989 {
1990         int ret = 0;
1991         int count = 0;
1992         pkgmgrinfo_pkginfo_filter_h handle;
1993         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1994         if (ret != PMINFO_R_OK)
1995                 return -1;
1996         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1997         if (ret != PMINFO_R_OK) {
1998                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1999                 return -1;
2000         }
2001         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2002         if (ret != PMINFO_R_OK) {
2003                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2004                 return -1;
2005         }
2006         printf("No of rpm pkgs: %d\n", count);
2007         pkgmgrinfo_pkginfo_filter_destroy(handle);
2008         return 0;
2009 }
2010  * @endcode
2011  */
2012 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2013                 const char *property, const char *value);
2014
2015 /**
2016  * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2017  * @brief       This API executes the user supplied callback function for each package that satisfy the filter conditions
2018  *
2019  * @par         This API is for package-manager client application
2020  * @par Sync (or) Async : Synchronous API
2021  *
2022  * @param[in] handle            pointer to the package info filter handle.
2023  * @param[in] pkg_cb            callback function.
2024  * @param[in] user_data         user data to be passed to the callback function
2025  * @return      0 if success, error code(<0) if fail
2026  * @retval      PMINFO_R_OK     success
2027  * @retval      PMINFO_R_EINVAL invalid argument
2028  * @retval      PMINFO_R_ERROR  internal error
2029  * @pre         pkgmgrinfo_pkginfo_filter_create()
2030  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2031  * @see         pkgmgrinfo_pkginfo_filter_count()
2032  * @code
2033 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2034 {
2035         char *pkgid = NULL;
2036         pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2037         printf("pkg id : %s\n", pkgid);
2038         return 0;
2039 }
2040
2041 static int get_rpm_pkg_list()
2042 {
2043         int ret = 0;
2044         pkgmgrinfo_pkginfo_filter_h handle;
2045         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2046         if (ret != PMINFO_R_OK)
2047                 return -1;
2048         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
2049         if (ret != PMINFO_R_OK) {
2050                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2051                 return -1;
2052         }
2053         ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2054         if (ret != PMINFO_R_OK) {
2055                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2056                 return -1;
2057         }
2058         pkgmgrinfo_pkginfo_filter_destroy(handle);
2059         return 0;
2060 }
2061  * @endcode
2062  */
2063 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2064                 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2065 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2066                 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2067
2068 /**
2069  * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2070  * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2071  * @brief       This API counts the package that satisfy the filter conditions
2072  *
2073  * @par         This API is for package-manager client application
2074  * @par Sync (or) Async : Synchronous API
2075  *
2076  * @param[in] handle            pointer to the package info filter handle.
2077  * @param[in] count             pointer to store the count value.
2078  * @param[in]   uid     the addressee user id of the instruction
2079  * @return      0 if success, error code(<0) if fail
2080  * @retval      PMINFO_R_OK     success
2081  * @retval      PMINFO_R_EINVAL invalid argument
2082  * @retval      PMINFO_R_ERROR  internal error
2083  * @pre         pkgmgrinfo_pkginfo_filter_create()
2084  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2085  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2086  * @code
2087 static int get_rpm_pkg_count()
2088 {
2089         int ret = 0;
2090         int count = 0;
2091         pkgmgrinfo_pkginfo_filter_h handle;
2092         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2093         if (ret != PMINFO_R_OK)
2094                 return -1;
2095         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
2096         if (ret != PMINFO_R_OK) {
2097                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2098                 return -1;
2099         }
2100         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2101         if (ret != PMINFO_R_OK) {
2102                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2103                 return -1;
2104         }
2105         printf("No of rpm pkgs: %d\n", count);
2106         pkgmgrinfo_pkginfo_filter_destroy(handle);
2107         return 0;
2108 }
2109  * @endcode
2110  */
2111 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2112 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2113 /**
2114  * @fn  int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2115                         pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2116  * @brief       This API gets the list of privilege for a particular package
2117  *
2118  * @par         This API is for package-manager client application
2119  * @par Sync (or) Async : Synchronous API
2120  * @param[in]   handle          pointer to the package info handle.
2121  * @param[in]   privilege_func          callback function for list
2122  * @param[in] user_data user data to be passed to callback function
2123  * @return      0 if success, error code(<0) if fail
2124  * @retval      PMINFO_R_OK     success
2125  * @retval      PMINFO_R_EINVAL invalid argument
2126  * @retval      PMINFO_R_ERROR  internal error
2127  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2128  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2129  * @code
2130 int privilege_func(const char *name, void *user_data)
2131 {
2132         if (strcmp(name, (char *)user_data) == 0)
2133                 return -1;
2134         else
2135                 return 0;
2136 }
2137
2138 static int list_privilege(const char *package, char *privilege)
2139 {
2140         int ret = 0;
2141         pkgmgrinfo_pkginfo_h handle;
2142         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2143         if (ret != PMINFO_R_OK)
2144                 return -1;
2145         ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2146         if (ret != PMINFO_R_OK) {
2147                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2148                 return -1;
2149         }
2150         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2151         return 0;
2152 }
2153  * @endcode
2154  */
2155 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2156                         pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2157
2158 /* TODO: add doxygen comment here */
2159 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
2160 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
2161 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2162 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
2163 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
2164 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
2165 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
2166
2167 /**
2168  * @fn  int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2169  pkgmgrinfo_app_list_cb app_func, void *user_data)
2170  * @brief       This API gets list of installed applications for a particular package
2171  *
2172  * @par         This API is for package-manager client application
2173  * @par Sync (or) Async : Synchronous API
2174  * @param[in]   handle          package info handle
2175  * @param[in]   component       application component
2176  * @param[in]   app_func                iteration function for list
2177  * @param[in] user_data user data to be passed to callback function
2178  * @return      0 if success, error code(<0) if fail
2179  * @retval      PMINFO_R_OK     success
2180  * @retval      PMINFO_R_EINVAL invalid argument
2181  * @retval      PMINFO_R_ERROR  internal error
2182  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2183  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2184  * @code
2185 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2186 {
2187         char *appid = NULL;
2188         pkgmgrinfo_appinfo_get_appid(handle, &appid);
2189         printf("appid : %s\n", appid);
2190         return 0;
2191 }
2192
2193 static int list_apps(const char *pkgid)
2194 {
2195         int ret = 0;
2196         pkgmgrinfo_pkginfo_h handle;
2197         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2198         if (ret != PMINFO_R_OK)
2199                 return -1;
2200         ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2201         if (ret != PMINFO_R_OK) {
2202                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2203                 return -1;
2204         }
2205         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2206         return 0;
2207 }
2208  * @endcode
2209  */
2210 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2211                                                         pkgmgrinfo_app_list_cb app_func, void *user_data);
2212 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2213                                                         pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2214 /**
2215  * @fn  int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2216  * @brief       This API gets list of installed applications from all packages with  minimum informaion.
2217  *
2218  * @par         This API is for package-manager client application
2219  * @par Sync (or) Async : Synchronous API
2220  * @param[in]   app_func                iteration function for list
2221  * @param[in] user_data user data to be passed to callback function
2222  * @return      0 if success, error code(<0) if fail
2223  * @retval      PMINFO_R_OK     success
2224  * @retval      PMINFO_R_EINVAL invalid argument
2225  * @retval      PMINFO_R_ERROR  internal error
2226  * @pre         None
2227  * @post                None
2228  * @code
2229 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2230 {
2231         char *pkgid1 = NULL;
2232         char *pkgid2 = NULL;
2233         pkgid1 = (char *)user_data;
2234         pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2235         if (strcmp(pkgid1, pkgid2) == 0) {
2236                 return -1;
2237         } else {
2238                 return 0;
2239         }
2240 }
2241
2242 static int list_apps()
2243 {
2244         int ret = 0;
2245         char *name = "helloworld";
2246         ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2247         if (ret != PMINFO_R_OK) {
2248                 return -1;
2249         }
2250         return 0;
2251 }
2252  * @endcode
2253  */
2254 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2255 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2256 /**
2257  * @fn  int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2258  * @brief       This API gets list of installed applications from all packages.
2259  *
2260  * @par         This API is for package-manager client application
2261  * @par Sync (or) Async : Synchronous API
2262  * @param[in]   app_func                iteration function for list
2263  * @param[in] user_data user data to be passed to callback function
2264  * @return      0 if success, error code(<0) if fail
2265  * @retval      PMINFO_R_OK     success
2266  * @retval      PMINFO_R_EINVAL invalid argument
2267  * @retval      PMINFO_R_ERROR  internal error
2268  * @pre         None
2269  * @post                None
2270  * @code
2271 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2272 {
2273         char *pkgid1 = NULL;
2274         char *pkgid2 = NULL;
2275         pkgid1 = (char *)user_data;
2276         pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2277         if (strcmp(pkgid1, pkgid2) == 0) {
2278                 return -1;
2279         } else {
2280                 return 0;
2281         }
2282 }
2283
2284 static int list_apps()
2285 {
2286         int ret = 0;
2287         char *name = "helloworld";
2288         ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2289         if (ret != PMINFO_R_OK) {
2290                 return -1;
2291         }
2292         return 0;
2293 }
2294  * @endcode
2295  */
2296 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2297 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2298
2299 /**
2300  * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2301  * @brief       This API creates the application information handle from db
2302  *
2303  * @par         This API is for package-manager client application
2304  * @par Sync (or) Async : Synchronous API
2305  *
2306  * @param[in]   appid   pointer to appid
2307  * @param[out] handle           pointer to the application info handle.
2308  * @return      0 if success, error code(<0) if fail
2309  * @retval      PMINFO_R_OK     success
2310  * @retval      PMINFO_R_EINVAL invalid argument
2311  * @retval      PMINFO_R_ERROR  internal error
2312  * @pre         None
2313  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2314  * @see         pkgmgrinfo_appinfo_get_pkgid()
2315  * @see         pkgmgrinfo_appinfo_is_multiple()
2316  * @code
2317 static int get_app_type(const char *appid)
2318 {
2319         int ret = 0;
2320         char *type = NULL;
2321         pkgmgrinfo_appinfo_h handle;
2322         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2323         if (ret != PMINFO_R_OK)
2324                 return -1;
2325         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2326         if (ret != PMINFO_R_OK) {
2327                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2328                 return -1;
2329         }
2330         printf("apptype: %s\n", type);
2331         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2332         return 0;
2333 }
2334  * @endcode
2335  */
2336 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2337 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2338 /**
2339  * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2340  * @brief       This API gets the application ID
2341  *
2342  * @par         This API is for package-manager client application
2343  * @par Sync (or) Async : Synchronous API
2344  *
2345  * @param[in] handle            pointer to the application info handle.
2346  * @param[out] appid            pointer to hold appid
2347  * @return      0 if success, error code(<0) if fail
2348  * @retval      PMINFO_R_OK     success
2349  * @retval      PMINFO_R_EINVAL invalid argument
2350  * @retval      PMINFO_R_ERROR  internal error
2351  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2352  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2353  * @see         pkgmgrinfo_appinfo_get_pkgid()
2354  * @see         pkgmgrinfo_appinfo_is_multiple()
2355  * @code
2356 static int get_app_id(const char *appid)
2357 {
2358         int ret = 0;
2359         char *app_id = NULL;
2360         pkgmgrinfo_appinfo_h handle;
2361         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2362         if (ret != PMINFO_R_OK)
2363                 return -1;
2364         ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2365         if (ret != PMINFO_R_OK) {
2366                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2367                 return -1;
2368         }
2369         printf("app id: %s\n", app_id);
2370         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2371         return 0;
2372 }
2373  * @endcode
2374  */
2375 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h  handle, char **appid);
2376
2377 /**
2378  * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2379  * @brief       This API gets the package name of the application
2380  *
2381  * @par         This API is for package-manager client application
2382  * @par Sync (or) Async : Synchronous API
2383  *
2384  * @param[in] handle            pointer to the application info handle.
2385  * @param[out] pkg_name         pointer to hold package name
2386  * @return      0 if success, error code(<0) if fail
2387  * @retval      PMINFO_R_OK     success
2388  * @retval      PMINFO_R_EINVAL invalid argument
2389  * @retval      PMINFO_R_ERROR  internal error
2390  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2391  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2392  * @see         pkgmgrinfo_appinfo_get_appid()
2393  * @see         pkgmgrinfo_appinfo_is_multiple()
2394  * @code
2395 static int get_app_pkgname(const char *appid)
2396 {
2397         int ret = 0;
2398         char *pkgname = NULL;
2399         pkgmgrinfo_appinfo_h handle;
2400         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2401         if (ret != PMINFO_R_OK)
2402                 return -1;
2403         ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2404         if (ret != PMINFO_R_OK) {
2405                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2406                 return -1;
2407         }
2408         printf("pkg name: %s\n", pkgname);
2409         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2410         return 0;
2411 }
2412  * @endcode
2413  */
2414 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h  handle, char **pkg_name);
2415
2416 /**
2417  * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2418  * @brief       This API gets the package id of the application
2419  *
2420  * @par         This API is for package-manager client application
2421  * @par Sync (or) Async : Synchronous API
2422  *
2423  * @param[in] handle            pointer to the application info handle.
2424  * @param[out] pkgid            pointer to hold package id
2425  * @return      0 if success, error code(<0) if fail
2426  * @retval      PMINFO_R_OK     success
2427  * @retval      PMINFO_R_EINVAL invalid argument
2428  * @retval      PMINFO_R_ERROR  internal error
2429  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2430  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2431  * @see         pkgmgrinfo_appinfo_get_appid()
2432  * @see         pkgmgrinfo_appinfo_is_multiple()
2433  * @code
2434 static int get_app_pkgid(const char *appid)
2435 {
2436         int ret = 0;
2437         char *pkgid = NULL;
2438         pkgmgrinfo_appinfo_h handle;
2439         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2440         if (ret != PMINFO_R_OK)
2441                 return -1;
2442         ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2443         if (ret != PMINFO_R_OK) {
2444                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2445                 return -1;
2446         }
2447         printf("pkg id: %s\n", pkgid);
2448         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2449         return 0;
2450 }
2451  * @endcode
2452  */
2453 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h  handle, char **pkgid);
2454
2455 /**
2456  * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2457  * @brief       This API gets the executable name of the application
2458  *
2459  * @par         This API is for package-manager client application
2460  * @par Sync (or) Async : Synchronous API
2461  *
2462  * @param[in] handle            pointer to the application info handle.
2463  * @param[out] exec             pointer to hold app exec name
2464  * @return      0 if success, error code(<0) if fail
2465  * @retval      PMINFO_R_OK     success
2466  * @retval      PMINFO_R_EINVAL invalid argument
2467  * @retval      PMINFO_R_ERROR  internal error
2468  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2469  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2470  * @see         pkgmgrinfo_appinfo_get_appid()
2471  * @see         pkgmgrinfo_appinfo_is_multiple()
2472  * @code
2473 static int get_app_exec(const char *appid)
2474 {
2475         int ret = 0;
2476         char *exec = NULL;
2477         pkgmgrinfo_appinfo_h handle;
2478         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2479         if (ret != PMINFO_R_OK)
2480                 return -1;
2481         ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2482         if (ret != PMINFO_R_OK) {
2483                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2484                 return -1;
2485         }
2486         printf("exec name: %s\n", exec);
2487         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2488         return 0;
2489 }
2490  * @endcode
2491  */
2492 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h  handle, char **exec);
2493
2494 /**
2495  * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2496  * @brief       This API gets the icon name of the application
2497  *
2498  * @par         This API is for package-manager client application
2499  * @par Sync (or) Async : Synchronous API
2500  *
2501  * @param[in] handle            pointer to the application info handle.
2502  * @param[out] icon             pointer to hold app icon name
2503  * @return      0 if success, error code(<0) if fail
2504  * @retval      PMINFO_R_OK     success
2505  * @retval      PMINFO_R_EINVAL invalid argument
2506  * @retval      PMINFO_R_ERROR  internal error
2507  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2508  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2509  * @see         pkgmgrinfo_appinfo_get_appid()
2510  * @see         pkgmgrinfo_appinfo_is_multiple()
2511  * @code
2512 static int get_app_icon(const char *appid)
2513 {
2514         int ret = 0;
2515         char *icon = NULL;
2516         pkgmgrinfo_appinfo_h handle;
2517         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2518         if (ret != PMINFO_R_OK)
2519                 return -1;
2520         ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2521         if (ret != PMINFO_R_OK) {
2522                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2523                 return -1;
2524         }
2525         printf("icon name: %s\n", icon);
2526         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2527         return 0;
2528 }
2529  * @endcode
2530  */
2531 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
2532
2533 /**
2534  * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2535  * @brief       This API gets the label of the application
2536  *
2537  * @par         This API is for package-manager client application
2538  * @par Sync (or) Async : Synchronous API
2539  *
2540  * @param[in] handle            pointer to the application info handle.
2541  * @param[out] label            pointer to hold app label
2542  * @return      0 if success, error code(<0) if fail
2543  * @retval      PMINFO_R_OK     success
2544  * @retval      PMINFO_R_EINVAL invalid argument
2545  * @retval      PMINFO_R_ERROR  internal error
2546  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2547  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2548  * @see         pkgmgrinfo_appinfo_get_appid()
2549  * @see         pkgmgrinfo_appinfo_is_multiple()
2550  * @code
2551 static int get_app_label(const char *appid)
2552 {
2553         int ret = 0;
2554         char *label = NULL;
2555         pkgmgrinfo_appinfo_h handle;
2556         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2557         if (ret != PMINFO_R_OK)
2558                 return -1;
2559         ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2560         if (ret != PMINFO_R_OK) {
2561                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2562                 return -1;
2563         }
2564         printf("label : %s\n", label);
2565         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2566         return 0;
2567 }
2568  * @endcode
2569  */
2570 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h  handle, char **label);
2571
2572 /**
2573  * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2574  * @brief       This API gets exactly matched label by given appid and locale
2575  *
2576  * @par         This API is for package-manager client application
2577  * @par Sync (or) Async : Synchronous API
2578  *
2579  * @param[in]   appid   pointer to appid
2580  * @param[in]   locale  pointer to locale
2581  * @param[out] label            pointer to hold app label
2582  * @return      0 if success, error code(<0) if fail
2583  * @retval      PMINFO_R_OK     success
2584  * @retval      PMINFO_R_EINVAL invalid argument
2585  * @retval      PMINFO_R_ERROR  internal error
2586  * @code
2587 static int get_localed_label(const char *appid, const char *locale)
2588 {
2589         int ret = 0;
2590         char *label = NULL;
2591
2592         ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2593         if (ret != PMINFO_R_OK)
2594                 return -1;
2595
2596         printf("localed label: %s\n", label);
2597
2598         free(label);
2599
2600         return 0;
2601 }
2602  * @endcode
2603  */
2604 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2605 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2606
2607 /**
2608  * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2609  * @brief       This API gets the component of the application
2610  *
2611  * @par         This API is for package-manager client application
2612  * @par Sync (or) Async : Synchronous API
2613  *
2614  * @param[in] handle            pointer to the application info handle.
2615  * @param[out] component                pointer to hold app component
2616  * @return      0 if success, error code(<0) if fail
2617  * @retval      PMINFO_R_OK     success
2618  * @retval      PMINFO_R_EINVAL invalid argument
2619  * @retval      PMINFO_R_ERROR  internal error
2620  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2621  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2622  * @see         pkgmgrinfo_appinfo_get_appid()
2623  * @see         pkgmgrinfo_appinfo_is_multiple()
2624  * @code
2625 static int get_app_component(const char *appid)
2626 {
2627         int ret = 0;
2628         pkgmgrinfo_app_component component;
2629         pkgmgrinfo_appinfo_h handle;
2630         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2631         if (ret != PMINFO_R_OK)
2632                 return -1;
2633         ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2634         if (ret != PMINFO_R_OK) {
2635                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2636                 return -1;
2637         }
2638         printf("component : %s\n", component);
2639         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2640         return 0;
2641 }
2642  * @endcode
2643  */
2644 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_component *component);
2645
2646 /**
2647  * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2648  * @brief       This API gets the apptype of the application
2649  *
2650  * @par         This API is for package-manager client application
2651  * @par Sync (or) Async : Synchronous API
2652  *
2653  * @param[in] handle            pointer to the application info handle.
2654  * @param[out] app_type         pointer to hold apptype
2655  * @return      0 if success, error code(<0) if fail
2656  * @retval      PMINFO_R_OK     success
2657  * @retval      PMINFO_R_EINVAL invalid argument
2658  * @retval      PMINFO_R_ERROR  internal error
2659  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2660  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2661  * @see         pkgmgrinfo_appinfo_get_appid()
2662  * @see         pkgmgrinfo_appinfo_is_multiple()
2663  * @code
2664 static int get_app_type(const char *appid)
2665 {
2666         int ret = 0;
2667         char *apptype = NULL;
2668         pkgmgrinfo_appinfo_h handle;
2669         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2670         if (ret != PMINFO_R_OK)
2671                 return -1;
2672         ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2673         if (ret != PMINFO_R_OK) {
2674                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2675                 return -1;
2676         }
2677         printf("apptype : %s\n", apptype);
2678         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2679         return 0;
2680 }
2681  * @endcode
2682  */
2683 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h  handle, char **app_type);
2684
2685 /**
2686  * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h  handle,
2687                                                                                 int *operation_count, char ***operation)
2688  * @brief       This API gets the list of operation of the application
2689  *
2690  * @par         This API is for package-manager client application
2691  * @par Sync (or) Async : Synchronous API
2692  *
2693  * @param[in] handle            pointer to the appcontrol handle.
2694  * @param[out] operation_count          pointer to hold number of operations
2695  * @param[out] operation                pointer to hold list of operations
2696  * @return      0 if success, error code(<0) if fail
2697  * @retval      PMINFO_R_OK     success
2698  * @retval      PMINFO_R_EINVAL invalid argument
2699  * @retval      PMINFO_R_ERROR  internal error
2700  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2701  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2702  * @see         pkgmgrinfo_appinfo_get_uri()
2703  * @see         pkgmgrinfo_appinfo_get_mime()
2704  * @code
2705 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2706 {
2707         int oc = 0;
2708         int i = 0;
2709         char **operation;
2710         pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2711         for (i = 0; i < oc; i++) {
2712                 if (strcmp(operation[i], (char *)user_data) == 0)
2713                         return -1;
2714                 else
2715                         return 0;
2716         }
2717 }
2718
2719 static int check_operation(const char *appid, char *operation)
2720 {
2721         int ret = 0;
2722         pkgmgrinfo_appinfo_h handle;
2723         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2724         if (ret != PMINFO_R_OK)
2725                 return -1;
2726         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2727         if (ret != PMINFO_R_OK) {
2728                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2729                 return -1;
2730         }
2731         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2732         return 0;
2733 }
2734  * @endcode
2735  */
2736 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h  handle,
2737                                                                                 int *operation_count, char ***operation);
2738
2739 /**
2740  * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h  handle,
2741                                                                                 int *uri_count, char ***uri)
2742  * @brief       This API gets the list of uri of the application
2743  *
2744  * @par         This API is for package-manager client application
2745  * @par Sync (or) Async : Synchronous API
2746  *
2747  * @param[in] handle            pointer to the appcontrol handle.
2748  * @param[out] uri_count                pointer to hold number of uris
2749  * @param[out] uri              pointer to hold list of uris
2750  * @return      0 if success, error code(<0) if fail
2751  * @retval      PMINFO_R_OK     success
2752  * @retval      PMINFO_R_EINVAL invalid argument
2753  * @retval      PMINFO_R_ERROR  internal error
2754  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2755  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2756  * @see         pkgmgrinfo_appinfo_get_operation()
2757  * @see         pkgmgrinfo_appinfo_get_mime()
2758  * @code
2759 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2760 {
2761         int uc = 0;
2762         int i = 0;
2763         char **uri;
2764         pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2765         for (i = 0; i < uc; i++) {
2766                 if (strcmp(uri[i], (char *)user_data) == 0)
2767                         return -1;
2768                 else
2769                         return 0;
2770         }
2771 }
2772
2773 static int check_uri(const char *appid, char *uri)
2774 {
2775         int ret = 0;
2776         pkgmgrinfo_appinfo_h handle;
2777         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2778         if (ret != PMINFO_R_OK)
2779                 return -1;
2780         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2781         if (ret != PMINFO_R_OK) {
2782                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2783                 return -1;
2784         }
2785         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2786         return 0;
2787 }
2788  * @endcode
2789  */
2790 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h  handle,
2791                                                                                 int *uri_count, char ***uri);
2792
2793 /**
2794  * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h  handle,
2795                                                                                 int *mime_count, char ***mime)
2796  * @brief       This API gets the list of mime of the application
2797  *
2798  * @par         This API is for package-manager client application
2799  * @par Sync (or) Async : Synchronous API
2800  *
2801  * @param[in] handle            pointer to the appcontrol handle.
2802  * @param[out] mime_count               pointer to hold number of mimes
2803  * @param[out] mime             pointer to hold list of mimes
2804  * @return      0 if success, error code(<0) if fail
2805  * @retval      PMINFO_R_OK     success
2806  * @retval      PMINFO_R_EINVAL invalid argument
2807  * @retval      PMINFO_R_ERROR  internal error
2808  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2809  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2810  * @see         pkgmgrinfo_appinfo_get_uri()
2811  * @see         pkgmgrinfo_appinfo_get_operation()
2812  * @code
2813 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2814 {
2815         int mc = 0;
2816         int i = 0;
2817         char **mime;
2818         pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2819         for (i = 0; i < mc; i++) {
2820                 if (strcmp(mime[i], (char *)user_data) == 0)
2821                         return -1;
2822                 else
2823                         return 0;
2824         }
2825 }
2826
2827 static int check_mime(const char *appid, char *mime)
2828 {
2829         int ret = 0;
2830         pkgmgrinfo_appinfo_h handle;
2831         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2832         if (ret != PMINFO_R_OK)
2833                 return -1;
2834         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2835         if (ret != PMINFO_R_OK) {
2836                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2837                 return -1;
2838         }
2839         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2840         return 0;
2841 }
2842  * @endcode
2843  */
2844 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h  handle,
2845                                                                                 int *mime_count, char ***mime);
2846
2847 /**
2848  * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h  handle,
2849                                                                                 int *subapp_count, char ***subapp)
2850  * @brief       This API gets the list of subapp of the application
2851  *
2852  * @par         This API is for package-manager client application
2853  * @par Sync (or) Async : Synchronous API
2854  *
2855  * @param[in] handle            pointer to the appcontrol handle.
2856  * @param[out] subapp_count             pointer to hold number of subapp
2857  * @param[out] subapp           pointer to hold list of subapp
2858  * @return      0 if success, error code(<0) if fail
2859  * @retval      PMINFO_R_OK     success
2860  * @retval      PMINFO_R_EINVAL invalid argument
2861  * @retval      PMINFO_R_ERROR  internal error
2862  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2863  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2864  * @see         pkgmgrinfo_appinfo_get_uri()
2865  * @see         pkgmgrinfo_appinfo_get_operation()
2866  * @code
2867 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2868 {
2869         int sc = 0;
2870         int i = 0;
2871         char **subapp = NULL;
2872         pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2873         for (i = 0; i < sc; i++) {
2874                 if (strcmp(subapp[i], (char *)user_data) == 0)
2875                         return -1;
2876                 else
2877                         return 0;
2878         }
2879 }
2880
2881 static int check_subapp(const char *appid, char *subapp)
2882 {
2883         int ret = 0;
2884         pkgmgrinfo_appinfo_h handle = NULL;
2885         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2886         if (ret != PMINFO_R_OK)
2887                 return -1;
2888         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2889         if (ret != PMINFO_R_OK) {
2890                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2891                 return -1;
2892         }
2893         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2894         return 0;
2895 }
2896  * @endcode
2897  */
2898 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h  handle,
2899                                                 int *subapp_count, char ***subapp);
2900
2901 /**
2902  * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2903  * @brief       This API gets the notification icon of the application
2904  *
2905  * @par         This API is for package-manager client application
2906  * @par Sync (or) Async : Synchronous API
2907  *
2908  * @param[in] handle            pointer to the application info handle.
2909  * @param[out] path             pointer to hold notification icon
2910  * @return      0 if success, error code(<0) if fail
2911  * @retval      PMINFO_R_OK     success
2912  * @retval      PMINFO_R_EINVAL invalid argument
2913  * @retval      PMINFO_R_ERROR  internal error
2914  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2915  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2916  * @see         pkgmgrinfo_appinfo_get_appid()
2917  * @see         pkgmgrinfo_appinfo_is_multiple()
2918  * @code
2919 static int get_app_notification_icon(const char *appid)
2920 {
2921         int ret = 0;
2922         char *notification_icon = NULL;
2923         pkgmgrinfo_appinfo_h handle;
2924         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2925         if (ret != PMINFO_R_OK)
2926                 return -1;
2927         ret = pkgmgrinfo_appinfo_get_notification_icon(handle, &notification_icon);
2928         if (ret != PMINFO_R_OK) {
2929                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2930                 return -1;
2931         }
2932         printf("notification icon : %s\n", notification_icon);
2933         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2934         return 0;
2935 }
2936  * @endcode
2937  */
2938 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
2939
2940 /**
2941  * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2942  * @brief       This API gets the setting icon of the application
2943  *
2944  * @par         This API is for package-manager client application
2945  * @par Sync (or) Async : Synchronous API
2946  *
2947  * @param[in] handle            pointer to the application info handle.
2948  * @param[out] path             pointer to hold setting icon
2949  * @return      0 if success, error code(<0) if fail
2950  * @retval      PMINFO_R_OK     success
2951  * @retval      PMINFO_R_EINVAL invalid argument
2952  * @retval      PMINFO_R_ERROR  internal error
2953  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2954  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2955  * @see         pkgmgrinfo_appinfo_get_appid()
2956  * @see         pkgmgrinfo_appinfo_is_multiple()
2957  * @code
2958 static int get_app_setting_icon(const char *appid)
2959 {
2960         int ret = 0;
2961         char *setting_icon = NULL;
2962         pkgmgrinfo_appinfo_h handle;
2963         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2964         if (ret != PMINFO_R_OK)
2965                 return -1;
2966         ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2967         if (ret != PMINFO_R_OK) {
2968                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2969                 return -1;
2970         }
2971         printf("setting icon : %s\n", setting_icon);
2972         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2973         return 0;
2974 }
2975  * @endcode
2976  */
2977 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
2978
2979 /**
2980  * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2981  * @brief       This API gets the type of recent image on app-tray
2982  *
2983  * @par         This API is for package-manager client application
2984  * @par Sync (or) Async : Synchronous API
2985  *
2986  * @param[in] handle            pointer to the application info handle.
2987  * @param[out] type             pointer to hold image type
2988  * @return      0 if success, error code(<0) if fail
2989  * @retval      PMINFO_R_OK     success
2990  * @retval      PMINFO_R_EINVAL invalid argument
2991  * @retval      PMINFO_R_ERROR  internal error
2992  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2993  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2994  * @see         pkgmgrinfo_appinfo_get_appid()
2995  * @see         pkgmgrinfo_appinfo_is_multiple()
2996  * @code
2997 static int get_app_recent_image_type(const char *appid)
2998 {
2999         int ret = 0;
3000         pkgmgrinfo_app_recentimage type;
3001         pkgmgrinfo_appinfo_h handle;
3002         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3003         if (ret != PMINFO_R_OK)
3004                 return -1;
3005         ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3006         if (ret != PMINFO_R_OK) {
3007                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3008                 return -1;
3009         }
3010         printf("recent image type: %d\n", type);
3011         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3012         return 0;
3013 }
3014  * @endcode
3015  */
3016 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_recentimage *type);
3017
3018
3019 /**
3020  * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h  handle, char **preview_img)
3021  * @brief       This API gets the preview image of application
3022  *
3023  * @par Sync (or) Async : Synchronous API
3024  *
3025  * @param[in] handle            pointer to the application info handle.
3026  * @param[out] preview_img              pointer to hold preview image path
3027  * @return      0 if success, error code(<0) if fail
3028  * @retval      PMINFO_R_OK     success
3029  * @retval      PMINFO_R_EINVAL invalid argument
3030  * @retval      PMINFO_R_ERROR  internal error
3031  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3032  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3033  * @see         pkgmgrinfo_appinfo_get_appid()
3034  * @code
3035 static int get_app_previewimage(const char *appid)
3036 {
3037         int ret = 0;
3038         char *preview = NULL;
3039         pkgmgrinfo_appinfo_h handle = NULL;
3040         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3041         if (ret != PMINFO_R_OK)
3042                 return -1;
3043         ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3044         if (ret != PMINFO_R_OK) {
3045                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3046                 return -1;
3047         }
3048         printf("preview image path : %s\n", preview);
3049         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3050         return 0;
3051 }
3052  * @endcode
3053  */
3054 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h  handle, char **preview_img);
3055
3056
3057 /**
3058  * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3059  * @brief       This API gets the package permission type of the application
3060  *
3061  * @par         This API is for package-manager client application
3062  * @par Sync (or) Async : Synchronous API
3063  *
3064  * @param[in] handle            pointer to the application info handle.
3065  * @param[out] permission               pointer to hold package permission
3066  * @return      0 if success, error code(<0) if fail
3067  * @retval      PMINFO_R_OK     success
3068  * @retval      PMINFO_R_EINVAL invalid argument
3069  * @retval      PMINFO_R_ERROR  internal error
3070  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3071  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3072  * @see         pkgmgrinfo_appinfo_get_appid()
3073  * @code
3074 static int get_app_permission(const char *appid)
3075 {
3076         int ret = 0;
3077         pkgmgrinfo_permission_type permission = 0;
3078         pkgmgrinfo_appinfo_h handle;
3079
3080         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3081         if (ret != PMINFO_R_OK)
3082                 return -1;
3083         ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3084         if (ret != PMINFO_R_OK) {
3085                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3086                 return -1;
3087         }
3088         printf("permission type: %d\n", permission);
3089         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3090         return 0;
3091 }
3092  * @endcode
3093  */
3094 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3095
3096 /**
3097  * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3098  * @brief       This API gets the component_type
3099  *
3100  * @par         This API is for package-manager client application
3101  * @par Sync (or) Async : Synchronous API
3102  *
3103  * @param[in] handle            pointer to the application info handle.
3104  * @param[out] component_type           pointer to hold component_type
3105  * @return      0 if success, error code(<0) if fail
3106  * @retval      PMINFO_R_OK     success
3107  * @retval      PMINFO_R_EINVAL invalid argument
3108  * @retval      PMINFO_R_ERROR  internal error
3109  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3110  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3111  * @see         pkgmgrinfo_appinfo_get_pkgid()
3112  * @see         pkgmgrinfo_appinfo_is_multiple()
3113  * @code
3114 static int get_component_type(const char *appid)
3115 {
3116         int ret = 0;
3117         char *component_type = NULL;
3118         pkgmgrinfo_appinfo_h handle;
3119         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3120         if (ret != PMINFO_R_OK)
3121                 return -1;
3122         ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3123         if (ret != PMINFO_R_OK) {
3124                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3125                 return -1;
3126         }
3127         printf("component_type: %s\n", component_type);
3128         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3129         return 0;
3130 }
3131  * @endcode
3132  */
3133 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h  handle, char **component_type);
3134
3135 /**
3136  * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3137  * @brief       This API gets the application 'hwacceleration' value from the app ID
3138  *
3139  * @par         This API is for package-manager client application
3140  * @par Sync (or) Async : Synchronous API
3141  *
3142  * @param[in]   handle  pointer to application info handle
3143  * @param[out] hwacceleration           pointer to hold package hwacceleration value
3144  * @return      0 if success, error code(<0) if fail
3145  * @retval      PMINFO_R_OK     success
3146  * @retval      PMINFO_R_EINVAL invalid argument
3147  * @retval      PMINFO_R_ERROR  internal error
3148  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3149  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3150  * @see         pkgmgrinfo_appinfo_get_appid()
3151  * @see         pkgmgrinfo_appinfo_is_multiple()
3152  * @code
3153 static int get_app_hwacceleration(const char *appid)
3154 {
3155         int ret = 0;
3156         pkgmgrinfo_app_hwacceleration hwacceleration;
3157         pkgmgrinfo_appinfo_h handle;
3158         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3159         if (ret != PMINFO_R_OK)
3160                 return -1;
3161         ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3162         if (ret != PMINFO_R_OK) {
3163                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3164                 return -1;
3165         }
3166         printf("app hwacceleration: %d\n", hwacceleration);
3167         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3168         return 0;
3169 }
3170  * @endcode
3171  */
3172 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3173
3174 /**
3175  * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_screenreader *screenreader)
3176  * @brief       This API gets the application 'screenreader' value from the app ID
3177  *
3178  * @par         This API is for package-manager client application
3179  * @par Sync (or) Async : Synchronous API
3180  *
3181  * @param[in]   handle  pointer to application info handle
3182  * @param[out] screenreader             pointer to hold package accessibility value
3183  * @return      0 if success, error code(<0) if fail
3184  * @retval      PMINFO_R_OK     success
3185  * @retval      PMINFO_R_EINVAL invalid argument
3186  * @retval      PMINFO_R_ERROR  internal error
3187  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3188  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3189  * @see         pkgmgrinfo_appinfo_get_appid()
3190  * @see         pkgmgrinfo_appinfo_is_multiple()
3191  * @code
3192 static int get_app_screenreader(const char *appid)
3193 {
3194         int ret = 0;
3195         pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3196         pkgmgrinfo_appinfo_h handle = NULL;
3197         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3198         if (ret != PMINFO_R_OK)
3199                 return -1;
3200         ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3201         if (ret != PMINFO_R_OK) {
3202                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3203                 return -1;
3204         }
3205         printf("app screenreader: %d\n", screenreader);
3206         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3207         return 0;
3208 }
3209  * @endcode
3210  */
3211 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_screenreader *screenreader);
3212
3213 /**
3214  * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img)
3215  * @brief       This API gets the application's landscape & portrait effect images
3216  *
3217  * @par         This API is for package-manager client application
3218  * @par Sync (or) Async : Synchronous API
3219  *
3220  * @param[in]   handle  pointer to application info handle
3221  * @param[out]  portrait_img contains portrait mode effect image
3222  * @param[out]  landscape_img contains landscape mode effect image
3223  * @return      0 if success, error code(<0) if fail
3224  * @retval      PMINFO_R_OK     success
3225  * @retval      PMINFO_R_EINVAL invalid argument
3226  * @retval      PMINFO_R_ERROR  internal error
3227  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3228  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3229  * @see         pkgmgrinfo_appinfo_get_appid()
3230  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3231  * @code
3232 static int get_app_effectimages(const char *appid)
3233 {
3234         int ret = 0;
3235         char *portraitimg = NULL;
3236         char *landscapeimg = NULL;
3237         pkgmgrinfo_appinfo_h handle;
3238         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3239         if (ret != PMINFO_R_OK)
3240                 return -1;
3241         ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3242         if (ret != PMINFO_R_OK) {
3243                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3244                 return -1;
3245         }
3246         printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3247         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3248         return 0;
3249 }
3250  * @endcode
3251  */
3252 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img);
3253
3254 /**
3255  * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3256  * @brief       This API gets the submode_mainid of the application
3257  *
3258  * @par         This API is for package-manager client application
3259  * @par Sync (or) Async : Synchronous API
3260  *
3261  * @param[in] handle            pointer to the application info handle.
3262  * @param[out] submode_mainid           pointer to hold package name
3263  * @return      0 if success, error code(<0) if fail
3264  * @retval      PMINFO_R_OK     success
3265  * @retval      PMINFO_R_EINVAL invalid argument
3266  * @retval      PMINFO_R_ERROR  internal error
3267  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3268  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3269  * @see         pkgmgrinfo_appinfo_get_appid()
3270  * @see         pkgmgrinfo_appinfo_is_multiple()
3271  * @code
3272 static int get_app_submode_mainid(const char *appid)
3273 {
3274         int ret = 0;
3275         char *submode_mainid = NULL;
3276         pkgmgrinfo_appinfo_h handle = NULL;
3277         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3278         if (ret != PMINFO_R_OK)
3279                 return -1;
3280         ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3281         if (ret != PMINFO_R_OK) {
3282                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3283                 return -1;
3284         }
3285         printf("submode_mainid: %s\n", submode_mainid);
3286         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3287         return 0;
3288 }
3289  * @endcode
3290  */
3291 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h  handle, char **submode_mainid);
3292
3293 /**
3294  * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3295  * @brief       This API gets the datacontrol info
3296  *
3297  * @par         This API is for package-manager client application
3298  * @par Sync (or) Async : Synchronous API
3299  *
3300  * @param[in] providerid                pointer to the providerid of dataconltrol.
3301  * @param[in] type                      pointer to the type of dataconltrol.
3302  * @param[out] appid                    pointer to hold appid, need to free after using
3303  * @param[out] access                   pointer to hold access, need to free after using
3304  * @return      0 if success, error code(<0) if fail
3305  * @retval      PMINFO_R_OK     success
3306  * @retval      PMINFO_R_EINVAL invalid argument
3307  * @retval      PMINFO_R_ERROR  internal error
3308  * @endcode
3309  */
3310 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3311 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3312
3313 /**
3314  * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3315  * @brief       This API gets the appid of datacontrol
3316  *
3317  * @par         This API is for package-manager client application
3318  * @par Sync (or) Async : Synchronous API
3319  *
3320  * @param[in] providerid                pointer to the providerid of dataconltrol.
3321  * @param[out] appid                    pointer to hold appid, need to free after using
3322  * @return      0 if success, error code(<0) if fail
3323  * @retval      PMINFO_R_OK     success
3324  * @retval      PMINFO_R_EINVAL invalid argument
3325  * @retval      PMINFO_R_ERROR  internal error
3326  * @endcode
3327  */
3328 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3329 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3330
3331 /**
3332  * @fn  int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3333                         pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3334  * @brief       This API gets the list of permission for a particular application
3335  *
3336  * @par         This API is for package-manager client application
3337  * @par Sync (or) Async : Synchronous API
3338  * @param[in]   handle          pointer to the application info handle.
3339  * @param[in]   permission_func         callback function for list
3340  * @param[in] user_data user data to be passed to callback function
3341  * @return      0 if success, error code(<0) if fail
3342  * @retval      PMINFO_R_OK     success
3343  * @retval      PMINFO_R_EINVAL invalid argument
3344  * @retval      PMINFO_R_ERROR  internal error
3345  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3346  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3347  * @code
3348 int permission_func(const char *name, void *user_data)
3349 {
3350         if (strcmp(name, (char *)user_data) == 0)
3351                 return -1;
3352         else
3353                 return 0;
3354 }
3355
3356 static int list_permission(const char *appid, char *permission)
3357 {
3358         int ret = 0;
3359         pkgmgrinfo_appinfo_h handle;
3360         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3361         if (ret != PMINFO_R_OK)
3362                 return -1;
3363         ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3364         if (ret != PMINFO_R_OK) {
3365                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3366                 return -1;
3367         }
3368         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3369         return 0;
3370 }
3371  * @endcode
3372  */
3373 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3374                         pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3375
3376 /**
3377  * @fn  int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3378                         pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3379  * @brief       This API gets the list of category for a particular application
3380  *
3381  * @par         This API is for package-manager client application
3382  * @par Sync (or) Async : Synchronous API
3383  * @param[in]   handle          pointer to the application info handle.
3384  * @param[in]   category_func           callback function for list
3385  * @param[in] user_data user data to be passed to callback function
3386  * @return      0 if success, error code(<0) if fail
3387  * @retval      PMINFO_R_OK     success
3388  * @retval      PMINFO_R_EINVAL invalid argument
3389  * @retval      PMINFO_R_ERROR  internal error
3390  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3391  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3392  * @code
3393 int category_func(const char *name, void *user_data)
3394 {
3395         if (strcmp(name, (char *)user_data) == 0)
3396                 return -1;
3397         else
3398                 return 0;
3399 }
3400
3401 static int list_category(const char *appid, char *category)
3402 {
3403         int ret = 0;
3404         pkgmgrinfo_appinfo_h handle;
3405         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3406         if (ret != PMINFO_R_OK)
3407                 return -1;
3408         ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3409         if (ret != PMINFO_R_OK) {
3410                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3411                 return -1;
3412         }
3413         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3414         return 0;
3415 }
3416  * @endcode
3417  */
3418 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3419                         pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3420
3421 /**
3422  * @fn  int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3423                         pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3424  * @brief       This API gets the list of metadata for a particular application
3425  *
3426  * @par         This API is for package-manager client application
3427  * @par Sync (or) Async : Synchronous API
3428  * @param[in]   handle          pointer to the application info handle.
3429  * @param[in]   metadata_func           callback function for list
3430  * @param[in] user_data user data to be passed to callback function
3431  * @return      0 if success, error code(<0) if fail
3432  * @retval      PMINFO_R_OK     success
3433  * @retval      PMINFO_R_EINVAL invalid argument
3434  * @retval      PMINFO_R_ERROR  internal error
3435  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3436  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3437  * @code
3438 int metadata_func(const char *key, const char *value, void *user_data)
3439 {
3440         if (strcmp(key, (char *)user_data) == 0) {
3441                 printf("Value is %s\n", value);
3442                 return -1;
3443         }
3444         else
3445                 return 0;
3446 }
3447
3448 static int list_metadata(const char *appid, char *key)
3449 {
3450         int ret = 0;
3451         pkgmgrinfo_appinfo_h handle;
3452         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3453         if (ret != PMINFO_R_OK)
3454                 return -1;
3455         ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3456         if (ret != PMINFO_R_OK) {
3457                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3458                 return -1;
3459         }
3460         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3461         return 0;
3462 }
3463  * @endcode
3464  */
3465 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3466                         pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3467
3468
3469 /**
3470  * @fn  int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3471                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3472  * @fn  int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3473                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3474  * @brief       This API gets the list of app-control for a particular application
3475  *
3476  * @par         This API is for package-manager client application
3477  * @par Sync (or) Async : Synchronous API
3478  * @param[in]   handle          pointer to the application info handle.
3479  * @param[in]   appcontrol_func         callback function for list
3480  * @param[in] user_data user data to be passed to callback function
3481  * @param[in]   uid     the addressee user id of the instruction
3482  * @return      0 if success, error code(<0) if fail
3483  * @retval      PMINFO_R_OK     success
3484  * @retval      PMINFO_R_EINVAL invalid argument
3485  * @retval      PMINFO_R_ERROR  internal error
3486  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3487  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3488  * @code
3489 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3490 {
3491         int oc = 0;
3492         int i = 0;
3493         char **operation;
3494         pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3495         for (i = 0; i < oc; i++) {
3496                 if (strcmp(operation[i], (char *)user_data) == 0)
3497                         return -1;
3498                 else
3499                         return 0;
3500         }
3501 }
3502
3503 static int check_operation(const char *appid, char *operation)
3504 {
3505         int ret = 0;
3506         pkgmgrinfo_appinfo_h handle;
3507         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3508         if (ret != PMINFO_R_OK)
3509                 return -1;
3510         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3511         if (ret != PMINFO_R_OK) {
3512                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3513                 return -1;
3514         }
3515         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3516         return 0;
3517 }
3518  * @endcode
3519  */
3520 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3521                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3522 int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3523                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3524
3525 /**
3526  * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3527  * @brief       This API gets the application 'nodisplay' value from the app ID
3528  *
3529  * @par         This API is for package-manager client application
3530  * @par Sync (or) Async : Synchronous API
3531  *
3532  * @param[in]   handle  pointer to application info handle
3533  * @param[out] nodisplay                pointer to hold package nodisplay value
3534  * @return      0 if success, error code(<0) if fail
3535  * @retval      PMINFO_R_OK     success
3536  * @retval      PMINFO_R_EINVAL invalid argument
3537  * @retval      PMINFO_R_ERROR  internal error
3538  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3539  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3540  * @see         pkgmgrinfo_appinfo_get_appid()
3541  * @see         pkgmgrinfo_appinfo_is_multiple()
3542  * @code
3543 static int get_app_nodisplay(const char *appid)
3544 {
3545         int ret = 0;
3546         bool nodisplay;
3547         pkgmgrinfo_appinfo_h handle;
3548         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3549         if (ret != PMINFO_R_OK)
3550                 return -1;
3551         ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3552         if (ret != PMINFO_R_OK) {
3553                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3554                 return -1;
3555         }
3556         printf("app nodisplay: %d\n", nodisplay);
3557         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3558         return 0;
3559 }
3560  * @endcode
3561  */
3562 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h  handle, bool *nodisplay);
3563
3564 /**
3565  * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3566  * @brief       This API gets the application 'multiple' value from the app ID
3567  *
3568  * @par         This API is for package-manager client application
3569  * @par Sync (or) Async : Synchronous API
3570  *
3571  * @param[in]   handle  pointer to application info handle
3572  * @param[out] multiple         pointer to hold package multiple value
3573  * @return      0 if success, error code(<0) if fail
3574  * @retval      PMINFO_R_OK     success
3575  * @retval      PMINFO_R_EINVAL invalid argument
3576  * @retval      PMINFO_R_ERROR  internal error
3577  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3578  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3579  * @see         pkgmgrinfo_appinfo_get_appid()
3580  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3581  * @code
3582 static int get_app_multiple(const char *appid)
3583 {
3584         int ret = 0;
3585         bool multiple;
3586         pkgmgrinfo_appinfo_h handle;
3587         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3588         if (ret != PMINFO_R_OK)
3589                 return -1;
3590         ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3591         if (ret != PMINFO_R_OK) {
3592                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3593                 return -1;
3594         }
3595         printf("app multiple: %d\n", multiple);
3596         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3597         return 0;
3598 }
3599  * @endcode
3600  */
3601 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h  handle, bool *multiple);
3602
3603 /**
3604  * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3605  * @brief       This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3606  *              application launching effect. If fales, indicator will be hidden during application launching effect
3607  *
3608  * @par         This API is for package-manager client application
3609  * @par Sync (or) Async : Synchronous API
3610  *
3611  * @param[in]   handle  pointer to application info handle
3612  * @param[out]  indicator_disp contains indicator display status for application launching effect
3613  * @return      0 if success, error code(<0) if fail
3614  * @retval      PMINFO_R_OK     success
3615  * @retval      PMINFO_R_EINVAL invalid argument
3616  * @retval      PMINFO_R_ERROR  internal error
3617  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3618  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3619  * @see         pkgmgrinfo_appinfo_get_appid()
3620  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3621  * @code
3622 static int get_app_indicator_display(const char *appid)
3623 {
3624         int ret = 0;
3625         bool indicator_disp;
3626         pkgmgrinfo_appinfo_h handle;
3627         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3628         if (ret != PMINFO_R_OK)
3629                 return -1;
3630         ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3631         if (ret != PMINFO_R_OK){
3632                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3633                 return -1;
3634         }
3635         printf("app indicator disp : %d\n", indicator_disp);
3636         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3637         return 0;
3638 }
3639  * @endcode
3640  */
3641 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3642
3643 /**
3644  * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3645  * @brief       This API gets the application 'taskmanage' value from the app ID
3646  *
3647  * @par         This API is for package-manager client application
3648  * @par Sync (or) Async : Synchronous API
3649  *
3650  * @param[in]   handle  pointer to application info handle
3651  * @param[out] taskmanage               pointer to hold package taskmanage value
3652  * @return      0 if success, error code(<0) if fail
3653  * @retval      PMINFO_R_OK     success
3654  * @retval      PMINFO_R_EINVAL invalid argument
3655  * @retval      PMINFO_R_ERROR  internal error
3656  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3657  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3658  * @see         pkgmgrinfo_appinfo_get_appid()
3659  * @see         pkgmgrinfo_appinfo_is_multiple()
3660  * @code
3661 static int get_app_taskmanage(const char *appid)
3662 {
3663         int ret = 0;
3664         bool taskmanage;
3665         pkgmgrinfo_appinfo_h handle;
3666         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3667         if (ret != PMINFO_R_OK)
3668                 return -1;
3669         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3670         if (ret != PMINFO_R_OK) {
3671                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3672                 return -1;
3673         }
3674         printf("app taskmanage: %d\n", taskmanage);
3675         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3676         return 0;
3677 }
3678  * @endcode
3679  */
3680 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h  handle, bool *taskmanage);
3681
3682 /**
3683  * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3684  * @brief       This API gets the application 'taskmanage' value from the app ID
3685  *
3686  * @par         This API is for package-manager client application
3687  * @par Sync (or) Async : Synchronous API
3688  *
3689  * @param[in]   handle  pointer to application info handle
3690  * @param[out] enabled          pointer to hold package enabled value
3691  * @return      0 if success, error code(<0) if fail
3692  * @retval      PMINFO_R_OK     success
3693  * @retval      PMINFO_R_EINVAL invalid argument
3694  * @retval      PMINFO_R_ERROR  internal error
3695  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3696  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3697  * @see         pkgmgrinfo_appinfo_get_appid()
3698  * @see         pkgmgrinfo_appinfo_is_multiple()
3699  * @code
3700 static int get_app_enabled(const char *appid)
3701 {
3702         int ret = 0;
3703         bool enabled;
3704         pkgmgrinfo_appinfo_h handle;
3705         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3706         if (ret != PMINFO_R_OK)
3707                 return -1;
3708         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3709         if (ret != PMINFO_R_OK) {
3710                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3711                 return -1;
3712         }
3713         printf("app enabled: %d\n", enabled);
3714         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3715         return 0;
3716 }
3717  * @endcode
3718  */
3719 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h  handle, bool *enabled);
3720
3721 /**
3722  * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3723  * @brief       This API gets the application 'onboot' value from the app ID
3724  *
3725  * @par         This API is for package-manager client application
3726  * @par Sync (or) Async : Synchronous API
3727  *
3728  * @param[in]   handle  pointer to application info handle
3729  * @param[out] onboot           pointer to hold package onboot value
3730  * @return      0 if success, error code(<0) if fail
3731  * @retval      PMINFO_R_OK     success
3732  * @retval      PMINFO_R_EINVAL invalid argument
3733  * @retval      PMINFO_R_ERROR  internal error
3734  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3735  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3736  * @see         pkgmgrinfo_appinfo_get_appid()
3737  * @see         pkgmgrinfo_appinfo_is_multiple()
3738  * @code
3739 static int get_app_onboot(const char *appid)
3740 {
3741         int ret = 0;
3742         bool onboot;
3743         pkgmgrinfo_appinfo_h handle;
3744         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3745         if (ret != PMINFO_R_OK)
3746                 return -1;
3747         ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3748         if (ret != PMINFO_R_OK) {
3749                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3750                 return -1;
3751         }
3752         printf("app onboot: %d\n", onboot);
3753         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3754         return 0;
3755 }
3756  * @endcode
3757  */
3758 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h  handle, bool *onboot);
3759
3760 /**
3761  * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3762  * @brief       This API gets the application 'autorestart' value from the app ID
3763  *
3764  * @par         This API is for package-manager client application
3765  * @par Sync (or) Async : Synchronous API
3766  *
3767  * @param[in]   handle  pointer to application info handle
3768  * @param[out] autorestart              pointer to hold package autorestart value
3769  * @return      0 if success, error code(<0) if fail
3770  * @retval      PMINFO_R_OK     success
3771  * @retval      PMINFO_R_EINVAL invalid argument
3772  * @retval      PMINFO_R_ERROR  internal error
3773  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3774  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3775  * @see         pkgmgrinfo_appinfo_get_appid()
3776  * @see         pkgmgrinfo_appinfo_is_multiple()
3777  * @code
3778 static int get_app_autorestart(const char *appid)
3779 {
3780         int ret = 0;
3781         bool autorestart;
3782         pkgmgrinfo_appinfo_h handle;
3783         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3784         if (ret != PMINFO_R_OK)
3785                 return -1;
3786         ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3787         if (ret != PMINFO_R_OK) {
3788                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3789                 return -1;
3790         }
3791         printf("app autorestart: %d\n", autorestart);
3792         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3793         return 0;
3794 }
3795  * @endcode
3796  */
3797 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h  handle, bool *autorestart);
3798
3799 /**
3800  * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp)
3801  * @brief       This API gets the value for given application is main app or not from handle
3802  *
3803  * @par         This API is for package-manager client application
3804  * @par Sync (or) Async : Synchronous API
3805  *
3806  * @param[in]   handle  pointer to application info handle
3807  * @param[out] mainapp          pointer to hold package mainapp is or not
3808  * @return      0 if success, error code(<0) if fail
3809  * @retval      PMINFO_R_OK     success
3810  * @retval      PMINFO_R_EINVAL invalid argument
3811  * @retval      PMINFO_R_ERROR  internal error
3812  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3813  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3814  * @see         pkgmgrinfo_appinfo_get_appid()
3815  * @see         pkgmgrinfo_appinfo_is_multiple()
3816  * @code
3817 static int get_app_mainapp(const char *appid)
3818 {
3819         int ret = 0;
3820         bool mainapp;
3821         pkgmgrinfo_appinfo_h handle;
3822         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3823         if (ret != PMINFO_R_OK)
3824                 return -1;
3825         ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3826         if (ret != PMINFO_R_OK) {
3827                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3828                 return -1;
3829         }
3830         printf("mainapp: %d\n", mainapp);
3831         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3832         return 0;
3833 }
3834  * @endcode
3835  */
3836 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp);
3837
3838
3839 /**
3840  * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3841  * @brief       This API gets the value for given application is preload or not from handle
3842  *
3843  * @par         This API is for package-manager client application
3844  * @par Sync (or) Async : Synchronous API
3845  *
3846  * @param[in]   handle  pointer to application info handle
3847  * @param[out] preload          pointer to hold preload is or not
3848  * @return      0 if success, error code(<0) if fail
3849  * @retval      PMINFO_R_OK     success
3850  * @retval      PMINFO_R_EINVAL invalid argument
3851  * @retval      PMINFO_R_ERROR  internal error
3852  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3853  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3854  * @see         pkgmgrinfo_appinfo_get_appid()
3855  * @see         pkgmgrinfo_appinfo_is_multiple()
3856  * @code
3857 static int get_app_preload(const char *appid)
3858 {
3859         int ret = 0;
3860         bool preload = 0;
3861         pkgmgrinfo_appinfo_h handle = NULL;
3862         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3863         if (ret != PMINFO_R_OK)
3864                 return -1;
3865         ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3866         if (ret != PMINFO_R_OK) {
3867                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3868                 return -1;
3869         }
3870         printf("preload: %d\n", preload);
3871         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3872         return 0;
3873 }
3874  * @endcode
3875  */
3876 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3877
3878 /**
3879  * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3880  * @brief       This API gets the value for given application is submode or not from handle
3881  *
3882  * @par         This API is for package-manager client application
3883  * @par Sync (or) Async : Synchronous API
3884  *
3885  * @param[in]   handle  pointer to application info handle
3886  * @param[out] submode          pointer to hold submode is or not
3887  * @return      0 if success, error code(<0) if fail
3888  * @retval      PMINFO_R_OK     success
3889  * @retval      PMINFO_R_EINVAL invalid argument
3890  * @retval      PMINFO_R_ERROR  internal error
3891  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3892  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3893  * @see         pkgmgrinfo_appinfo_get_appid()
3894  * @see         pkgmgrinfo_appinfo_is_multiple()
3895  * @code
3896 static int get_app_submode(const char *appid)
3897 {
3898         int ret = 0;
3899         bool submode = 0;
3900         pkgmgrinfo_appinfo_h handle = NULL;
3901         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3902         if (ret != PMINFO_R_OK)
3903                 return -1;
3904         ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3905         if (ret != PMINFO_R_OK) {
3906                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3907                 return -1;
3908         }
3909         printf("submode: %d\n", submode);
3910         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3911         return 0;
3912 }
3913  * @endcode
3914  */
3915 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3916
3917 /**
3918  * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
3919  * @brief       This API checks if the application has the given category
3920  *
3921  * @par         This API is for package-manager client application
3922  * @par Sync (or) Async : Synchronous API
3923  *
3924  * @param[in]   handle  pointer to the application info handle
3925  * @param[in]   category        category
3926  * @param[out] exist            value Gets whether the application has the given category
3927  * @return      0 if success, error code(<0) if fail
3928  * @retval      PMINFO_R_OK     success
3929  * @retval      PMINFO_R_EINVAL invalid argument
3930  * @retval      PMINFO_R_ERROR  internal error
3931  * @code
3932 static int is_category_exist(const char *appid, const char *category)
3933 {
3934         int ret = 0;
3935         pkgmgrinfo_appinfo_h handle;
3936         bool exist = false;
3937
3938         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3939         if (ret != PMINFO_R_OK)
3940                 return -1;
3941
3942         ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
3943         if (ret != PMINFO_R_OK) {
3944                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3945                 return -1;
3946         }
3947
3948         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3949         return 0;
3950 }
3951  * @endcode
3952  */
3953 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
3954
3955 /**
3956  * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3957  * @brief       This API destroys the application information handle freeing up all the resources
3958  *
3959  * @par         This API is for package-manager client application
3960  * @par Sync (or) Async : Synchronous API
3961  *
3962  * @param[in] handle            pointer to the application info handle.
3963  * @return      0 if success, error code(<0) if fail
3964  * @retval      PMINFO_R_OK     success
3965  * @retval      PMINFO_R_EINVAL invalid argument
3966  * @retval      PMINFO_R_ERROR  internal error
3967  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3968  * @post                None
3969  * @see         pkgmgrinfo_appinfo_get_pkgid()
3970  * @see         pkgmgrinfo_appinfo_is_multiple()
3971  * @code
3972 static int get_app_type(const char *appid)
3973 {
3974         int ret = 0;
3975         char *type = NULL;
3976         pkgmgrinfo_appinfo_h handle;
3977         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3978         if (ret != PMINFO_R_OK)
3979                 return -1;
3980         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3981         if (ret != PMINFO_R_OK) {
3982                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3983                 return -1;
3984         }
3985         printf("apptype: %s\n", type);
3986         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3987         return 0;
3988 }
3989  * @endcode
3990  */
3991 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h  handle);
3992
3993 /**
3994  * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3995  * @brief       This API creates the application information filter handle from db.  All filter properties will be ANDed.
3996  The query will search the entire application information collected from the manifest file of all the installed packages
3997  *
3998  * @par         This API is for package-manager client application
3999  * @par Sync (or) Async : Synchronous API
4000  *
4001  * @param[out] handle           pointer to the application info filter handle.
4002  * @return      0 if success, error code(<0) if fail
4003  * @retval      PMINFO_R_OK     success
4004  * @retval      PMINFO_R_EINVAL invalid argument
4005  * @retval      PMINFO_R_ERROR  internal error
4006  * @pre         None
4007  * @post                pkgmgrinfo_appinfo_filter_destroy()
4008  * @see         pkgmgrinfo_appinfo_filter_count()
4009  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4010  * @code
4011 static int get_capp_count()
4012 {
4013         int ret = 0;
4014         int count = 0;
4015         pkgmgrinfo_appinfo_filter_h handle;
4016         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4017         if (ret != PMINFO_R_OK)
4018                 return -1;
4019         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4020         if (ret != PMINFO_R_OK) {
4021                 pkgmgrinfo_appinfo_filter_destroy(handle);
4022                 return -1;
4023         }
4024         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4025         if (ret != PMINFO_R_OK) {
4026                 pkgmgrinfo_appinfo_filter_destroy(handle);
4027                 return -1;
4028         }
4029         printf("No of capp: %d\n", count);
4030         pkgmgrinfo_appinfo_filter_destroy(handle);
4031         return 0;
4032 }
4033  * @endcode
4034  */
4035 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4036
4037 /**
4038  * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4039  * @brief       This API destroys the application information filter handle freeing up all the resources
4040  *
4041  * @par         This API is for package-manager client application
4042  * @par Sync (or) Async : Synchronous API
4043  *
4044  * @param[in] handle            pointer to the application info filter handle.
4045  * @return      0 if success, error code(<0) if fail
4046  * @retval      PMINFO_R_OK     success
4047  * @retval      PMINFO_R_EINVAL invalid argument
4048  * @retval      PMINFO_R_ERROR  internal error
4049  * @pre         pkgmgrinfo_appinfo_filter_create()
4050  * @post                None
4051  * @see         pkgmgrinfo_appinfo_filter_count()
4052  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4053  * @code
4054 static int get_capp_count()
4055 {
4056         int ret = 0;
4057         int count = 0;
4058         pkgmgrinfo_appinfo_filter_h handle;
4059         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4060         if (ret != PMINFO_R_OK)
4061                 return -1;
4062         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4063         if (ret != PMINFO_R_OK) {
4064                 pkgmgrinfo_appinfo_filter_destroy(handle);
4065                 return -1;
4066         }
4067         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4068         if (ret != PMINFO_R_OK) {
4069                 pkgmgrinfo_appinfo_filter_destroy(handle);
4070                 return -1;
4071         }
4072         printf("No of capp: %d\n", count);
4073         pkgmgrinfo_appinfo_filter_destroy(handle);
4074         return 0;
4075 }
4076  * @endcode
4077  */
4078 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4079
4080 /**
4081  * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4082  * @brief       This API adds a boolean filter property to the filter handle
4083  *
4084  * @par         This API is for package-manager client application
4085  * @par Sync (or) Async : Synchronous API
4086  *
4087  * @param[in] handle            pointer to the application info filter handle.
4088  * @param[in] property          boolean property name.
4089  * @param[in] value             value corresponding to the property.
4090  * @return      0 if success, error code(<0) if fail
4091  * @retval      PMINFO_R_OK     success
4092  * @retval      PMINFO_R_EINVAL invalid argument
4093  * @retval      PMINFO_R_ERROR  internal error
4094  * @pre         pkgmgrinfo_appinfo_filter_create()
4095  * @post                pkgmgrinfo_appinfo_filter_destroy()
4096  * @see         pkgmgrinfo_appinfo_filter_count()
4097  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4098  * @code
4099 static int get_taskmanageable_app_count()
4100 {
4101         int ret = 0;
4102         int count = 0;
4103         pkgmgrinfo_appinfo_filter_h handle;
4104         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4105         if (ret != PMINFO_R_OK)
4106                 return -1;
4107         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4108         if (ret != PMINFO_R_OK) {
4109                 pkgmgrinfo_appinfo_filter_destroy(handle);
4110                 return -1;
4111         }
4112         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4113         if (ret != PMINFO_R_OK) {
4114                 pkgmgrinfo_appinfo_filter_destroy(handle);
4115                 return -1;
4116         }
4117         printf("No of taskmanageable apps: %d\n", count);
4118         pkgmgrinfo_appinfo_filter_destroy(handle);
4119         return 0;
4120 }
4121  * @endcode
4122  */
4123 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4124                 const char *property, const bool value);
4125
4126 /**
4127  * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4128  * @brief       This API adds an integer filter property to the filter handle
4129  *
4130  * @par         This API is for package-manager client application
4131  * @par Sync (or) Async : Synchronous API
4132  *
4133  * @param[in] handle            pointer to the application info filter handle.
4134  * @param[in] property          integer property name.
4135  * @param[in] value             value corresponding to the property.
4136  * @return      0 if success, error code(<0) if fail
4137  * @retval      PMINFO_R_OK     success
4138  * @retval      PMINFO_R_EINVAL invalid argument
4139  * @retval      PMINFO_R_ERROR  internal error
4140  * @pre         pkgmgrinfo_appinfo_filter_create()
4141  * @post                pkgmgrinfo_appinfo_filter_destroy()
4142  * @see         pkgmgrinfo_appinfo_filter_count()
4143  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4144  * @code
4145 static int get_taskmanageable_app_count()
4146 {
4147         int ret = 0;
4148         int count = 0;
4149         pkgmgrinfo_appinfo_filter_h handle;
4150         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4151         if (ret != PMINFO_R_OK)
4152                 return -1;
4153         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4154         if (ret != PMINFO_R_OK) {
4155                 pkgmgrinfo_appinfo_filter_destroy(handle);
4156                 return -1;
4157         }
4158         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4159         if (ret != PMINFO_R_OK) {
4160                 pkgmgrinfo_appinfo_filter_destroy(handle);
4161                 return -1;
4162         }
4163         printf("No of apps: %d\n", count);
4164         pkgmgrinfo_appinfo_filter_destroy(handle);
4165         return 0;
4166 }
4167  * @endcode
4168  */
4169 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4170                 const char *property, const int value);
4171
4172 /**
4173  * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4174  * @brief       This API adds a string filter property to the filter handle
4175  *
4176  * @par         This API is for package-manager client application
4177  * @par Sync (or) Async : Synchronous API
4178  *
4179  * @param[in] handle            pointer to the application info filter handle.
4180  * @param[in] property          string property name.
4181  * @param[in] value             value corresponding to the property.
4182  * @return      0 if success, error code(<0) if fail
4183  * @retval      PMINFO_R_OK     success
4184  * @retval      PMINFO_R_EINVAL invalid argument
4185  * @retval      PMINFO_R_ERROR  internal error
4186  * @pre         pkgmgrinfo_appinfo_filter_create()
4187  * @post                pkgmgrinfo_appinfo_filter_destroy()
4188  * @see         pkgmgrinfo_appinfo_filter_count()
4189  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4190  * @code
4191 static int get_capp_count()
4192 {
4193         int ret = 0;
4194         int count = 0;
4195         pkgmgrinfo_appinfo_filter_h handle;
4196         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4197         if (ret != PMINFO_R_OK)
4198                 return -1;
4199         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4200         if (ret != PMINFO_R_OK) {
4201                 pkgmgrinfo_appinfo_filter_destroy(handle);
4202                 return -1;
4203         }
4204         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4205         if (ret != PMINFO_R_OK) {
4206                 pkgmgrinfo_appinfo_filter_destroy(handle);
4207                 return -1;
4208         }
4209         printf("No of capp: %d\n", count);
4210         pkgmgrinfo_appinfo_filter_destroy(handle);
4211         return 0;
4212 }
4213  * @endcode
4214  */
4215 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4216                 const char *property, const char *value);
4217
4218 /**
4219  * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4220  * @brief       This API executes the user supplied callback function for each application that satisfy the filter conditions
4221  *
4222  * @par         This API is for package-manager client application
4223  * @par Sync (or) Async : Synchronous API
4224  *
4225  * @param[in] handle            pointer to the application info filter handle.
4226  * @param[in] app_cb            callback function.
4227  * @param[in] user_data         user data to be passed to the callback function
4228  * @return      0 if success, error code(<0) if fail
4229  * @retval      PMINFO_R_OK     success
4230  * @retval      PMINFO_R_EINVAL invalid argument
4231  * @retval      PMINFO_R_ERROR  internal error
4232  * @pre         pkgmgrinfo_appinfo_filter_create()
4233  * @post                pkgmgrinfo_appinfo_filter_destroy()
4234  * @see         pkgmgrinfo_appinfo_filter_count()
4235  * @code
4236 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4237 {
4238         char *appid = NULL;
4239         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4240         printf("appid : %s\n", appid);
4241         return 0;
4242 }
4243
4244 static int get_capp_list()
4245 {
4246         int ret = 0;
4247         pkgmgrinfo_appinfo_filter_h handle;
4248         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4249         if (ret != PMINFO_R_OK)
4250                 return -1;
4251         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4252         if (ret != PMINFO_R_OK) {
4253                 pkgmgrinfo_appinfo_filter_destroy(handle);
4254                 return -1;
4255         }
4256         ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4257         if (ret != PMINFO_R_OK) {
4258                 pkgmgrinfo_appinfo_filter_destroy(handle);
4259                 return -1;
4260         }
4261         pkgmgrinfo_appinfo_filter_destroy(handle);
4262         return 0;
4263 }
4264  * @endcode
4265  */
4266 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4267                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4268 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4269                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4270
4271 /**
4272  * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4273  * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4274  * @brief       This API counts the application that satisfy the filter conditions
4275  *
4276  * @par         This API is for package-manager client application
4277  * @par Sync (or) Async : Synchronous API
4278  *
4279  * @param[in] handle            pointer to the application info filter handle.
4280  * @param[in] count             pointer to store count value
4281  * @param[in]   uid     the addressee user id of the instruction
4282  * @return      0 if success, error code(<0) if fail
4283  * @retval      PMINFO_R_OK     success
4284  * @retval      PMINFO_R_EINVAL invalid argument
4285  * @retval      PMINFO_R_ERROR  internal error
4286  * @pre         pkgmgrinfo_appinfo_filter_create()
4287  * @post                pkgmgrinfo_appinfo_filter_destroy()
4288  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4289  * @code
4290 static int get_capp_count()
4291 {
4292         int ret = 0;
4293         int count = 0;
4294         pkgmgrinfo_appinfo_filter_h handle;
4295         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4296         if (ret != PMINFO_R_OK)
4297                 return -1;
4298         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4299         if (ret != PMINFO_R_OK) {
4300                 pkgmgrinfo_appinfo_filter_destroy(handle);
4301                 return -1;
4302         }
4303         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4304         if (ret != PMINFO_R_OK) {
4305                 pkgmgrinfo_appinfo_filter_destroy(handle);
4306                 return -1;
4307         }
4308         printf("No of capp: %d\n", count);
4309         pkgmgrinfo_appinfo_filter_destroy(handle);
4310         return 0;
4311 }
4312  * @endcode
4313  */
4314 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4315 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4316 /**
4317  * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4318  * @brief       This API creates the application's metadata  information filter handle from db.
4319  *
4320  * @par         This API is for package-manager client application
4321  * @par Sync (or) Async : Synchronous API
4322  *
4323  * @param[out] handle           pointer to the application metadata info filter handle.
4324  * @return      0 if success, error code(<0) if fail
4325  * @retval      PMINFO_R_OK     success
4326  * @retval      PMINFO_R_EINVAL invalid argument
4327  * @retval      PMINFO_R_ERROR  internal error
4328  * @pre         None
4329  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
4330  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
4331  * @code
4332 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4333 {
4334         char *appid = NULL;
4335         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4336         printf("appid : %s\n", appid);
4337         return 0;
4338 }
4339
4340 static int get_app_list(const char *mkey, const char *mvalue)
4341 {
4342         int ret = 0;
4343         pkgmgrinfo_appinfo_metadata_filter_h handle;
4344         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4345         if (ret != PMINFO_R_OK)
4346                 return -1;
4347         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4348         if (ret != PMINFO_R_OK) {
4349                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4350                 return -1;
4351         }
4352         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4353         if (ret != PMINFO_R_OK) {
4354                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4355                 return -1;
4356         }
4357         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4358         return 0;
4359 }
4360  * @endcode
4361  */
4362 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4363
4364 /**
4365  * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4366  * @brief       This API destroys the application's metadata  information filter handle.
4367  *
4368  * @par         This API is for package-manager client application
4369  * @par Sync (or) Async : Synchronous API
4370  *
4371  * @param[in] handle            pointer to the application metadata info filter handle.
4372  * @return      0 if success, error code(<0) if fail
4373  * @retval      PMINFO_R_OK     success
4374  * @retval      PMINFO_R_EINVAL invalid argument
4375  * @retval      PMINFO_R_ERROR  internal error
4376  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
4377  * @post                None
4378  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
4379  * @code
4380 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4381 {
4382         char *appid = NULL;
4383         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4384         printf("appid : %s\n", appid);
4385         return 0;
4386 }
4387
4388 static int get_app_list(const char *mkey, const char *mvalue)
4389 {
4390         int ret = 0;
4391         pkgmgrinfo_appinfo_metadata_filter_h handle;
4392         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4393         if (ret != PMINFO_R_OK)
4394                 return -1;
4395         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4396         if (ret != PMINFO_R_OK) {
4397                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4398                 return -1;
4399         }
4400         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4401         if (ret != PMINFO_R_OK) {
4402                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4403                 return -1;
4404         }
4405         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4406         return 0;
4407 }
4408  * @endcode
4409  */
4410 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4411
4412 /**
4413  * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4414  * @brief       This API adds filter condition for the query API.  The query will search the entire application metadata  information collected from
4415  * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4416  *
4417  * @par         This API is for package-manager client application
4418  * @par Sync (or) Async : Synchronous API
4419  *
4420  * @param[in] handle            pointer to the application metadata info filter handle.
4421  * @param[in] key                       pointer to metadata key
4422  * @param[in] value                     pointer to metadata value
4423  * @return      0 if success, error code(<0) if fail
4424  * @retval      PMINFO_R_OK     success
4425  * @retval      PMINFO_R_EINVAL invalid argument
4426  * @retval      PMINFO_R_ERROR  internal error
4427  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
4428  * @post                pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4429  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
4430  * @code
4431 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4432 {
4433         char *appid = NULL;
4434         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4435         printf("appid : %s\n", appid);
4436         return 0;
4437 }
4438
4439 static int get_app_list(const char *mkey, const char *mvalue)
4440 {
4441         int ret = 0;
4442         pkgmgrinfo_appinfo_metadata_filter_h handle;
4443         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4444         if (ret != PMINFO_R_OK)
4445                 return -1;
4446         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4447         if (ret != PMINFO_R_OK) {
4448                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4449                 return -1;
4450         }
4451         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4452         if (ret != PMINFO_R_OK) {
4453                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4454                 return -1;
4455         }
4456         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4457         return 0;
4458 }
4459  * @endcode
4460  */
4461 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4462                 const char *key, const char *value);
4463
4464 /**
4465  * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4466  * @fn int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid)
4467  * @brief       This API executes the filter query. The query will search the entire application metadata  information collected from
4468  * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4469  * negative value, no more callbacks will be called and API will return.
4470  *
4471  * @par         This API is for package-manager client application
4472  * @par Sync (or) Async : Synchronous API
4473  *
4474  * @param[in] handle            pointer to the application metadata info filter handle.
4475  * @param[in] app_cb            function pointer to callback
4476  * @param[in] user_data         pointer to user data
4477  * @param[in]   uid     the addressee user id of the instruction
4478  * @return      0 if success, error code(<0) if fail
4479  * @retval      PMINFO_R_OK     success
4480  * @retval      PMINFO_R_EINVAL invalid argument
4481  * @retval      PMINFO_R_ERROR  internal error
4482  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
4483  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
4484  * @code
4485 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4486 {
4487         char *appid = NULL;
4488         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4489         printf("appid : %s\n", appid);
4490         return 0;
4491 }
4492
4493 static int get_app_list(const char *mkey, const char *mvalue)
4494 {
4495         int ret = 0;
4496         pkgmgrinfo_appinfo_metadata_filter_h handle;
4497         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4498         if (ret != PMINFO_R_OK)
4499                 return -1;
4500         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4501         if (ret != PMINFO_R_OK) {
4502                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4503                 return -1;
4504         }
4505         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4506         if (ret != PMINFO_R_OK) {
4507                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4508                 return -1;
4509         }
4510         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4511         return 0;
4512 }
4513  * @endcode
4514  */
4515 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4516                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4517 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4518                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4519 /**
4520  * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4521  * @brief       This API creates the package cert information handle to get data from db.
4522  *
4523  * @par         This API is for package-manager client application
4524  * @par Sync (or) Async : Synchronous API
4525  *
4526  * @param[out] handle           pointer to the package cert handle.
4527  * @return      0 if success, error code(<0) if fail
4528  * @retval      PMINFO_R_OK     success
4529  * @retval      PMINFO_R_EINVAL invalid argument
4530  * @retval      PMINFO_R_ERROR  internal error
4531  * @pre         None
4532  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
4533  * @see         pkgmgrinfo_pkginfo_get_cert_value()
4534  * @see         pkgmgrinfo_pkginfo_load_certinfo()
4535  * @code
4536 static int get_cert_info(const char *pkgid)
4537 {
4538         int ret = 0;
4539         pkgmgrinfo_certinfo_h handle;
4540         char *auth_cert = NULL;
4541         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4542         if (ret != PMINFO_R_OK)
4543                 return -1;
4544         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4545         if (ret != PMINFO_R_OK) {
4546                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4547                 return -1;
4548         }
4549         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4550         if (ret != PMINFO_R_OK) {
4551                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4552                 return -1;
4553         }
4554         printf("Author root certificate: %s\n", auth_root);
4555         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4556         return 0;
4557 }
4558  * @endcode
4559  */
4560 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4561
4562 /**
4563  * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4564  * @brief       This API loads the package cert information handle with data from db.
4565  *
4566  * @par         This API is for package-manager client application
4567  * @par Sync (or) Async : Synchronous API
4568  *
4569  * @param[in] pkgid             pointer to the package ID.
4570  * @param[in] handle            pointer to the package cert handle.
4571  * @return      0 if success, error code(<0) if fail
4572  * @retval      PMINFO_R_OK     success
4573  * @retval      PMINFO_R_EINVAL invalid argument
4574  * @retval      PMINFO_R_ERROR  internal error
4575  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
4576  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
4577  * @see         pkgmgrinfo_pkginfo_get_cert_value()
4578  * @code
4579 static int get_cert_info(const char *pkgid)
4580 {
4581         int ret = 0;
4582         pkgmgrinfo_certinfo_h handle;
4583         char *auth_cert = NULL;
4584         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4585         if (ret != PMINFO_R_OK)
4586                 return -1;
4587         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4588         if (ret != PMINFO_R_OK) {
4589                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4590                 return -1;
4591         }
4592         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4593         if (ret != PMINFO_R_OK) {
4594                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4595                 return -1;
4596         }
4597         printf("Author root certificate: %s\n", auth_root);
4598         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4599         return 0;
4600 }
4601  * @endcode
4602  */
4603 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4604
4605 /**
4606  * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4607  * @brief       This API gets the package cert information from the handle
4608  *
4609  * @par         This API is for package-manager client application
4610  * @par Sync (or) Async : Synchronous API
4611  *
4612  * @param[in] handle            pointer to the package cert handle.
4613  * @param[in] cert_type         certificate type
4614  * @param[out] cert_value       pointer to hold certificate value
4615  * @return      0 if success, error code(<0) if fail
4616  * @retval      PMINFO_R_OK     success
4617  * @retval      PMINFO_R_EINVAL invalid argument
4618  * @retval      PMINFO_R_ERROR  internal error
4619  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
4620  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
4621  * @see         pkgmgrinfo_pkginfo_load_certinfo()
4622  * @code
4623 static int get_cert_info(const char *pkgid)
4624 {
4625         int ret = 0;
4626         pkgmgrinfo_certinfo_h handle;
4627         char *auth_cert = NULL;
4628         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4629         if (ret != PMINFO_R_OK)
4630                 return -1;
4631         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4632         if (ret != PMINFO_R_OK) {
4633                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4634                 return -1;
4635         }
4636         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4637         if (ret != PMINFO_R_OK) {
4638                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4639                 return -1;
4640         }
4641         printf("Author root certificate: %s\n", auth_root);
4642         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4643         return 0;
4644 }
4645  * @endcode
4646  */
4647 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4648
4649 /**
4650  * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4651  * @brief       This API destroys the package cert information handle freeing up all the resources
4652  *
4653  * @par         This API is for package-manager client application
4654  * @par Sync (or) Async : Synchronous API
4655  *
4656  * @param[in] handle            pointer to the package cert handle.
4657  * @return      0 if success, error code(<0) if fail
4658  * @retval      PMINFO_R_OK     success
4659  * @retval      PMINFO_R_EINVAL invalid argument
4660  * @retval      PMINFO_R_ERROR  internal error
4661  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
4662  * @post                None
4663  * @see         pkgmgrinfo_pkginfo_load_certinfo()
4664  * @code
4665 static int get_cert_info(const char *pkgid)
4666 {
4667         int ret = 0;
4668         pkgmgrinfo_certinfo_h handle;
4669         char *auth_cert = NULL;
4670         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4671         if (ret != PMINFO_R_OK)
4672                 return -1;
4673         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4674         if (ret != PMINFO_R_OK) {
4675                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4676                 return -1;
4677         }
4678         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4679         if (ret != PMINFO_R_OK) {
4680                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4681                 return -1;
4682         }
4683         printf("Author root certificate: %s\n", auth_root);
4684         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4685         return 0;
4686 }
4687  * @endcode
4688  */
4689 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4690
4691 /**
4692  * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4693  * @brief       This API deletes the package cert information from DB
4694  *
4695  * @par         This API is for package-manager client application
4696  * @par Sync (or) Async : Synchronous API
4697  *
4698  * @param[in] pkgid             pointer to the package ID.
4699  * @return      0 if success, error code(<0) if fail
4700  * @retval      PMINFO_R_OK     success
4701  * @retval      PMINFO_R_EINVAL invalid argument
4702  * @retval      PMINFO_R_ERROR  internal error
4703  * @pre         None
4704  * @post                None
4705  * @code
4706 static int delete_cert_info(const char *pkgid)
4707 {
4708         int ret = 0;
4709         ret = pkgmgrinfo_delete_certinfo(pkgid);
4710         if (ret != PMINFO_R_OK)
4711                 return -1;
4712         return 0;
4713 }
4714  * @endcode
4715  */
4716  int pkgmgrinfo_delete_certinfo(const char *pkgid);
4717  int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4718 /**
4719  * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4720  * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4721  * @brief       This API creates the package db information handle to set data in db.
4722  *
4723  * @par         This API is for package-manager client application
4724  * @par Sync (or) Async : Synchronous API
4725  *
4726  * @param[in] pkgid     pointer to the package ID.
4727  * @param[in]   uid     the addressee user id of the instruction
4728  * @param[out] handle           pointer to the package db info handle.
4729  * @return      0 if success, error code(<0) if fail
4730  * @retval      PMINFO_R_OK     success
4731  * @retval      PMINFO_R_EINVAL invalid argument
4732  * @retval      PMINFO_R_ERROR  internal error
4733  * @pre         None
4734  * @post                pkgmgrinfo_destroy_pkgdbinfo()
4735  * @see         pkgmgrinfo_save_pkgdbinfo()
4736  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
4737  * @code
4738 static int set_pkg_in_db(const char *pkgid)
4739 {
4740         int ret = 0;
4741         pkgmgrinfo_pkgdbinfo_h handle;
4742         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4743         if (ret != PMINFO_R_OK)
4744                 return -1;
4745         ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4746         if (ret != PMINFO_R_OK) {
4747                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4748                 return -1;
4749         }
4750         ret = pkgmgrinfo_save_pkgdbinfo(handle);
4751         if (ret != PMINFO_R_OK) {
4752                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4753                 return -1;
4754         }
4755         pkgmgrinfo_destroy_pkgdbinfo(handle);
4756         return 0;
4757 }
4758  * @endcode
4759  */
4760 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4761 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4762
4763 /**
4764  * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4765  * @brief       This API sets the package type in db handle
4766  *
4767  * @par         This API is for package-manager client application
4768  * @par Sync (or) Async : Synchronous API
4769  *
4770  * @param[in] handle    pointer to the pkgdbinfo handle.
4771  * @param[in] type              pointer to the package type.
4772  * @return      0 if success, error code(<0) if fail
4773  * @retval      PMINFO_R_OK     success
4774  * @retval      PMINFO_R_EINVAL invalid argument
4775  * @retval      PMINFO_R_ERROR  internal error
4776  * @pre         pkgmgrinfo_create_pkgdbinfo()
4777  * @post                pkgmgrinfo_destroy_pkgdbinfo()
4778  * @see         pkgmgrinfo_save_pkgdbinfo()
4779  * @see         pkgmgrinfo_set_version_to_pkgdbinfo()
4780  * @code
4781 static int set_pkg_type_in_db(const char *pkgid)
4782 {
4783         int ret = 0;
4784         pkgmgrinfo_pkgdbinfo_h handle;
4785         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4786         if (ret != PMINFO_R_OK)
4787                 return -1;
4788         ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4789         if (ret != PMINFO_R_OK) {
4790                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4791                 return -1;
4792         }
4793         ret = pkgmgrinfo_save_pkgdbinfo(handle);
4794         if (ret != PMINFO_R_OK) {
4795                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4796                 return -1;
4797         }
4798         pkgmgrinfo_destroy_pkgdbinfo(handle);
4799         return 0;
4800 }
4801  * @endcode
4802  */
4803 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4804
4805 /**
4806  * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4807  * @brief       This API sets the package version in db handle
4808  *
4809  * @par         This API is for package-manager client application
4810  * @par Sync (or) Async : Synchronous API
4811  *
4812  * @param[in] handle    pointer to the pkgdbinfo handle.
4813  * @param[in] version           pointer to the package version
4814  * @return      0 if success, error code(<0) if fail
4815  * @retval      PMINFO_R_OK     success
4816  * @retval      PMINFO_R_EINVAL invalid argument
4817  * @retval      PMINFO_R_ERROR  internal error
4818  * @pre         pkgmgrinfo_create_pkgdbinfo()
4819  * @post                pkgmgrinfo_destroy_pkgdbinfo()
4820  * @see         pkgmgrinfo_save_pkgdbinfo()
4821  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
4822  * @code
4823 static int set_pkg_version_in_db(const char *pkgid)
4824 {
4825         int ret = 0;
4826         pkgmgrinfo_pkgdbinfo_h handle;
4827         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4828         if (ret != PMINFO_R_OK)
4829                 return -1;
4830         ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4831         if (ret != PMINFO_R_OK) {
4832                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4833                 return -1;
4834         }
4835         ret = pkgmgrinfo_save_pkgdbinfo(handle);
4836         if (ret != PMINFO_R_OK) {
4837                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4838                 return -1;
4839         }
4840         pkgmgrinfo_destroy_pkgdbinfo(handle);
4841         return 0;
4842 }
4843  * @endcode
4844  */
4845 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4846
4847 /**
4848  * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4849  * @brief       This API sets the package install location in db handle
4850  *
4851  * @par         This API is for package-manager client application
4852  * @par Sync (or) Async : Synchronous API
4853  *
4854  * @param[in] handle    pointer to the pkgdbinfo handle.
4855  * @param[in] location  package install location
4856  * @return      0 if success, error code(<0) if fail
4857  * @retval      PMINFO_R_OK     success
4858  * @retval      PMINFO_R_EINVAL invalid argument
4859  * @retval      PMINFO_R_ERROR  internal error
4860  * @pre         pkgmgrinfo_create_pkgdbinfo()
4861  * @post                pkgmgrinfo_destroy_pkgdbinfo()
4862  * @see         pkgmgrinfo_save_pkgdbinfo()
4863  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
4864  * @code
4865 static int set_pkg_install_location_in_db(const char *pkgid)
4866 {
4867         int ret = 0;
4868         pkgmgrinfo_pkgdbinfo_h handle;
4869         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4870         if (ret != PMINFO_R_OK)
4871                 return -1;
4872         ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4873         if (ret != PMINFO_R_OK) {
4874                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4875                 return -1;
4876         }
4877         ret = pkgmgrinfo_save_pkgdbinfo(handle);
4878         if (ret != PMINFO_R_OK) {
4879                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4880                 return -1;
4881         }
4882         pkgmgrinfo_destroy_pkgdbinfo(handle);
4883         return 0;
4884 }
4885  * @endcode
4886  */
4887 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4888
4889 /**
4890  * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4891  * @brief       This API sets the package size in db handle
4892  *
4893  * @par         This API is for package-manager client application
4894  * @par Sync (or) Async : Synchronous API
4895  *
4896  * @param[in] handle    pointer to the pkgdbinfo handle.
4897  * @param[in] size              pointer to the package size
4898  * @return      0 if success, error code(<0) if fail
4899  * @retval      PMINFO_R_OK     success
4900  * @retval      PMINFO_R_EINVAL invalid argument
4901  * @retval      PMINFO_R_ERROR  internal error
4902  * @pre         pkgmgrinfo_create_pkgdbinfo()
4903  * @post                pkgmgrinfo_destroy_pkgdbinfo()
4904  * @see         pkgmgrinfo_save_pkgdbinfo()
4905  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
4906  * @code
4907 static int set_pkg_size_in_db(const char *pkgid)
4908 {
4909         int ret = 0;
4910         pkgmgrinfo_pkgdbinfo_h handle;
4911         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4912         if (ret != PMINFO_R_OK)
4913                 return -1;
4914         ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4915         if (ret != PMINFO_R_OK) {
4916                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4917                 return -1;
4918         }
4919         ret = pkgmgrinfo_save_pkgdbinfo(handle);
4920         if (ret != PMINFO_R_OK) {
4921                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4922                 return -1;
4923         }
4924         pkgmgrinfo_destroy_pkgdbinfo(handle);
4925         return 0;
4926 }
4927  * @endcode
4928  */
4929 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4930
4931 /**
4932  * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4933  * @brief       This API sets the package label in db handle
4934  *
4935  * @par         This API is for package-manager client application
4936  * @par Sync (or) Async : Synchronous API
4937  *
4938  * @param[in] handle    pointer to the pkgdbinfo handle.
4939  * @param[in] label             pointer to the package label
4940  * @param[in] locale    pointer to the locale
4941  * @return      0 if success, error code(<0) if fail
4942  * @retval      PMINFO_R_OK     success
4943  * @retval      PMINFO_R_EINVAL invalid argument
4944  * @retval      PMINFO_R_ERROR  internal error
4945  * @pre         pkgmgrinfo_create_pkgdbinfo()
4946  * @post                pkgmgrinfo_destroy_pkgdbinfo()
4947  * @see         pkgmgrinfo_save_pkgdbinfo()
4948  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
4949  * @code
4950 static int set_pkg_label_in_db(const char *pkgid)
4951 {
4952         int ret = 0;
4953         pkgmgrinfo_pkgdbinfo_h handle;
4954         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4955         if (ret != PMINFO_R_OK)
4956                 return -1;
4957         ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4958         if (ret != PMINFO_R_OK) {
4959                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4960                 return -1;
4961         }
4962         ret = pkgmgrinfo_save_pkgdbinfo(handle);
4963         if (ret != PMINFO_R_OK) {
4964                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4965                 return -1;
4966         }
4967         pkgmgrinfo_destroy_pkgdbinfo(handle);
4968         return 0;
4969 }
4970  * @endcode
4971  */
4972 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4973
4974 /**
4975  * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4976  * @brief       This API sets the package icon in db handle
4977  *
4978  * @par         This API is for package-manager client application
4979  * @par Sync (or) Async : Synchronous API
4980  *
4981  * @param[in] handle    pointer to the pkgdbinfo handle.
4982  * @param[in] icon              pointer to the package icon
4983  * @param[in] locale    pointer to the locale
4984  * @return      0 if success, error code(<0) if fail
4985  * @retval      PMINFO_R_OK     success
4986  * @retval      PMINFO_R_EINVAL invalid argument
4987  * @retval      PMINFO_R_ERROR  internal error
4988  * @pre         pkgmgrinfo_create_pkgdbinfo()
4989  * @post                pkgmgrinfo_destroy_pkgdbinfo()
4990  * @see         pkgmgrinfo_save_pkgdbinfo()
4991  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
4992  * @code
4993 static int set_pkg_icon_in_db(const char *pkgid)
4994 {
4995         int ret = 0;
4996         pkgmgrinfo_pkgdbinfo_h handle;
4997         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4998         if (ret != PMINFO_R_OK)
4999                 return -1;
5000         ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
5001         if (ret != PMINFO_R_OK) {
5002                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5003                 return -1;
5004         }
5005         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5006         if (ret != PMINFO_R_OK) {
5007                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5008                 return -1;
5009         }
5010         pkgmgrinfo_destroy_pkgdbinfo(handle);
5011         return 0;
5012 }
5013  * @endcode
5014  */
5015 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
5016
5017 /**
5018  * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
5019  * @brief       This API sets the package description in db handle
5020  *
5021  * @par         This API is for package-manager client application
5022  * @par Sync (or) Async : Synchronous API
5023  *
5024  * @param[in] handle    pointer to the pkgdbinfo handle.
5025  * @param[in] description               pointer to the package description
5026  * @param[in] locale    pointer to the locale
5027  * @return      0 if success, error code(<0) if fail
5028  * @retval      PMINFO_R_OK     success
5029  * @retval      PMINFO_R_EINVAL invalid argument
5030  * @retval      PMINFO_R_ERROR  internal error
5031  * @pre         pkgmgrinfo_create_pkgdbinfo()
5032  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5033  * @see         pkgmgrinfo_save_pkgdbinfo()
5034  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5035  * @code
5036 static int set_pkg_description_in_db(const char *pkgid)
5037 {
5038         int ret = 0;
5039         pkgmgrinfo_pkgdbinfo_h handle;
5040         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5041         if (ret != PMINFO_R_OK)
5042                 return -1;
5043         ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
5044         if (ret != PMINFO_R_OK) {
5045                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5046                 return -1;
5047         }
5048         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5049         if (ret != PMINFO_R_OK) {
5050                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5051                 return -1;
5052         }
5053         pkgmgrinfo_destroy_pkgdbinfo(handle);
5054         return 0;
5055 }
5056  * @endcode
5057  */
5058 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
5059
5060 /**
5061  * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5062  const char *author_email, const char *author_href, const char *locale)
5063  * @brief       This API sets the package author info in db handle
5064  *
5065  * @par         This API is for package-manager client application
5066  * @par Sync (or) Async : Synchronous API
5067  *
5068  * @param[in] handle    pointer to the pkgdbinfo handle.
5069  * @param[in] author_name               pointer to the package author name
5070  * @param[in] author_email              pointer to the package author email
5071  * @param[in] author_href               pointer to the package author href
5072  * @param[in] locale    pointer to the locale
5073  * @return      0 if success, error code(<0) if fail
5074  * @retval      PMINFO_R_OK     success
5075  * @retval      PMINFO_R_EINVAL invalid argument
5076  * @retval      PMINFO_R_ERROR  internal error
5077  * @pre         pkgmgrinfo_create_pkgdbinfo()
5078  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5079  * @see         pkgmgrinfo_save_pkgdbinfo()
5080  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5081  * @code
5082 static int set_pkg_author_in_db(const char *pkgid)
5083 {
5084         int ret = 0;
5085         pkgmgrinfo_pkgdbinfo_h handle;
5086         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5087         if (ret != PMINFO_R_OK)
5088                 return -1;
5089         ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
5090         if (ret != PMINFO_R_OK) {
5091                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5092                 return -1;
5093         }
5094         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5095         if (ret != PMINFO_R_OK) {
5096                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5097                 return -1;
5098         }
5099         pkgmgrinfo_destroy_pkgdbinfo(handle);
5100         return 0;
5101 }
5102  * @endcode
5103  */
5104 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5105                         const char *author_email, const char *author_href, const char *locale);
5106
5107 /**
5108  * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
5109  * @brief       This API sets the package 'removable' value in db handle
5110  *
5111  * @par         This API is for package-manager client application
5112  * @par Sync (or) Async : Synchronous API
5113  *
5114  * @param[in] handle    pointer to the pkgdbinfo handle.
5115  * @param[in] removable         package removable value
5116  * @return      0 if success, error code(<0) if fail
5117  * @retval      PMINFO_R_OK     success
5118  * @retval      PMINFO_R_EINVAL invalid argument
5119  * @retval      PMINFO_R_ERROR  internal error
5120  * @pre         pkgmgrinfo_create_pkgdbinfo()
5121  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5122  * @see         pkgmgrinfo_save_pkgdbinfo()
5123  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5124  * @code
5125 static int set_pkg_removable_in_db(const char *pkgid)
5126 {
5127         int ret = 0;
5128         pkgmgrinfo_pkgdbinfo_h handle;
5129         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5130         if (ret != PMINFO_R_OK)
5131                 return -1;
5132         ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
5133         if (ret != PMINFO_R_OK) {
5134                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5135                 return -1;
5136         }
5137         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5138         if (ret != PMINFO_R_OK) {
5139                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5140                 return -1;
5141         }
5142         pkgmgrinfo_destroy_pkgdbinfo(handle);
5143         return 0;
5144 }
5145  * @endcode
5146  */
5147 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
5148
5149 /**
5150  * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
5151  * @brief       This API sets the package 'preload' value in db handle
5152  *
5153  * @par         This API is for package-manager client application
5154  * @par Sync (or) Async : Synchronous API
5155  *
5156  * @param[in] handle    pointer to the pkgdbinfo handle.
5157  * @param[in] preload           package preload value
5158  * @return      0 if success, error code(<0) if fail
5159  * @retval      PMINFO_R_OK     success
5160  * @retval      PMINFO_R_EINVAL invalid argument
5161  * @retval      PMINFO_R_ERROR  internal error
5162  * @pre         pkgmgrinfo_create_pkgdbinfo()
5163  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5164  * @see         pkgmgrinfo_save_pkgdbinfo()
5165  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5166  * @code
5167 static int set_pkg_preload_in_db(const char *pkgid)
5168 {
5169         int ret = 0;
5170         pkgmgrinfo_pkgdbinfo_h handle;
5171         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5172         if (ret != PMINFO_R_OK)
5173                 return -1;
5174         ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
5175         if (ret != PMINFO_R_OK) {
5176                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5177                 return -1;
5178         }
5179         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5180         if (ret != PMINFO_R_OK) {
5181                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5182                 return -1;
5183         }
5184         pkgmgrinfo_destroy_pkgdbinfo(handle);
5185         return 0;
5186 }
5187  * @endcode
5188  */
5189 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
5190
5191 /**
5192  * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
5193  * @brief       This API sets the package 'installed_storage' value in db handle
5194  *
5195  * @par         This API is for package-manager client application
5196  * @par Sync (or) Async : Synchronous API
5197  *
5198  * @param[in] handle    pointer to the pkgdbinfo handle.
5199  * @param[in] location          installed_storage value
5200  * @return      0 if success, error code(<0) if fail
5201  * @retval      PMINFO_R_OK     success
5202  * @retval      PMINFO_R_EINVAL invalid argument
5203  * @retval      PMINFO_R_ERROR  internal error
5204  * @pre         pkgmgrinfo_create_pkgdbinfo()
5205  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5206  * @see         pkgmgrinfo_save_pkgdbinfo()
5207  * @code
5208 static int set_pkg_installed_storage_in_db(const char *pkgid)
5209 {
5210         int ret = 0;
5211         pkgmgrinfo_pkgdbinfo_h handle;
5212         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5213         if (ret != PMINFO_R_OK)
5214                 return -1;
5215         ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5216         if (ret != PMINFO_R_OK) {
5217                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5218                 return -1;
5219         }
5220         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5221         if (ret != PMINFO_R_OK) {
5222                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5223                 return -1;
5224         }
5225         pkgmgrinfo_destroy_pkgdbinfo(handle);
5226         return 0;
5227 }
5228  * @endcode
5229  */
5230 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5231
5232 /**
5233  * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5234  * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5235  * @brief       This API saves all the information from the handle to the DB.
5236  *
5237  * @par         This API is for package-manager client application
5238  * @par Sync (or) Async : Synchronous API
5239  *
5240  * @param[in] handle            pointer to the package db info handle.
5241  * @param[in]   uid     the addressee user id of the instruction
5242  * @return      0 if success, error code(<0) if fail
5243  * @retval      PMINFO_R_OK     success
5244  * @retval      PMINFO_R_EINVAL invalid argument
5245  * @retval      PMINFO_R_ERROR  internal error
5246  * @pre         pkgmgrinfo_create_pkgdbinfo()
5247  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5248  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5249  * @code
5250 static int set_pkg_in_db(const char *pkgid)
5251 {
5252         int ret = 0;
5253         pkgmgrinfo_pkgdbinfo_h handle;
5254         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5255         if (ret != PMINFO_R_OK)
5256                 return -1;
5257         ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5258         if (ret != PMINFO_R_OK) {
5259                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5260                 return -1;
5261         }
5262         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5263         if (ret != PMINFO_R_OK) {
5264                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5265                 return -1;
5266         }
5267         pkgmgrinfo_destroy_pkgdbinfo(handle);
5268         return 0;
5269 }
5270  * @endcode
5271  */
5272 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5273 int pkgmgrinfo_save_pkgusrdbinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5274 /**
5275  * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5276  * @brief       This API destroys the package db information handle freeing up all the resources
5277  *
5278  * @par         This API is for package-manager client application
5279  * @par Sync (or) Async : Synchronous API
5280  *
5281  * @param[in] handle            pointer to the package db info handle.
5282  * @return      0 if success, error code(<0) if fail
5283  * @retval      PMINFO_R_OK     success
5284  * @retval      PMINFO_R_EINVAL invalid argument
5285  * @retval      PMINFO_R_ERROR  internal error
5286  * @pre         pkgmgrinfo_create_pkgdbinfo()
5287  * @post                None
5288  * @see         pkgmgrinfo_save_pkgdbinfo()
5289  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5290  * @code
5291 static int set_pkg_in_db(const char *pkgid)
5292 {
5293         int ret = 0;
5294         pkgmgrinfo_pkgdbinfo_h handle;
5295         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5296         if (ret != PMINFO_R_OK)
5297                 return -1;
5298         ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5299         if (ret != PMINFO_R_OK) {
5300                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5301                 return -1;
5302         }
5303         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5304         if (ret != PMINFO_R_OK) {
5305                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5306                 return -1;
5307         }
5308         pkgmgrinfo_destroy_pkgdbinfo(handle);
5309         return 0;
5310 }
5311  * @endcode
5312  */
5313 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5314
5315
5316 /**
5317  * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5318  * @brief       This API creates the package cert information handle to set data in db.
5319  *
5320  * @par         This API is for package-manager client application
5321  * @par Sync (or) Async : Synchronous API
5322  *
5323  * @param[out] handle           pointer to the package cert handle.
5324  * @return      0 if success, error code(<0) if fail
5325  * @retval      PMINFO_R_OK     success
5326  * @retval      PMINFO_R_EINVAL invalid argument
5327  * @retval      PMINFO_R_ERROR  internal error
5328  * @pre         None
5329  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5330  * @see         pkgmgrinfo_set_cert_value()
5331  * @see         pkgmgrinfo_save_certinfo()
5332  * @code
5333 static int set_cert_in_db(const char *pkgid)
5334 {
5335         int ret = 0;
5336         pkgmgrinfo_instcertinfo_h handle;
5337         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5338         if (ret != PMINFO_R_OK)
5339                 return -1;
5340         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5341         if (ret != PMINFO_R_OK) {
5342                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5343                 return -1;
5344         }
5345         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5346         if (ret != PMINFO_R_OK) {
5347                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5348                 return -1;
5349         }
5350         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5351         return 0;
5352 }
5353  * @endcode
5354  */
5355 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5356
5357 /**
5358  * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5359  * @brief       This API sets the package cert information in the handle.
5360  *
5361  * @par         This API is for package-manager client application
5362  * @par Sync (or) Async : Synchronous API
5363  *
5364  * @param[in] handle            pointer to the package cert handle.
5365  * @param[in] cert_type         certificate type.
5366  * @param[in] cert_value        certificate value.
5367  * @return      0 if success, error code(<0) if fail
5368  * @retval      PMINFO_R_OK     success
5369  * @retval      PMINFO_R_EINVAL invalid argument
5370  * @retval      PMINFO_R_ERROR  internal error
5371  * @pre         pkgmgrinfo_create_certinfo_set_handle()
5372  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5373  * @see         pkgmgrinfo_save_certinfo()
5374  * @code
5375 static int set_cert_in_db(const char *pkgid)
5376 {
5377         int ret = 0;
5378         pkgmgrinfo_instcertinfo_h handle;
5379         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5380         if (ret != PMINFO_R_OK)
5381                 return -1;
5382         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5383         if (ret != PMINFO_R_OK) {
5384                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5385                 return -1;
5386         }
5387         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5388         if (ret != PMINFO_R_OK) {
5389                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5390                 return -1;
5391         }
5392         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5393         return 0;
5394 }
5395  * @endcode
5396  */
5397 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5398
5399 /**
5400  * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5401  * @brief       This API saves the package cert information in the DB.
5402  *
5403  * @par         This API is for package-manager client application
5404  * @par Sync (or) Async : Synchronous API
5405  *
5406  * @param[in] pkgid             pointer to the package ID.
5407  * @param[in] handle            pointer to the package cert handle.
5408  * @return      0 if success, error code(<0) if fail
5409  * @retval      PMINFO_R_OK     success
5410  * @retval      PMINFO_R_EINVAL invalid argument
5411  * @retval      PMINFO_R_ERROR  internal error
5412  * @pre         pkgmgrinfo_create_certinfo_set_handle()
5413  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5414  * @see         pkgmgrinfo_save_certinfo()
5415  * @code
5416 static int set_cert_in_db(const char *pkgid)
5417 {
5418         int ret = 0;
5419         pkgmgrinfo_instcertinfo_h handle;
5420         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5421         if (ret != PMINFO_R_OK)
5422                 return -1;
5423         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5424         if (ret != PMINFO_R_OK) {
5425                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5426                 return -1;
5427         }
5428         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5429         if (ret != PMINFO_R_OK) {
5430                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5431                 return -1;
5432         }
5433         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5434         return 0;
5435 }
5436  * @endcode
5437  */
5438 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5439
5440 /**
5441  * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5442  * @brief       This API destroys the package cert information handle freeing up all the resources.
5443  *
5444  * @par         This API is for package-manager client application
5445  * @par Sync (or) Async : Synchronous API
5446  *
5447  * @param[in] handle            pointer to the package cert handle.
5448  * @return      0 if success, error code(<0) if fail
5449  * @retval      PMINFO_R_OK     success
5450  * @retval      PMINFO_R_EINVAL invalid argument
5451  * @retval      PMINFO_R_ERROR  internal error
5452  * @pre         pkgmgrinfo_create_certinfo_set_handle()
5453  * @post                None
5454  * @see         pkgmgrinfo_save_certinfo()
5455  * @code
5456 static int set_cert_in_db(const char *pkgid)
5457 {
5458         int ret = 0;
5459         pkgmgrinfo_instcertinfo_h handle;
5460         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5461         if (ret != PMINFO_R_OK)
5462                 return -1;
5463         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5464         if (ret != PMINFO_R_OK) {
5465                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5466                 return -1;
5467         }
5468         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5469         if (ret != PMINFO_R_OK) {
5470                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5471                 return -1;
5472         }
5473         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5474         return 0;
5475 }
5476  * @endcode
5477  */
5478 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5479
5480 /**
5481  * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5482  * @brief       This API gets the datacontrol info
5483  *
5484  * @par         This API is for package-manager client application
5485  * @par Sync (or) Async : Synchronous API
5486  *
5487  * @param[in] providerid                pointer to the providerid of dataconltrol.
5488  * @param[in] type                      pointer to the type of dataconltrol.
5489  * @param[out] appid                    pointer to hold appid, need to free after using
5490  * @param[out] access                   pointer to hold access, need to free after using
5491  * @return      0 if success, error code(<0) if fail
5492  * @retval      PMINFO_R_OK     success
5493  * @retval      PMINFO_R_EINVAL invalid argument
5494  * @retval      PMINFO_R_ERROR  internal error
5495  * @endcode
5496  */
5497 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5498
5499 /**
5500  * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5501  * @brief       This API gets the application 'guest mode visibility' value from the DB
5502  *
5503  * @par         This API is for package-manager client application
5504  * @par Sync (or) Async : Synchronous API
5505  *
5506  * @param[in]   handle  pointer to application info handle
5507  * @param[out] status           pointer to hold app guest mode visibility value
5508  * @return      0 if success, error code(<0) if fail
5509  * @retval      PMINFO_R_OK     success
5510  * @retval      PMINFO_R_EINVAL invalid argument
5511  * @retval      PMINFO_R_ERROR  internal error
5512  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5513  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5514  * @see         pkgmgrinfo_appinfo_get_appid()
5515  * @see         pkgmgrinfo_appinfo_is_multiple()
5516  * @code
5517 static int get_app_guestmode_visibility(const char *appid)
5518 {
5519         int ret = 0;
5520         bool status;
5521         pkgmgrinfo_appinfo_h handle;
5522         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5523         if (ret != PMINFO_R_OK)
5524                 return -1;
5525         ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5526         if (ret != PMINFO_R_OK) {
5527                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5528                 return -1;
5529         }
5530         printf("app guest mode visibility: %d\n", status);
5531         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5532         return 0;
5533 }
5534  * @endcode
5535  */
5536  int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5537
5538 /**
5539  * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5540  * @brief       This API sets the application 'guest mode visibility' value in the DB
5541  *
5542  * @par         This API is for package-manager client application
5543  * @par Sync (or) Async : Synchronous API
5544  *
5545  * @param[in]   handle  pointer to application info handle
5546  * @param[out] status   app guest mode visibility value
5547  * @return      0 if success, error code(<0) if fail
5548  * @retval      PMINFO_R_OK     success
5549  * @retval      PMINFO_R_EINVAL invalid argument
5550  * @retval      PMINFO_R_ERROR  internal error
5551  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5552  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5553  * @see         pkgmgrinfo_appinfo_get_appid()
5554  * @see         pkgmgrinfo_appinfo_is_multiple()
5555  * @code
5556 static int set_app_guestmode_visibility(const char *appid, bool value)
5557 {
5558         int ret = 0;
5559         pkgmgrinfo_appinfo_h handle;
5560         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5561         if (ret != PMINFO_R_OK)
5562                 return -1;
5563         ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5564         if (ret != PMINFO_R_OK) {
5565                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5566                 return -1;
5567         }
5568         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5569         return 0;
5570 }
5571  * @endcode
5572  */
5573  int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5574  int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5575 /**
5576  * @pkgmgrinfo client API
5577 **/
5578
5579 /**
5580  * @brief listening status type in pkgmgrinfo.
5581  */
5582 #define PMINFO_CLIENT_STATUS_ALL                                                0x00
5583 #define PMINFO_CLIENT_STATUS_INSTALL                                    0x01
5584 #define PMINFO_CLIENT_STATUS_UNINSTALL                                  0x02
5585 #define PMINFO_CLIENT_STATUS_UPGRADE                                    0x04
5586 #define PMINFO_CLIENT_STATUS_MOVE                                               0x08
5587 #define PMINFO_CLIENT_STATUS_CLEAR_DATA                                 0x10
5588 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS                   0x20
5589
5590 /**
5591  * @brief type definition.
5592  */
5593 typedef void pkgmgrinfo_client;
5594 typedef int (*pkgmgrinfo_handler)(int req_id, const char *pkg_type,
5595                                 const char *pkgid, const char *key,
5596                                 const char *val, const void *pmsg, void *data);
5597
5598 typedef enum {
5599         PMINFO_REQUEST = 0,
5600         PMINFO_LISTENING,
5601         PMINFO_BROADCAST,
5602 }pkgmgrinfo_client_type;
5603
5604 /**
5605  * @brief       This APIs provides pkgmgrinfo client listener
5606  */
5607 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5608 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5609 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5610 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5611 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5612
5613
5614 int pkgmgrinfo_appinfo_get_event_launch_list(GList **es_info);
5615 int pkgmgrinfo_appinfo_get_usr_event_launch_list(GList **es_info, uid_t uid);
5616 int pkgmgrinfo_appinfo_get_event_launch_list_by_appid(const char *appid, GList **es_info);
5617 int pkgmgrinfo_appinfo_get_usr_event_launch_list_by_appid(const char *appid, GList **es_info, uid_t uid);
5618
5619
5620 /**
5621  * @pkgmgrinfo client API end
5622 **/
5623
5624
5625 /** @} */
5626 #ifdef __cplusplus
5627 }
5628 #endif
5629 #endif                          /* __PKG_INFO_H__ */
5630 /**
5631  * @}
5632  * @}
5633  */
5634