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