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