32c9d7f1520a1866d8152031252babdf99b61ca8
[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 } pkgmgrinfo_cert_compare_result_type_e;
103
104 /**
105  * @brief API return values
106  */
107 enum {
108         PMINFO_R_EINVAL = -2,           /**< Invalid argument */
109         PMINFO_R_ERROR = -1,            /**< General error */
110         PMINFO_R_OK = 0                 /**< General success */
111 };
112
113 /**
114  * @brief Value to be used when filtering based on install location
115  */
116 #define PMINFO_PKGINFO_INSTALL_LOCATION_AUTO            "LOCATION_AUTO"
117
118 /**
119  * @brief Value to be used when filtering based on install location
120  */
121 #define PMINFO_PKGINFO_INSTALL_LOCATION_INTERNAL        "LOCATION_INTERNAL"
122
123 /**
124  * @brief Value to be used when filtering based on install location
125  */
126 #define PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL        "LOCATION_EXTERNAL"
127
128 /**
129  * @brief Value to be used when filtering based on app-component
130  */
131 #define PMINFO_APPINFO_UI_APP                           "UI_APP"
132
133 /**
134  * @brief Value to be used when filtering based on app-component
135  */
136 #define PMINFO_APPINFO_SVC_APP                          "SVC_APP"
137
138 typedef enum {
139         PMINFO_HWACCELERATION_NOT_USE_GL = 0,           /**< Don't use hardware acceleration*/
140         PMINFO_HWACCELERATION_USE_GL = 1,               /**< Use hardware acceleration*/
141         PMINFO_HWACCELERATION_USE_SYSTEM_SETTING = 2            /**< Follow system setting for hardware acceleration */
142 }pkgmgrinfo_app_hwacceleration;
143
144 typedef enum {
145         PMINFO_RECENTIMAGE_USE_ICON = 0,                /**<Use icon for recent image*/
146         PMINFO_RECENTIMAGE_USE_CAPTURE = 1,             /**< Use capture for recent image*/
147         PMINFO_RECENTIMAGE_USE_NOTHING = 2              /**< Don't use recent image */
148 }pkgmgrinfo_app_recentimage;
149
150 /**
151  * @brief A handle to get package information
152  */
153 typedef void* pkgmgrinfo_pkginfo_h;
154
155 /**
156  * @brief A handle to get application information
157  */
158 typedef void* pkgmgrinfo_appinfo_h;
159
160 /**
161  * @brief A handle to get certificate information
162  */
163 typedef void* pkgmgrinfo_certinfo_h;
164
165 /**
166  * @brief A handle to insert package information
167  */
168 typedef void* pkgmgrinfo_pkgdbinfo_h;
169
170 /**
171  * @brief A handle to filter package information
172  */
173 typedef void* pkgmgrinfo_pkginfo_filter_h;
174
175 /**
176  * @brief A handle to filter application information
177  */
178 typedef void* pkgmgrinfo_appinfo_filter_h;
179
180 /**
181  * @brief A handle to get appcontrol information
182  */
183 typedef void* pkgmgrinfo_appcontrol_h;
184
185 /**
186  * @fn int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
187  *
188  * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
189  *
190  * @param[in] handle the pkginfo handle
191  * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
192  *
193  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
194  *
195  * @see  pkgmgrinfo_pkginfo_get_list()
196  * @see  pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
197  */
198 typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle,
199                                                         void *user_data);
200
201 /**
202  * @fn int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data)
203  *
204  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo()
205  *
206  * @param[in] handle the appinfo handle
207  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo()
208  *
209  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
210  *
211  * @see  pkgmgrinfo_appinfo_get_list()
212  * @see  pkgmgrinfo_appinfo_filter_foreach_appinfo()
213  */
214 typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle,
215                                                         void *user_data);
216
217 /**
218  * @fn int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data)
219  *
220  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
221  *
222  * @param[in] category_name the name of the category
223  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
224  *
225  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
226  *
227  * @see  pkgmgrinfo_appinfo_foreach_category()
228  */
229 typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name,
230                                                         void *user_data);
231
232 /**
233  * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
234  *
235  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
236  *
237  * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
238  * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
239  *
240  * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
241  *
242  * @see  pkgmgrinfo_appinfo_foreach_appcontrol()
243  */
244 typedef int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle,
245                                                         void *user_data);
246
247 /**
248  * @brief Install Location Types
249  */
250 typedef enum {
251         PMINFO_INSTALL_LOCATION_AUTO = 0,               /**< Auto*/
252         PMINFO_INSTALL_LOCATION_INTERNAL_ONLY,          /**< Internal Installation*/
253         PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL,                /**< External Installation*/
254 }pkgmgrinfo_install_location;
255
256 /**
257  * @brief Application Component Types
258  */
259 typedef enum {
260         PMINFO_ALL_APP = 0,     /**< All Application*/
261         PMINFO_UI_APP,          /**< UI Application*/
262         PMINFO_SVC_APP,         /**< Service Application*/
263 }pkgmgrinfo_app_component;
264
265 /**
266  * @brief Application Storage Types
267  */
268 typedef enum {
269         PMINFO_INTERNAL_STORAGE = 0,            /**< Internal Storage*/
270         PMINFO_EXTERNAL_STORAGE = 1,            /**< External Storage*/
271 }pkgmgrinfo_installed_storage;
272
273 /**
274  * @brief Certificate Types to be used for getting information
275  */
276 typedef enum {
277         PMINFO_AUTHOR_ROOT_CERT = 0,            /**< Author Root Certificate*/
278         PMINFO_AUTHOR_INTERMEDIATE_CERT = 1,            /**< Author Intermediate Certificate*/
279         PMINFO_AUTHOR_SIGNER_CERT = 2,          /**< Author Signer Certificate*/
280         PMINFO_DISTRIBUTOR_ROOT_CERT = 3,               /**< Distributor Root Certificate*/
281         PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4,               /**< Distributor Intermediate Certificate*/
282         PMINFO_DISTRIBUTOR_SIGNER_CERT = 5,             /**< Distributor Signer Certificate*/
283         PMINFO_DISTRIBUTOR2_ROOT_CERT = 6,              /**< End Entity Root Certificate*/
284         PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7,              /**< End Entity Intermediate Certificate*/
285         PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8,            /**< End Entity Signer Certificate*/
286 }pkgmgrinfo_cert_type;
287
288 /**
289  * @brief Install Location Types to be used when setting data in DB
290  */
291 typedef enum {
292         INSTALL_INTERNAL = 0,           /**< Internal Installation*/
293         INSTALL_EXTERNAL,               /**< External Installation*/
294 } INSTALL_LOCATION;
295
296  /** String property for filtering based on package info*/
297 #define PMINFO_PKGINFO_PROP_PACKAGE_ID          "PMINFO_PKGINFO_PROP_PACKAGE_ID"
298  /** String property for filtering based on package info*/
299 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE        "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
300  /** String property for filtering based on package info*/
301 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION     "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
302  /** String property for filtering based on package info*/
303 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION            "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
304  /** String property for filtering based on package info*/
305 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME         "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
306  /** String property for filtering based on package info*/
307 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL                "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
308  /** String property for filtering based on package info*/
309 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF         "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
310
311  /** Boolean property for filtering based on package info*/
312 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE           "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
313  /** Boolean property for filtering based on package info*/
314 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD             "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
315  /** Boolean property for filtering based on package info*/
316 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY            "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
317
318  /** Integer property for filtering based on package info*/
319 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE                "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
320
321  /** String property for filtering based on app info*/
322 #define PMINFO_APPINFO_PROP_APP_ID              "PMINFO_APPINFO_PROP_APP_ID"
323  /** String property for filtering based on app info*/
324 #define PMINFO_APPINFO_PROP_APP_COMPONENT               "PMINFO_APPINFO_PROP_APP_COMPONENT"
325  /** String property for filtering based on app info*/
326 #define PMINFO_APPINFO_PROP_APP_EXEC            "PMINFO_APPINFO_PROP_APP_EXEC"
327  /** String property for filtering based on app info*/
328 #define PMINFO_APPINFO_PROP_APP_ICON            "PMINFO_APPINFO_PROP_APP_ICON"
329  /** String property for filtering based on app info*/
330 #define PMINFO_APPINFO_PROP_APP_TYPE            "PMINFO_APPINFO_PROP_APP_TYPE"
331  /** String property for filtering based on app info*/
332 #define PMINFO_APPINFO_PROP_APP_OPERATION       "PMINFO_APPINFO_PROP_APP_OPERATION"
333  /** String property for filtering based on app info*/
334 #define PMINFO_APPINFO_PROP_APP_URI                     "PMINFO_APPINFO_PROP_APP_URI"
335  /** String property for filtering based on app info*/
336 #define PMINFO_APPINFO_PROP_APP_MIME            "PMINFO_APPINFO_PROP_APP_MIME"
337  /** String property for filtering based on app info*/
338 #define PMINFO_APPINFO_PROP_APP_CATEGORY        "PMINFO_APPINFO_PROP_APP_CATEGORY"
339  /** String property for filtering based on app info*/
340 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION  "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
341
342  /** Boolean property for filtering based on app info*/
343 #define PMINFO_APPINFO_PROP_APP_NODISPLAY               "PMINFO_APPINFO_PROP_APP_NODISPLAY"
344  /** Boolean property for filtering based on app info*/
345 #define PMINFO_APPINFO_PROP_APP_MULTIPLE                "PMINFO_APPINFO_PROP_APP_MULTIPLE"
346  /** Boolean property for filtering based on app info*/
347 #define PMINFO_APPINFO_PROP_APP_ONBOOT                  "PMINFO_APPINFO_PROP_APP_ONBOOT"
348  /** Boolean property for filtering based on app info*/
349 #define PMINFO_APPINFO_PROP_APP_AUTORESTART     "PMINFO_APPINFO_PROP_APP_AUTORESTART"
350  /** Boolean property for filtering based on app info*/
351 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE      "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
352
353 /**
354  * @fn  int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
355  * @brief       This API gets list of installed packages
356  *
357  * @par         This API is for package-manager client application
358  * @par Sync (or) Async : Synchronous API
359  * @param[in]   pkg_list_cb     iteration function for list
360  * @param[in]   user_data       user data to be passed to callback function
361  * @return      0 if success, error code(<0) if fail
362  * @retval      PMINFO_R_OK     success
363  * @retval      PMINFO_R_EINVAL invalid argument
364  * @retval      PMINFO_R_ERROR  internal error
365  * @pre         None
366  * @post        None
367  * @code
368 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
369 {
370         char *pkgid1 = NULL;
371         char *pkgid2 = NULL;
372         pkgid1 = (char *)user_data;
373         pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
374         if (strcmp(pkgid1, pkgid2) == 0) {
375                 return -1;
376         } else {
377                 return 0;
378         }
379 }
380
381 static int list_pkgs()
382 {
383         int ret = 0;
384         char *name = "helloworld";
385         ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
386         if (ret != PMINFO_R_OK) {
387                 return -1;
388         }
389         return 0;
390 }
391  * @endcode
392  */
393 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
394
395 /**
396  * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
397  * @brief       This API creates the package information handle from db
398  *
399  * @par         This API is for package-manager client application
400  * @par Sync (or) Async : Synchronous API
401  *
402  * @param[in]   pkgid   pointer to package ID
403  * @param[out] handle           pointer to the package info handle.
404  * @return      0 if success, error code(<0) if fail
405  * @retval      PMINFO_R_OK     success
406  * @retval      PMINFO_R_EINVAL invalid argument
407  * @retval      PMINFO_R_ERROR  internal error
408  * @pre         None
409  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
410  * @see         pkgmgrinfo_pkginfo_get_pkgid()
411  * @see         pkgmgrinfo_pkginfo_is_removable()
412  * @code
413 static int get_pkg_type(const char *pkgid)
414 {
415         int ret = 0;
416         char *type = NULL;
417         pkgmgrinfo_pkginfo_h handle;
418         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
419         if (ret != PMINFO_R_OK)
420                 return -1;
421         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
422         if (ret != PMINFO_R_OK) {
423                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
424                 return -1;
425         }
426         printf("pkgtype: %s\n", type);
427         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
428         return 0;
429 }
430  * @endcode
431  */
432 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
433
434 /**
435  * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
436  * @brief       This API gets the package name from the package ID
437  *
438  * @par         This API is for package-manager client application
439  * @par Sync (or) Async : Synchronous API
440  *
441  * @param[in]   handle  pointer to package info handle
442  * @param[out]  pkg_name        pointer to hold package name
443  * @return      0 if success, error code(<0) if fail
444  * @retval      PMINFO_R_OK     success
445  * @retval      PMINFO_R_EINVAL invalid argument
446  * @retval      PMINFO_R_ERROR  internal error
447  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
448  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
449  * @see         pkgmgrinfo_pkginfo_get_type()
450  * @see         pkgmgrinfo_pkginfo_is_removable()
451  * @code
452 static int get_pkg_name(const char *pkgid)
453 {
454         int ret = 0;
455         char *pkgname = NULL;
456         pkgmgrinfo_pkginfo_h handle;
457         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
458         if (ret != PMINFO_R_OK)
459                 return -1;
460         ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
461         if (ret != PMINFO_R_OK) {
462                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
463                 return -1;
464         }
465         printf("pkgname: %s\n", pkgname);
466         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
467         return 0;
468 }
469  * @endcode
470  */
471 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
472
473 /**
474  * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
475  * @brief       This API gets the package id from the package ID
476  *
477  * @par         This API is for package-manager client application
478  * @par Sync (or) Async : Synchronous API
479  *
480  * @param[in]   handle  pointer to package info handle
481  * @param[out]  pkgid   pointer to hold package id
482  * @return      0 if success, error code(<0) if fail
483  * @retval      PMINFO_R_OK     success
484  * @retval      PMINFO_R_EINVAL invalid argument
485  * @retval      PMINFO_R_ERROR  internal error
486  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
487  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
488  * @see         pkgmgrinfo_pkginfo_get_type()
489  * @see         pkgmgrinfo_pkginfo_is_removable()
490  * @code
491 static int get_pkgid(const char *pkgid)
492 {
493         int ret = 0;
494         char *pkg_id = NULL;
495         pkgmgrinfo_pkginfo_h handle;
496         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
497         if (ret != PMINFO_R_OK)
498                 return -1;
499         ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
500         if (ret != PMINFO_R_OK) {
501                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
502                 return -1;
503         }
504         printf("pkg id: %s\n", pkg_id);
505         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
506         return 0;
507 }
508  * @endcode
509  */
510 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
511
512 /**
513  * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
514  * @brief       This API gets the package type from the package ID
515  *
516  * @par         This API is for package-manager client application
517  * @par Sync (or) Async : Synchronous API
518  *
519  * @param[in]   handle  pointer to package info handle
520  * @param[out] type             pointer to hold package type
521  * @return      0 if success, error code(<0) if fail
522  * @retval      PMINFO_R_OK     success
523  * @retval      PMINFO_R_EINVAL invalid argument
524  * @retval      PMINFO_R_ERROR  internal error
525  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
526  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
527  * @see         pkgmgrinfo_pkginfo_get_pkgid()
528  * @see         pkgmgrinfo_pkginfo_is_removable()
529  * @code
530 static int get_pkg_type(const char *pkgid)
531 {
532         int ret = 0;
533         char *type = NULL;
534         pkgmgrinfo_pkginfo_h handle;
535         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
536         if (ret != PMINFO_R_OK)
537                 return -1;
538         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
539         if (ret != PMINFO_R_OK) {
540                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
541                 return -1;
542         }
543         printf("pkgtype: %s\n", type);
544         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
545         return 0;
546 }
547  * @endcode
548  */
549 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
550
551 /**
552  * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
553  * @brief       This API gets the package version from the package ID
554  *
555  * @par         This API is for package-manager client application
556  * @par Sync (or) Async : Synchronous API
557  *
558  * @param[in]   handle  pointer to package info handle
559  * @param[out] version          pointer to hold package version
560  * @return      0 if success, error code(<0) if fail
561  * @retval      PMINFO_R_OK     success
562  * @retval      PMINFO_R_EINVAL invalid argument
563  * @retval      PMINFO_R_ERROR  internal error
564  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
565  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
566  * @see         pkgmgrinfo_pkginfo_get_pkgid()
567  * @see         pkgmgrinfo_pkginfo_is_removable()
568  * @code
569 static int get_pkg_version(const char *pkgid)
570 {
571         int ret = 0;
572         char *version = NULL;
573         pkgmgrinfo_pkginfo_h handle;
574         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
575         if (ret != PMINFO_R_OK)
576                 return -1;
577         ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
578         if (ret != PMINFO_R_OK) {
579                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
580                 return -1;
581         }
582         printf("pkg version: %s\n", version);
583         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
584         return 0;
585 }
586  * @endcode
587  */
588 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
589
590 /**
591  * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
592  * @brief       This API gets the package install location from the package ID
593  *
594  * @par         This API is for package-manager client application
595  * @par Sync (or) Async : Synchronous API
596  *
597  * @param[in] handle    pointer to package info handle
598  * @param[out] location         pointer to hold package install location
599  * @return      0 if success, error code(<0) if fail
600  * @retval      PMINFO_R_OK     success
601  * @retval      PMINFO_R_EINVAL invalid argument
602  * @retval      PMINFO_R_ERROR  internal error
603  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
604  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
605  * @see         pkgmgrinfo_pkginfo_get_pkgid()
606  * @see         pkgmgrinfo_pkginfo_is_removable()
607  * @code
608 static int get_pkg_install_location(const char *pkgid)
609 {
610         int ret = 0;
611         pkgmgrinfo_install_location location;
612         pkgmgrinfo_pkginfo_h handle;
613         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
614         if (ret != PMINFO_R_OK)
615                 return -1;
616         ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
617         if (ret != PMINFO_R_OK) {
618                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
619                 return -1;
620         }
621         printf("pkg install location: %d\n", location);
622         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
623         return 0;
624 }
625  * @endcode
626  */
627 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
628
629 /**
630  * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
631  * @brief       This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
632  size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
633  the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
634  *
635  * @par         This API is for package-manager client application
636  * @par Sync (or) Async : Synchronous API
637  *
638  * @param[in]   handle  pointer to package info handle
639  * @param[out] size             pointer to hold package size
640  * @return      0 if success, error code(<0) if fail
641  * @retval      PMINFO_R_OK     success
642  * @retval      PMINFO_R_EINVAL invalid argument
643  * @retval      PMINFO_R_ERROR  internal error
644  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
645  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
646  * @see         pkgmgrinfo_pkginfo_get_pkgid()
647  * @see         pkgmgrinfo_pkginfo_is_removable()
648  * @code
649 static int get_pkg_size(const char *pkgid)
650 {
651         int ret = 0;
652         int size = 0;
653         pkgmgrinfo_pkginfo_h handle;
654         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
655         if (ret != PMINFO_R_OK)
656                 return -1;
657         ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
658         if (ret != PMINFO_R_OK) {
659                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
660                 return -1;
661         }
662         printf("pkgsize: %d\n", size);
663         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
664         return 0;
665 }
666  * @endcode
667  */
668 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
669
670 /**
671  * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
672  * @brief       This API gets the installed package total size on the target.
673  *
674  * @par         This API is for package-manager client application
675  * @par Sync (or) Async : Synchronous API
676  *
677  * @param[in]   handle  pointer to package info handle
678  * @param[out] size             pointer to hold package total size
679  * @return      0 if success, error code(<0) if fail
680  * @retval      PMINFO_R_OK     success
681  * @retval      PMINFO_R_EINVAL invalid argument
682  * @retval      PMINFO_R_ERROR  internal error
683  * @code
684 static int get_pkg_total_size(const char *pkgid)
685 {
686         int ret = 0;
687         int size = 0;
688         pkgmgrinfo_pkginfo_h handle;
689         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
690         if (ret != PMINFO_R_OK)
691                 return -1;
692         ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
693         if (ret != PMINFO_R_OK) {
694                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
695                 return -1;
696         }
697         printf("pkg total size: %d\n", size);
698         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
699         return 0;
700 }
701  * @endcode
702  */
703  int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
704
705 /**
706  * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
707  * @brief       This API gets the installed package data size on the target.
708  *
709  * @par         This API is for package-manager client application
710  * @par Sync (or) Async : Synchronous API
711  *
712  * @param[in]   handle  pointer to package info handle
713  * @param[out] size             pointer to hold package data size
714  * @return      0 if success, error code(<0) if fail
715  * @retval      PMINFO_R_OK     success
716  * @retval      PMINFO_R_EINVAL invalid argument
717  * @retval      PMINFO_R_ERROR  internal error
718  * @code
719 static int get_pkg_data_size(const char *pkgid)
720 {
721         int ret = 0;
722         int size = 0;
723         pkgmgrinfo_pkginfo_h handle;
724         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
725         if (ret != PMINFO_R_OK)
726                 return -1;
727         ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
728         if (ret != PMINFO_R_OK) {
729                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
730                 return -1;
731         }
732         printf("pkg data size: %d\n", size);
733         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
734         return 0;
735 }
736  * @endcode
737  */
738  int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
739
740 /**
741  * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
742  * @brief       This API gets the package icon from the package ID
743  *
744  * @par         This API is for package-manager client application
745  * @par Sync (or) Async : Synchronous API
746  *
747  * @param[in]   handle  pointer to package info handle
748  * @param[out] icon             pointer to hold package icon
749  * @return      0 if success, error code(<0) if fail
750  * @retval      PMINFO_R_OK     success
751  * @retval      PMINFO_R_EINVAL invalid argument
752  * @retval      PMINFO_R_ERROR  internal error
753  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
754  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
755  * @see         pkgmgrinfo_pkginfo_get_pkgid()
756  * @see         pkgmgrinfo_pkginfo_is_removable()
757  * @code
758 static int get_pkg_icon(const char *pkgid)
759 {
760         int ret = 0;
761         char *icon = NULL;
762         pkgmgrinfo_pkginfo_h handle;
763         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
764         if (ret != PMINFO_R_OK)
765                 return -1;
766         ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
767         if (ret != PMINFO_R_OK) {
768                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
769                 return -1;
770         }
771         printf("pkg icon: %s\n", icon);
772         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
773         return 0;
774 }
775  * @endcode
776  */
777 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
778
779 /**
780  * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
781  * @brief       This API gets the package label from the package ID
782  *
783  * @par         This API is for package-manager client application
784  * @par Sync (or) Async : Synchronous API
785  *
786  * @param[in]   handle  pointer to package info handle
787  * @param[out] label            pointer to hold package label
788  * @return      0 if success, error code(<0) if fail
789  * @retval      PMINFO_R_OK     success
790  * @retval      PMINFO_R_EINVAL invalid argument
791  * @retval      PMINFO_R_ERROR  internal error
792  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
793  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
794  * @see         pkgmgrinfo_pkginfo_get_pkgid()
795  * @see         pkgmgrinfo_pkginfo_is_removable()
796  * @code
797 static int get_pkg_label(const char *pkgid)
798 {
799         int ret = 0;
800         char *label = NULL;
801         pkgmgrinfo_pkginfo_h handle;
802         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
803         if (ret != PMINFO_R_OK)
804                 return -1;
805         ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
806         if (ret != PMINFO_R_OK) {
807                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
808                 return -1;
809         }
810         printf("pkg label: %s\n", label);
811         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
812         return 0;
813 }
814  * @endcode
815  */
816 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
817
818 /**
819  * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
820  * @brief       This API gets the package description from the package ID
821  *
822  * @par         This API is for package-manager client application
823  * @par Sync (or) Async : Synchronous API
824  *
825  * @param[in]   handle  pointer to package info handle
826  * @param[out] description              pointer to hold package description
827  * @return      0 if success, error code(<0) if fail
828  * @retval      PMINFO_R_OK     success
829  * @retval      PMINFO_R_EINVAL invalid argument
830  * @retval      PMINFO_R_ERROR  internal error
831  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
832  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
833  * @see         pkgmgrinfo_pkginfo_get_pkgid()
834  * @see         pkgmgrinfo_pkginfo_is_removable()
835  * @code
836 static int get_pkg_description(const char *pkgid)
837 {
838         int ret = 0;
839         char *description = NULL;
840         pkgmgrinfo_pkginfo_h handle;
841         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
842         if (ret != PMINFO_R_OK)
843                 return -1;
844         ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
845         if (ret != PMINFO_R_OK) {
846                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
847                 return -1;
848         }
849         printf("pkg description: %s\n", description);
850         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
851         return 0;
852 }
853  * @endcode
854  */
855 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
856
857 /**
858  * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
859  * @brief       This API gets the package's author name from the package ID
860  *
861  * @par         This API is for package-manager client application
862  * @par Sync (or) Async : Synchronous API
863  *
864  * @param[in]   handle  pointer to package info handle
865  * @param[out] author_name              pointer to hold package author name
866  * @return      0 if success, error code(<0) if fail
867  * @retval      PMINFO_R_OK     success
868  * @retval      PMINFO_R_EINVAL invalid argument
869  * @retval      PMINFO_R_ERROR  internal error
870  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
871  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
872  * @see         pkgmgrinfo_pkginfo_get_pkgid()
873  * @see         pkgmgrinfo_pkginfo_is_removable()
874  * @code
875 static int get_pkg_author_name(const char *pkgid)
876 {
877         int ret = 0;
878         char *author_name = NULL;
879         pkgmgrinfo_pkginfo_h handle;
880         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
881         if (ret != PMINFO_R_OK)
882                 return -1;
883         ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
884         if (ret != PMINFO_R_OK) {
885                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
886                 return -1;
887         }
888         printf("pkg author name: %s\n", author_name);
889         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
890         return 0;
891 }
892  * @endcode
893  */
894 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
895
896 /**
897  * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
898  * @brief       This API gets the package's author email from the package ID
899  *
900  * @par         This API is for package-manager client application
901  * @par Sync (or) Async : Synchronous API
902  *
903  * @param[in]   handle  pointer to package info handle
904  * @param[out] author_email             pointer to hold package author email
905  * @return      0 if success, error code(<0) if fail
906  * @retval      PMINFO_R_OK     success
907  * @retval      PMINFO_R_EINVAL invalid argument
908  * @retval      PMINFO_R_ERROR  internal error
909  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
910  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
911  * @see         pkgmgrinfo_pkginfo_get_pkgid()
912  * @see         pkgmgrinfo_pkginfo_is_removable()
913  * @code
914 static int get_pkg_author_email(const char *pkgid)
915 {
916         int ret = 0;
917         char *author_email = NULL;
918         pkgmgrinfo_pkginfo_h handle;
919         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
920         if (ret != PMINFO_R_OK)
921                 return -1;
922         ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
923         if (ret != PMINFO_R_OK) {
924                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
925                 return -1;
926         }
927         printf("pkg author email: %s\n", author_email);
928         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
929         return 0;
930 }
931  * @endcode
932  */
933 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
934
935 /**
936  * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
937  * @brief       This API gets the package's author href from the package ID
938  *
939  * @par         This API is for package-manager client application
940  * @par Sync (or) Async : Synchronous API
941  *
942  * @param[in]   handle  pointer to package info handle
943  * @param[out] author_href              pointer to hold package author href
944  * @return      0 if success, error code(<0) if fail
945  * @retval      PMINFO_R_OK     success
946  * @retval      PMINFO_R_EINVAL invalid argument
947  * @retval      PMINFO_R_ERROR  internal error
948  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
949  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
950  * @see         pkgmgrinfo_pkginfo_get_pkgid()
951  * @see         pkgmgrinfo_pkginfo_is_removable()
952  * @code
953 static int get_pkg_author_href(const char *pkgid)
954 {
955         int ret = 0;
956         char *author_href = NULL;
957         pkgmgrinfo_pkginfo_h handle;
958         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
959         if (ret != PMINFO_R_OK)
960                 return -1;
961         ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
962         if (ret != PMINFO_R_OK) {
963                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
964                 return -1;
965         }
966         printf("pkg author href: %s\n", author_href);
967         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
968         return 0;
969 }
970  * @endcode
971  */
972 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
973
974 /**
975  * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
976  * @brief       This API gets the package installed storagae value from the package ID
977  *
978  * @par         This API is for package-manager client application
979  * @par Sync (or) Async : Synchronous API
980  *
981  * @param[in]   handle  pointer to package info handle
982  * @param[out] storage          pointer to hold package installed storage
983  * @return      0 if success, error code(<0) if fail
984  * @retval      PMINFO_R_OK     success
985  * @retval      PMINFO_R_EINVAL invalid argument
986  * @retval      PMINFO_R_ERROR  internal error
987  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
988  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
989  * @see         pkgmgrinfo_pkginfo_get_pkgid()
990  * @see         pkgmgrinfo_pkginfo_is_removable()
991  * @code
992 static int get_pkg_installed_storage(const char *pkgid)
993 {
994         int ret = 0;
995         pkgmgrinfo_installed_storage storage;
996         pkgmgrinfo_pkginfo_h handle;
997         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
998         if (ret != PMINFO_R_OK)
999                 return -1;
1000         ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1001         if (ret != PMINFO_R_OK) {
1002                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1003                 return -1;
1004         }
1005         printf("pkg installed storage: %d\n", storage);
1006         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1007         return 0;
1008 }
1009  * @endcode
1010  */
1011 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1012
1013 /**
1014  * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1015  * @brief       This API gets the installed time of package from the package ID
1016  *
1017  * @par         This API is for package-manager client application
1018  * @par Sync (or) Async : Synchronous API
1019  *
1020  * @param[in]   handle  pointer to package info handle
1021  * @param[out] installed_time           pointer to hold installed time of package
1022  * @return      0 if success, error code(<0) if fail
1023  * @retval      PMINFO_R_OK     success
1024  * @retval      PMINFO_R_EINVAL invalid argument
1025  * @retval      PMINFO_R_ERROR  internal error
1026  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1027  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1028  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1029  * @see         pkgmgrinfo_pkginfo_is_removable()
1030  * @code
1031 static int get_pkg_installed_time(const char *pkgid)
1032 {
1033         int ret = 0;
1034         int installed_time = 0;
1035         pkgmgrinfo_pkginfo_h handle;
1036         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1037         if (ret != PMINFO_R_OK)
1038                 return -1;
1039         ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1040         if (ret != PMINFO_R_OK) {
1041                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1042                 return -1;
1043         }
1044         printf("installed_time: %d\n", installed_time);
1045         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1046         return 0;
1047 }
1048  * @endcode
1049  */
1050 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1051
1052 /**
1053  * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1054  * @brief       This API gets the store client id of package from the package ID
1055  *
1056  * @par         This API is for package-manager client application
1057  * @par Sync (or) Async : Synchronous API
1058  *
1059  * @param[in]   handle  pointer to package info handle
1060  * @param[out] storeclientid            pointer to hold store client id of package
1061  * @return      0 if success, error code(<0) if fail
1062  * @retval      PMINFO_R_OK     success
1063  * @retval      PMINFO_R_EINVAL invalid argument
1064  * @retval      PMINFO_R_ERROR  internal error
1065  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1066  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1067  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1068  * @see         pkgmgrinfo_pkginfo_is_removable()
1069  * @code
1070 static int get_pkg_storeclientid(const char *pkgid)
1071 {
1072         int ret = 0;
1073         char *storeclientid = 0;
1074         pkgmgrinfo_pkginfo_h handle;
1075         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1076         if (ret != PMINFO_R_OK)
1077                 return -1;
1078         ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1079         if (ret != PMINFO_R_OK) {
1080                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1081                 return -1;
1082         }
1083         printf(store client id: %s\n", storeclientid);
1084         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1085         return 0;
1086 }
1087  * @endcode
1088  */
1089 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1090
1091 /**
1092  * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1093  * @brief       This API gets the main app id of package from the package ID
1094  *
1095  * @par         This API is for package-manager client application
1096  * @par Sync (or) Async : Synchronous API
1097  *
1098  * @param[in]   handle  pointer to package info handle
1099  * @param[out] mainappid                pointer to hold main app id of package
1100  * @return      0 if success, error code(<0) if fail
1101  * @retval      PMINFO_R_OK     success
1102  * @retval      PMINFO_R_EINVAL invalid argument
1103  * @retval      PMINFO_R_ERROR  internal error
1104  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1105  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1106  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1107  * @see         pkgmgrinfo_pkginfo_is_removable()
1108  * @code
1109 static int get_pkg_mainappid(const char *pkgid)
1110 {
1111         int ret = 0;
1112         char *mainappid = 0;
1113         pkgmgrinfo_pkginfo_h handle;
1114         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1115         if (ret != PMINFO_R_OK)
1116                 return -1;
1117         ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1118         if (ret != PMINFO_R_OK) {
1119                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1120                 return -1;
1121         }
1122         printf(main app id: %s\n", mainappid);
1123         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1124         return 0;
1125 }
1126  * @endcode
1127  */
1128 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1129
1130 /**
1131  * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1132  * @brief       This API gets the url of package from the package ID
1133  *
1134  * @par         This API is for package-manager client application
1135  * @par Sync (or) Async : Synchronous API
1136  *
1137  * @param[in]   handle  pointer to package info handle
1138  * @param[out] url              pointer to hold url of package
1139  * @return      0 if success, error code(<0) if fail
1140  * @retval      PMINFO_R_OK     success
1141  * @retval      PMINFO_R_EINVAL invalid argument
1142  * @retval      PMINFO_R_ERROR  internal error
1143  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1144  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1145  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1146  * @see         pkgmgrinfo_pkginfo_is_removable()
1147  * @code
1148 static int get_pkg_url(const char *pkgid)
1149 {
1150         int ret = 0;
1151         char *url = 0;
1152         pkgmgrinfo_pkginfo_h handle;
1153         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1154         if (ret != PMINFO_R_OK)
1155                 return -1;
1156         ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1157         if (ret != PMINFO_R_OK) {
1158                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1159                 return -1;
1160         }
1161         printf("url : %s\n", url);
1162         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1163         return 0;
1164 }
1165  * @endcode
1166  */
1167 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1168
1169 /**
1170  * @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)
1171  * @brief       This API compare the cert information from given package id
1172  *
1173  * @par         This API is for package-manager client application
1174  * @par Sync (or) Async : Synchronous API
1175  *
1176  * @param[in]   lhs_package_id  pointer to first package ID
1177  * @param[in]   rhs_package_id  pointer to second package ID
1178  * @param[out] compare_result           pointer to the compare result.
1179  * @return      0 if success, error code(<0) if fail
1180  * @retval      PMINFO_R_OK     success
1181  * @retval      PMINFO_R_EINVAL invalid argument
1182  * @retval      PMINFO_R_ERROR  internal error
1183  * @pre         None
1184  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1185  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1186  * @see         pkgmgrinfo_pkginfo_is_removable()
1187  * @code
1188 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1189 {
1190         int ret = 0;
1191         pkgmgrinfo_cert_compare_result_type_e result;
1192
1193         ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1194         if (ret != PMINFO_R_OK) {
1195                 return -1;
1196         }
1197         printf("result: %d\n", result);
1198         return 0;
1199 }
1200  * @endcode
1201  */
1202 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);
1203
1204 /**
1205  * @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)
1206  * @brief       This API compare the cert information from given app id
1207  *
1208  * @par         This API is for package-manager client application
1209  * @par Sync (or) Async : Synchronous API
1210  *
1211  * @param[in]   lhs_app_id      pointer to first app ID
1212  * @param[in]   rhs_app_id      pointer to second app ID
1213  * @param[out] compare_result           pointer to the compare result.
1214  * @return      0 if success, error code(<0) if fail
1215  * @retval      PMINFO_R_OK     success
1216  * @retval      PMINFO_R_EINVAL invalid argument
1217  * @retval      PMINFO_R_ERROR  internal error
1218  * @pre         None
1219  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1220  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1221  * @see         pkgmgrinfo_pkginfo_is_removable()
1222  * @code
1223 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1224 {
1225         int ret = 0;
1226         pkgmgrinfo_cert_compare_result_type_e result;
1227
1228         ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1229         if (ret != PMINFO_R_OK) {
1230                 return -1;
1231         }
1232         printf("result: %d\n", result);
1233         return 0;
1234 }
1235  * @endcode
1236  */
1237 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);
1238
1239 /**
1240  * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1241  * @brief       This API gets the package 'removable' value from the package ID
1242  *
1243  * @par         This API is for package-manager client application
1244  * @par Sync (or) Async : Synchronous API
1245  *
1246  * @param[in]   handle  pointer to package info handle
1247  * @param[out] removable                pointer to hold package removable value
1248  * @return      0 if success, error code(<0) if fail
1249  * @retval      PMINFO_R_OK     success
1250  * @retval      PMINFO_R_EINVAL invalid argument
1251  * @retval      PMINFO_R_ERROR  internal error
1252  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1253  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1254  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1255  * @see         pkgmgrinfo_pkginfo_is_readonly()
1256  * @code
1257 static int get_pkg_removable(const char *pkgid)
1258 {
1259         int ret = 0;
1260         bool removable;
1261         pkgmgrinfo_pkginfo_h handle;
1262         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1263         if (ret != PMINFO_R_OK)
1264                 return -1;
1265         ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1266         if (ret != PMINFO_R_OK) {
1267                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1268                 return -1;
1269         }
1270         printf("pkg removable: %d\n", removable);
1271         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1272         return 0;
1273 }
1274  * @endcode
1275  */
1276 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1277
1278 /**
1279  * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1280  * @brief       This API gets the package 'preload' value from the package ID
1281  *
1282  * @par         This API is for package-manager client application
1283  * @par Sync (or) Async : Synchronous API
1284  *
1285  * @param[in]   handle  pointer to package info handle
1286  * @param[out] preload          pointer to hold package preload value
1287  * @return      0 if success, error code(<0) if fail
1288  * @retval      PMINFO_R_OK     success
1289  * @retval      PMINFO_R_EINVAL invalid argument
1290  * @retval      PMINFO_R_ERROR  internal error
1291  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1292  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1293  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1294  * @see         pkgmgrinfo_pkginfo_is_readonly()
1295  * @code
1296 static int get_pkg_preload(const char *pkgid)
1297 {
1298         int ret = 0;
1299         bool preload;
1300         pkgmgrinfo_pkginfo_h handle;
1301         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1302         if (ret != PMINFO_R_OK)
1303                 return -1;
1304         ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1305         if (ret != PMINFO_R_OK) {
1306                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1307                 return -1;
1308         }
1309         printf("pkg preload: %d\n", preload);
1310         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1311         return 0;
1312 }
1313  * @endcode
1314  */
1315 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1316
1317 /**
1318  * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1319  * @brief       This API gets the package 'readonly' value from the package ID
1320  *
1321  * @par         This API is for package-manager client application
1322  * @par Sync (or) Async : Synchronous API
1323  *
1324  * @param[in]   handle  pointer to package info handle
1325  * @param[out] readonly pointer to hold package readonly value
1326  * @return      0 if success, error code(<0) if fail
1327  * @retval      PMINFO_R_OK     success
1328  * @retval      PMINFO_R_EINVAL invalid argument
1329  * @retval      PMINFO_R_ERROR  internal error
1330  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1331  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1332  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1333  * @see         pkgmgrinfo_pkginfo_is_removable()
1334  * @code
1335 static int get_pkg_readonly(const char *pkgid)
1336 {
1337         int ret = 0;
1338         bool readonly;
1339         pkgmgrinfo_pkginfo_h handle;
1340         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1341         if (ret != PMINFO_R_OK)
1342                 return -1;
1343         ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1344         if (ret != PMINFO_R_OK) {
1345                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1346                 return -1;
1347         }
1348         printf("pkg readonly: %d\n", readonly);
1349         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1350         return 0;
1351 }
1352  * @endcode
1353  */
1354 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1355
1356 /**
1357  * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1358  * @brief       This API gets the package 'accessible' value from the package ID
1359  *
1360  * @par         This API is for package-manager client application
1361  * @par Sync (or) Async : Synchronous API
1362  *
1363  * @param[in]   handle  pointer to package info handle
1364  * @param[out] accessible       pointer to hold package accessible value
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         pkgmgrinfo_pkginfo_get_pkginfo()
1370  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1371  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1372  * @see         pkgmgrinfo_pkginfo_is_readonly()
1373  * @code
1374 static int get_pkg_accessible(const char *pkgid)
1375 {
1376         int ret = 0;
1377         bool accessible;
1378         pkgmgrinfo_pkginfo_h handle;
1379         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1380         if (ret != PMINFO_R_OK)
1381                 return -1;
1382         ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1383         if (ret != PMINFO_R_OK) {
1384                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1385                 return -1;
1386         }
1387         printf("pkg accessible: %d\n", accessible);
1388         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1389         return 0;
1390 }
1391  * @endcode
1392  */
1393 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1394
1395 /**
1396  * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1397  * @brief       This API destroys the package information handle freeing up all the resources
1398  *
1399  * @par         This API is for package-manager client application
1400  * @par Sync (or) Async : Synchronous API
1401  *
1402  * @param[in]   handle  pointer to the package info handle
1403  * @return      0 if success, error code(<0) if fail
1404  * @retval      PMINFO_R_OK     success
1405  * @retval      PMINFO_R_EINVAL invalid argument
1406  * @retval      PMINFO_R_ERROR  internal error
1407  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1408  * @post                None
1409  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1410  * @see         pkgmgrinfo_pkginfo_is_removable()
1411  * @code
1412 static int get_pkg_type(const char *pkgid)
1413 {
1414         int ret = 0;
1415         char *type = NULL;
1416         pkgmgrinfo_pkginfo_h handle;
1417         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1418         if (ret != PMINFO_R_OK)
1419                 return -1;
1420         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1421         if (ret != PMINFO_R_OK) {
1422                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1423                 return -1;
1424         }
1425         printf("pkgtype: %s\n", type);
1426         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1427         return 0;
1428 }
1429  * @endcode
1430  */
1431 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1432
1433 /**
1434  * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1435  * @brief       This API creates the package information filter handle from db.  All filter properties will be ANDed.
1436  The query will search the entire package information collected from the manifest file of all the installed packages
1437  *
1438  * @par         This API is for package-manager client application
1439  * @par Sync (or) Async : Synchronous API
1440  *
1441  * @param[out] handle           pointer to the package info filter handle.
1442  * @return      0 if success, error code(<0) if fail
1443  * @retval      PMINFO_R_OK     success
1444  * @retval      PMINFO_R_EINVAL invalid argument
1445  * @retval      PMINFO_R_ERROR  internal error
1446  * @pre         None
1447  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1448  * @see         pkgmgrinfo_pkginfo_filter_count()
1449  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1450  * @code
1451 static int get_rpm_pkg_count()
1452 {
1453         int ret = 0;
1454         int count = 0;
1455         pkgmgrinfo_pkginfo_filter_h handle;
1456         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1457         if (ret != PMINFO_R_OK)
1458                 return -1;
1459         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1460         if (ret != PMINFO_R_OK) {
1461                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1462                 return -1;
1463         }
1464         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1465         if (ret != PMINFO_R_OK) {
1466                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1467                 return -1;
1468         }
1469         printf("No of rpm pkgs: %d\n", count);
1470         pkgmgrinfo_pkginfo_filter_destroy(handle);
1471         return 0;
1472 }
1473  * @endcode
1474  */
1475 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1476
1477 /**
1478  * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1479  * @brief       This API destroys the package information filter handle freeing up all the resources
1480  *
1481  * @par         This API is for package-manager client application
1482  * @par Sync (or) Async : Synchronous API
1483  *
1484  * @param[in] handle            pointer to the package info filter handle.
1485  * @return      0 if success, error code(<0) if fail
1486  * @retval      PMINFO_R_OK     success
1487  * @retval      PMINFO_R_EINVAL invalid argument
1488  * @retval      PMINFO_R_ERROR  internal error
1489  * @pre         pkgmgrinfo_pkginfo_filter_create()
1490  * @post                None
1491  * @see         pkgmgrinfo_pkginfo_filter_count()
1492  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1493  * @code
1494 static int get_rpm_pkg_count()
1495 {
1496         int ret = 0;
1497         int count = 0;
1498         pkgmgrinfo_pkginfo_filter_h handle;
1499         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1500         if (ret != PMINFO_R_OK)
1501                 return -1;
1502         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1503         if (ret != PMINFO_R_OK) {
1504                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1505                 return -1;
1506         }
1507         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1508         if (ret != PMINFO_R_OK) {
1509                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1510                 return -1;
1511         }
1512         printf("No of rpm pkgs: %d\n", count);
1513         pkgmgrinfo_pkginfo_filter_destroy(handle);
1514         return 0;
1515 }
1516  * @endcode
1517  */
1518 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1519
1520 /**
1521  * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1522  * @brief       This API adds a boolean filter property to the filter handle
1523  *
1524  * @par         This API is for package-manager client application
1525  * @par Sync (or) Async : Synchronous API
1526  *
1527  * @param[in] handle            pointer to the package info filter handle.
1528  * @param[in] property          boolean property name.
1529  * @param[in] value             value corresponding to the property.
1530  * @return      0 if success, error code(<0) if fail
1531  * @retval      PMINFO_R_OK     success
1532  * @retval      PMINFO_R_EINVAL invalid argument
1533  * @retval      PMINFO_R_ERROR  internal error
1534  * @pre         pkgmgrinfo_pkginfo_filter_create()
1535  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1536  * @see         pkgmgrinfo_pkginfo_filter_count()
1537  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1538  * @code
1539 static int get_preload_pkg_count()
1540 {
1541         int ret = 0;
1542         int count = 0;
1543         pkgmgrinfo_pkginfo_filter_h handle;
1544         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1545         if (ret != PMINFO_R_OK)
1546                 return -1;
1547         ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1548         if (ret != PMINFO_R_OK) {
1549                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1550                 return -1;
1551         }
1552         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1553         if (ret != PMINFO_R_OK) {
1554                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1555                 return -1;
1556         }
1557         printf("No of preload pkgs: %d\n", count);
1558         pkgmgrinfo_pkginfo_filter_destroy(handle);
1559         return 0;
1560 }
1561  * @endcode
1562  */
1563 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1564                 const char *property, const bool value);
1565
1566 /**
1567  * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1568  * @brief       This API adds an integer filter property to the filter handle
1569  *
1570  * @par         This API is for package-manager client application
1571  * @par Sync (or) Async : Synchronous API
1572  *
1573  * @param[in] handle            pointer to the package info filter handle.
1574  * @param[in] property          integer property name.
1575  * @param[in] value             value corresponding to the property.
1576  * @return      0 if success, error code(<0) if fail
1577  * @retval      PMINFO_R_OK     success
1578  * @retval      PMINFO_R_EINVAL invalid argument
1579  * @retval      PMINFO_R_ERROR  internal error
1580  * @pre         pkgmgrinfo_pkginfo_filter_create()
1581  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1582  * @see         pkgmgrinfo_pkginfo_filter_count()
1583  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1584  * @code
1585 static int get_pkg_count()
1586 {
1587         int ret = 0;
1588         int count = 0;
1589         pkgmgrinfo_pkginfo_filter_h handle;
1590         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1591         if (ret != PMINFO_R_OK)
1592                 return -1;
1593         ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1594         if (ret != PMINFO_R_OK) {
1595                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1596                 return -1;
1597         }
1598         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1599         if (ret != PMINFO_R_OK) {
1600                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1601                 return -1;
1602         }
1603         printf("No of preload pkgs: %d\n", count);
1604         pkgmgrinfo_pkginfo_filter_destroy(handle);
1605         return 0;
1606 }
1607  * @endcode
1608  */
1609 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1610                 const char *property, const int value);
1611
1612 /**
1613  * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1614  * @brief       This API adds a string filter property to the filter handle
1615  *
1616  * @par         This API is for package-manager client application
1617  * @par Sync (or) Async : Synchronous API
1618  *
1619  * @param[in] handle            pointer to the package info filter handle.
1620  * @param[in] property          string property name.
1621  * @param[in] value             value corresponding to the property.
1622  * @return      0 if success, error code(<0) if fail
1623  * @retval      PMINFO_R_OK     success
1624  * @retval      PMINFO_R_EINVAL invalid argument
1625  * @retval      PMINFO_R_ERROR  internal error
1626  * @pre         pkgmgrinfo_pkginfo_filter_create()
1627  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1628  * @see         pkgmgrinfo_pkginfo_filter_count()
1629  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1630  * @code
1631 static int get_rpm_pkg_count()
1632 {
1633         int ret = 0;
1634         int count = 0;
1635         pkgmgrinfo_pkginfo_filter_h handle;
1636         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1637         if (ret != PMINFO_R_OK)
1638                 return -1;
1639         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1640         if (ret != PMINFO_R_OK) {
1641                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1642                 return -1;
1643         }
1644         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1645         if (ret != PMINFO_R_OK) {
1646                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1647                 return -1;
1648         }
1649         printf("No of rpm pkgs: %d\n", count);
1650         pkgmgrinfo_pkginfo_filter_destroy(handle);
1651         return 0;
1652 }
1653  * @endcode
1654  */
1655 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1656                 const char *property, const char *value);
1657
1658 /**
1659  * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1660  * @brief       This API executes the user supplied callback function for each package that satisfy the filter conditions
1661  *
1662  * @par         This API is for package-manager client application
1663  * @par Sync (or) Async : Synchronous API
1664  *
1665  * @param[in] handle            pointer to the package info filter handle.
1666  * @param[in] pkg_cb            callback function.
1667  * @param[in] user_data         user data to be passed to the callback function
1668  * @return      0 if success, error code(<0) if fail
1669  * @retval      PMINFO_R_OK     success
1670  * @retval      PMINFO_R_EINVAL invalid argument
1671  * @retval      PMINFO_R_ERROR  internal error
1672  * @pre         pkgmgrinfo_pkginfo_filter_create()
1673  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1674  * @see         pkgmgrinfo_pkginfo_filter_count()
1675  * @code
1676 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1677 {
1678         char *pkgid = NULL;
1679         pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1680         printf("pkg id : %s\n", pkgid);
1681         return 0;
1682 }
1683
1684 static int get_rpm_pkg_list()
1685 {
1686         int ret = 0;
1687         pkgmgrinfo_pkginfo_filter_h handle;
1688         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1689         if (ret != PMINFO_R_OK)
1690                 return -1;
1691         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1692         if (ret != PMINFO_R_OK) {
1693                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1694                 return -1;
1695         }
1696         ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1697         if (ret != PMINFO_R_OK) {
1698                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1699                 return -1;
1700         }
1701         pkgmgrinfo_pkginfo_filter_destroy(handle);
1702         return 0;
1703 }
1704  * @endcode
1705  */
1706 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1707                 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1708
1709 /**
1710  * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1711  * @brief       This API counts the package that satisfy the filter conditions
1712  *
1713  * @par         This API is for package-manager client application
1714  * @par Sync (or) Async : Synchronous API
1715  *
1716  * @param[in] handle            pointer to the package info filter handle.
1717  * @param[in] count             pointer to store the count value.
1718  * @return      0 if success, error code(<0) if fail
1719  * @retval      PMINFO_R_OK     success
1720  * @retval      PMINFO_R_EINVAL invalid argument
1721  * @retval      PMINFO_R_ERROR  internal error
1722  * @pre         pkgmgrinfo_pkginfo_filter_create()
1723  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1724  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1725  * @code
1726 static int get_rpm_pkg_count()
1727 {
1728         int ret = 0;
1729         int count = 0;
1730         pkgmgrinfo_pkginfo_filter_h handle;
1731         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1732         if (ret != PMINFO_R_OK)
1733                 return -1;
1734         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1735         if (ret != PMINFO_R_OK) {
1736                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1737                 return -1;
1738         }
1739         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1740         if (ret != PMINFO_R_OK) {
1741                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1742                 return -1;
1743         }
1744         printf("No of rpm pkgs: %d\n", count);
1745         pkgmgrinfo_pkginfo_filter_destroy(handle);
1746         return 0;
1747 }
1748  * @endcode
1749  */
1750 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1751
1752 /**
1753  * @fn  int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1754  pkgmgrinfo_app_list_cb app_func, void *user_data)
1755  * @brief       This API gets list of installed applications for a particular package
1756  *
1757  * @par         This API is for package-manager client application
1758  * @par Sync (or) Async : Synchronous API
1759  * @param[in]   handle          package info handle
1760  * @param[in]   component       application component
1761  * @param[in]   app_func                iteration function for list
1762  * @param[in] user_data user data to be passed to callback function
1763  * @return      0 if success, error code(<0) if fail
1764  * @retval      PMINFO_R_OK     success
1765  * @retval      PMINFO_R_EINVAL invalid argument
1766  * @retval      PMINFO_R_ERROR  internal error
1767  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1768  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1769  * @code
1770 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
1771 {
1772         char *appid = NULL;
1773         pkgmgrinfo_appinfo_get_appid(handle, &appid);
1774         printf("appid : %s\n", appid);
1775         return 0;
1776 }
1777
1778 static int list_apps(const char *pkgid)
1779 {
1780         int ret = 0;
1781         pkgmgrinfo_pkginfo_h handle;
1782         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1783         if (ret != PMINFO_R_OK)
1784                 return -1;
1785         ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
1786         if (ret != PMINFO_R_OK) {
1787                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1788                 return -1;
1789         }
1790         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1791         return 0;
1792 }
1793  * @endcode
1794  */
1795 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1796                                                         pkgmgrinfo_app_list_cb app_func, void *user_data);
1797
1798 /**
1799  * @fn  int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1800  * @brief       This API gets list of installed applications from all packages.
1801  *
1802  * @par         This API is for package-manager client application
1803  * @par Sync (or) Async : Synchronous API
1804  * @param[in]   app_func                iteration function for list
1805  * @param[in] user_data user data to be passed to callback function
1806  * @return      0 if success, error code(<0) if fail
1807  * @retval      PMINFO_R_OK     success
1808  * @retval      PMINFO_R_EINVAL invalid argument
1809  * @retval      PMINFO_R_ERROR  internal error
1810  * @pre         None
1811  * @post                None
1812  * @code
1813 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
1814 {
1815         char *pkgid1 = NULL;
1816         char *pkgid2 = NULL;
1817         pkgid1 = (char *)user_data;
1818         pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
1819         if (strcmp(pkgid1, pkgid2) == 0) {
1820                 return -1;
1821         } else {
1822                 return 0;
1823         }
1824 }
1825
1826 static int list_apps()
1827 {
1828         int ret = 0;
1829         char *name = "helloworld";
1830         ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
1831         if (ret != PMINFO_R_OK) {
1832                 return -1;
1833         }
1834         return 0;
1835 }
1836  * @endcode
1837  */
1838 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1839
1840 /**
1841  * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
1842  * @brief       This API creates the application information handle from db
1843  *
1844  * @par         This API is for package-manager client application
1845  * @par Sync (or) Async : Synchronous API
1846  *
1847  * @param[in]   appid   pointer to appid
1848  * @param[out] handle           pointer to the application info handle.
1849  * @return      0 if success, error code(<0) if fail
1850  * @retval      PMINFO_R_OK     success
1851  * @retval      PMINFO_R_EINVAL invalid argument
1852  * @retval      PMINFO_R_ERROR  internal error
1853  * @pre         None
1854  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
1855  * @see         pkgmgrinfo_appinfo_get_pkgid()
1856  * @see         pkgmgrinfo_appinfo_is_multiple()
1857  * @code
1858 static int get_app_type(const char *appid)
1859 {
1860         int ret = 0;
1861         char *type = NULL;
1862         pkgmgrinfo_appinfo_h handle;
1863         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
1864         if (ret != PMINFO_R_OK)
1865                 return -1;
1866         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
1867         if (ret != PMINFO_R_OK) {
1868                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1869                 return -1;
1870         }
1871         printf("apptype: %s\n", type);
1872         pkgmgrinfo_appinfo_destroy_appinfo(handle);
1873         return 0;
1874 }
1875  * @endcode
1876  */
1877 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
1878
1879 /**
1880  * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
1881  * @brief       This API gets the application ID
1882  *
1883  * @par         This API is for package-manager client application
1884  * @par Sync (or) Async : Synchronous API
1885  *
1886  * @param[in] handle            pointer to the application info handle.
1887  * @param[out] appid            pointer to hold appid
1888  * @return      0 if success, error code(<0) if fail
1889  * @retval      PMINFO_R_OK     success
1890  * @retval      PMINFO_R_EINVAL invalid argument
1891  * @retval      PMINFO_R_ERROR  internal error
1892  * @pre         pkgmgrinfo_appinfo_get_appinfo()
1893  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
1894  * @see         pkgmgrinfo_appinfo_get_pkgid()
1895  * @see         pkgmgrinfo_appinfo_is_multiple()
1896  * @code
1897 static int get_app_id(const char *appid)
1898 {
1899         int ret = 0;
1900         char *app_id = NULL;
1901         pkgmgrinfo_appinfo_h handle;
1902         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
1903         if (ret != PMINFO_R_OK)
1904                 return -1;
1905         ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
1906         if (ret != PMINFO_R_OK) {
1907                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1908                 return -1;
1909         }
1910         printf("app id: %s\n", app_id);
1911         pkgmgrinfo_appinfo_destroy_appinfo(handle);
1912         return 0;
1913 }
1914  * @endcode
1915  */
1916 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h  handle, char **appid);
1917
1918 /**
1919  * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
1920  * @brief       This API gets the package name of the application
1921  *
1922  * @par         This API is for package-manager client application
1923  * @par Sync (or) Async : Synchronous API
1924  *
1925  * @param[in] handle            pointer to the application info handle.
1926  * @param[out] pkg_name         pointer to hold package name
1927  * @return      0 if success, error code(<0) if fail
1928  * @retval      PMINFO_R_OK     success
1929  * @retval      PMINFO_R_EINVAL invalid argument
1930  * @retval      PMINFO_R_ERROR  internal error
1931  * @pre         pkgmgrinfo_appinfo_get_appinfo()
1932  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
1933  * @see         pkgmgrinfo_appinfo_get_appid()
1934  * @see         pkgmgrinfo_appinfo_is_multiple()
1935  * @code
1936 static int get_app_pkgname(const char *appid)
1937 {
1938         int ret = 0;
1939         char *pkgname = NULL;
1940         pkgmgrinfo_appinfo_h handle;
1941         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
1942         if (ret != PMINFO_R_OK)
1943                 return -1;
1944         ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
1945         if (ret != PMINFO_R_OK) {
1946                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1947                 return -1;
1948         }
1949         printf("pkg name: %s\n", pkgname);
1950         pkgmgrinfo_appinfo_destroy_appinfo(handle);
1951         return 0;
1952 }
1953  * @endcode
1954  */
1955 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h  handle, char **pkg_name);
1956
1957 /**
1958  * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
1959  * @brief       This API gets the package id of the application
1960  *
1961  * @par         This API is for package-manager client application
1962  * @par Sync (or) Async : Synchronous API
1963  *
1964  * @param[in] handle            pointer to the application info handle.
1965  * @param[out] pkgid            pointer to hold package id
1966  * @return      0 if success, error code(<0) if fail
1967  * @retval      PMINFO_R_OK     success
1968  * @retval      PMINFO_R_EINVAL invalid argument
1969  * @retval      PMINFO_R_ERROR  internal error
1970  * @pre         pkgmgrinfo_appinfo_get_appinfo()
1971  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
1972  * @see         pkgmgrinfo_appinfo_get_appid()
1973  * @see         pkgmgrinfo_appinfo_is_multiple()
1974  * @code
1975 static int get_app_pkgid(const char *appid)
1976 {
1977         int ret = 0;
1978         char *pkgid = NULL;
1979         pkgmgrinfo_appinfo_h handle;
1980         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
1981         if (ret != PMINFO_R_OK)
1982                 return -1;
1983         ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
1984         if (ret != PMINFO_R_OK) {
1985                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1986                 return -1;
1987         }
1988         printf("pkg id: %s\n", pkgid);
1989         pkgmgrinfo_appinfo_destroy_appinfo(handle);
1990         return 0;
1991 }
1992  * @endcode
1993  */
1994 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h  handle, char **pkgid);
1995
1996 /**
1997  * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
1998  * @brief       This API gets the executable name of the application
1999  *
2000  * @par         This API is for package-manager client application
2001  * @par Sync (or) Async : Synchronous API
2002  *
2003  * @param[in] handle            pointer to the application info handle.
2004  * @param[out] exec             pointer to hold app exec name
2005  * @return      0 if success, error code(<0) if fail
2006  * @retval      PMINFO_R_OK     success
2007  * @retval      PMINFO_R_EINVAL invalid argument
2008  * @retval      PMINFO_R_ERROR  internal error
2009  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2010  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2011  * @see         pkgmgrinfo_appinfo_get_appid()
2012  * @see         pkgmgrinfo_appinfo_is_multiple()
2013  * @code
2014 static int get_app_exec(const char *appid)
2015 {
2016         int ret = 0;
2017         char *exec = NULL;
2018         pkgmgrinfo_appinfo_h handle;
2019         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2020         if (ret != PMINFO_R_OK)
2021                 return -1;
2022         ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2023         if (ret != PMINFO_R_OK) {
2024                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2025                 return -1;
2026         }
2027         printf("exec name: %s\n", exec);
2028         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2029         return 0;
2030 }
2031  * @endcode
2032  */
2033 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h  handle, char **exec);
2034
2035 /**
2036  * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2037  * @brief       This API gets the icon name of the application
2038  *
2039  * @par         This API is for package-manager client application
2040  * @par Sync (or) Async : Synchronous API
2041  *
2042  * @param[in] handle            pointer to the application info handle.
2043  * @param[out] icon             pointer to hold app icon name
2044  * @return      0 if success, error code(<0) if fail
2045  * @retval      PMINFO_R_OK     success
2046  * @retval      PMINFO_R_EINVAL invalid argument
2047  * @retval      PMINFO_R_ERROR  internal error
2048  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2049  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2050  * @see         pkgmgrinfo_appinfo_get_appid()
2051  * @see         pkgmgrinfo_appinfo_is_multiple()
2052  * @code
2053 static int get_app_icon(const char *appid)
2054 {
2055         int ret = 0;
2056         char *icon = NULL;
2057         pkgmgrinfo_appinfo_h handle;
2058         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2059         if (ret != PMINFO_R_OK)
2060                 return -1;
2061         ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2062         if (ret != PMINFO_R_OK) {
2063                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2064                 return -1;
2065         }
2066         printf("icon name: %s\n", icon);
2067         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2068         return 0;
2069 }
2070  * @endcode
2071  */
2072 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
2073
2074 /**
2075  * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2076  * @brief       This API gets the label of the application
2077  *
2078  * @par         This API is for package-manager client application
2079  * @par Sync (or) Async : Synchronous API
2080  *
2081  * @param[in] handle            pointer to the application info handle.
2082  * @param[out] label            pointer to hold app label
2083  * @return      0 if success, error code(<0) if fail
2084  * @retval      PMINFO_R_OK     success
2085  * @retval      PMINFO_R_EINVAL invalid argument
2086  * @retval      PMINFO_R_ERROR  internal error
2087  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2088  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2089  * @see         pkgmgrinfo_appinfo_get_appid()
2090  * @see         pkgmgrinfo_appinfo_is_multiple()
2091  * @code
2092 static int get_app_label(const char *appid)
2093 {
2094         int ret = 0;
2095         char *label = NULL;
2096         pkgmgrinfo_appinfo_h handle;
2097         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2098         if (ret != PMINFO_R_OK)
2099                 return -1;
2100         ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2101         if (ret != PMINFO_R_OK) {
2102                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2103                 return -1;
2104         }
2105         printf("label : %s\n", label);
2106         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2107         return 0;
2108 }
2109  * @endcode
2110  */
2111 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h  handle, char **label);
2112
2113 /**
2114  * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2115  * @brief       This API gets the component of the application
2116  *
2117  * @par         This API is for package-manager client application
2118  * @par Sync (or) Async : Synchronous API
2119  *
2120  * @param[in] handle            pointer to the application info handle.
2121  * @param[out] component                pointer to hold app component
2122  * @return      0 if success, error code(<0) if fail
2123  * @retval      PMINFO_R_OK     success
2124  * @retval      PMINFO_R_EINVAL invalid argument
2125  * @retval      PMINFO_R_ERROR  internal error
2126  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2127  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2128  * @see         pkgmgrinfo_appinfo_get_appid()
2129  * @see         pkgmgrinfo_appinfo_is_multiple()
2130  * @code
2131 static int get_app_component(const char *appid)
2132 {
2133         int ret = 0;
2134         pkgmgrinfo_app_component component;
2135         pkgmgrinfo_appinfo_h handle;
2136         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2137         if (ret != PMINFO_R_OK)
2138                 return -1;
2139         ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2140         if (ret != PMINFO_R_OK) {
2141                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2142                 return -1;
2143         }
2144         printf("component : %s\n", component);
2145         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2146         return 0;
2147 }
2148  * @endcode
2149  */
2150 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_component *component);
2151
2152 /**
2153  * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2154  * @brief       This API gets the apptype of the application
2155  *
2156  * @par         This API is for package-manager client application
2157  * @par Sync (or) Async : Synchronous API
2158  *
2159  * @param[in] handle            pointer to the application info handle.
2160  * @param[out] app_type         pointer to hold apptype
2161  * @return      0 if success, error code(<0) if fail
2162  * @retval      PMINFO_R_OK     success
2163  * @retval      PMINFO_R_EINVAL invalid argument
2164  * @retval      PMINFO_R_ERROR  internal error
2165  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2166  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2167  * @see         pkgmgrinfo_appinfo_get_appid()
2168  * @see         pkgmgrinfo_appinfo_is_multiple()
2169  * @code
2170 static int get_app_type(const char *appid)
2171 {
2172         int ret = 0;
2173         char *apptype = NULL;
2174         pkgmgrinfo_appinfo_h handle;
2175         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2176         if (ret != PMINFO_R_OK)
2177                 return -1;
2178         ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2179         if (ret != PMINFO_R_OK) {
2180                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2181                 return -1;
2182         }
2183         printf("apptype : %s\n", apptype);
2184         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2185         return 0;
2186 }
2187  * @endcode
2188  */
2189 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h  handle, char **app_type);
2190
2191 /**
2192  * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h  handle,
2193                                                                                 int *operation_count, char ***operation)
2194  * @brief       This API gets the list of operation of the application
2195  *
2196  * @par         This API is for package-manager client application
2197  * @par Sync (or) Async : Synchronous API
2198  *
2199  * @param[in] handle            pointer to the appcontrol handle.
2200  * @param[out] operation_count          pointer to hold number of operations
2201  * @param[out] operation                pointer to hold list of operations
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_uri()
2209  * @see         pkgmgrinfo_appinfo_get_mime()
2210  * @code
2211 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2212 {
2213         int oc = 0;
2214         int i = 0;
2215         char **operation;
2216         pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2217         for (i = 0; i < oc; i++) {
2218                 if (strcmp(operation[i], (char *)user_data) == 0)
2219                         return -1;
2220                 else
2221                         return 0;
2222         }
2223 }
2224
2225 static int check_operation(const char *appid, char *operation)
2226 {
2227         int ret = 0;
2228         pkgmgrinfo_appinfo_h handle;
2229         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2230         if (ret != PMINFO_R_OK)
2231                 return -1;
2232         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2233         if (ret != PMINFO_R_OK) {
2234                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2235                 return -1;
2236         }
2237         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2238         return 0;
2239 }
2240  * @endcode
2241  */
2242 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h  handle,
2243                                                                                 int *operation_count, char ***operation);
2244
2245 /**
2246  * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h  handle,
2247                                                                                 int *uri_count, char ***uri)
2248  * @brief       This API gets the list of uri of the application
2249  *
2250  * @par         This API is for package-manager client application
2251  * @par Sync (or) Async : Synchronous API
2252  *
2253  * @param[in] handle            pointer to the appcontrol handle.
2254  * @param[out] uri_count                pointer to hold number of uris
2255  * @param[out] uri              pointer to hold list of uris
2256  * @return      0 if success, error code(<0) if fail
2257  * @retval      PMINFO_R_OK     success
2258  * @retval      PMINFO_R_EINVAL invalid argument
2259  * @retval      PMINFO_R_ERROR  internal error
2260  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2261  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2262  * @see         pkgmgrinfo_appinfo_get_operation()
2263  * @see         pkgmgrinfo_appinfo_get_mime()
2264  * @code
2265 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2266 {
2267         int uc = 0;
2268         int i = 0;
2269         char **uri;
2270         pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2271         for (i = 0; i < uc; i++) {
2272                 if (strcmp(uri[i], (char *)user_data) == 0)
2273                         return -1;
2274                 else
2275                         return 0;
2276         }
2277 }
2278
2279 static int check_uri(const char *appid, char *uri)
2280 {
2281         int ret = 0;
2282         pkgmgrinfo_appinfo_h handle;
2283         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2284         if (ret != PMINFO_R_OK)
2285                 return -1;
2286         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2287         if (ret != PMINFO_R_OK) {
2288                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2289                 return -1;
2290         }
2291         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2292         return 0;
2293 }
2294  * @endcode
2295  */
2296 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h  handle,
2297                                                                                 int *uri_count, char ***uri);
2298
2299 /**
2300  * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h  handle,
2301                                                                                 int *mime_count, char ***mime)
2302  * @brief       This API gets the list of mime of the application
2303  *
2304  * @par         This API is for package-manager client application
2305  * @par Sync (or) Async : Synchronous API
2306  *
2307  * @param[in] handle            pointer to the appcontrol handle.
2308  * @param[out] mime_count               pointer to hold number of mimes
2309  * @param[out] mime             pointer to hold list of mimes
2310  * @return      0 if success, error code(<0) if fail
2311  * @retval      PMINFO_R_OK     success
2312  * @retval      PMINFO_R_EINVAL invalid argument
2313  * @retval      PMINFO_R_ERROR  internal error
2314  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2315  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2316  * @see         pkgmgrinfo_appinfo_get_uri()
2317  * @see         pkgmgrinfo_appinfo_get_operation()
2318  * @code
2319 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2320 {
2321         int mc = 0;
2322         int i = 0;
2323         char **mime;
2324         pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2325         for (i = 0; i < mc; i++) {
2326                 if (strcmp(mime[i], (char *)user_data) == 0)
2327                         return -1;
2328                 else
2329                         return 0;
2330         }
2331 }
2332
2333 static int check_mime(const char *appid, char *mime)
2334 {
2335         int ret = 0;
2336         pkgmgrinfo_appinfo_h handle;
2337         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2338         if (ret != PMINFO_R_OK)
2339                 return -1;
2340         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2341         if (ret != PMINFO_R_OK) {
2342                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2343                 return -1;
2344         }
2345         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2346         return 0;
2347 }
2348  * @endcode
2349  */
2350 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h  handle,
2351                                                                                 int *mime_count, char ***mime);
2352
2353 /**
2354  * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2355  * @brief       This API gets the notification icon of the application
2356  *
2357  * @par         This API is for package-manager client application
2358  * @par Sync (or) Async : Synchronous API
2359  *
2360  * @param[in] handle            pointer to the application info handle.
2361  * @param[out] path             pointer to hold notification icon
2362  * @return      0 if success, error code(<0) if fail
2363  * @retval      PMINFO_R_OK     success
2364  * @retval      PMINFO_R_EINVAL invalid argument
2365  * @retval      PMINFO_R_ERROR  internal error
2366  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2367  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2368  * @see         pkgmgrinfo_appinfo_get_appid()
2369  * @see         pkgmgrinfo_appinfo_is_multiple()
2370  * @code
2371 static int get_app_notification_icon(const char *appid)
2372 {
2373         int ret = 0;
2374         char *notification_icon = NULL;
2375         pkgmgrinfo_appinfo_h handle;
2376         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2377         if (ret != PMINFO_R_OK)
2378                 return -1;
2379         ret = pkgmgrinfo_appinfo_get_notification_icon(handle, &notification_icon);
2380         if (ret != PMINFO_R_OK) {
2381                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2382                 return -1;
2383         }
2384         printf("notification icon : %s\n", notification_icon);
2385         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2386         return 0;
2387 }
2388  * @endcode
2389  */
2390 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
2391
2392 /**
2393  * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2394  * @brief       This API gets the setting icon of the application
2395  *
2396  * @par         This API is for package-manager client application
2397  * @par Sync (or) Async : Synchronous API
2398  *
2399  * @param[in] handle            pointer to the application info handle.
2400  * @param[out] path             pointer to hold setting icon
2401  * @return      0 if success, error code(<0) if fail
2402  * @retval      PMINFO_R_OK     success
2403  * @retval      PMINFO_R_EINVAL invalid argument
2404  * @retval      PMINFO_R_ERROR  internal error
2405  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2406  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2407  * @see         pkgmgrinfo_appinfo_get_appid()
2408  * @see         pkgmgrinfo_appinfo_is_multiple()
2409  * @code
2410 static int get_app_setting_icon(const char *appid)
2411 {
2412         int ret = 0;
2413         char *setting_icon = NULL;
2414         pkgmgrinfo_appinfo_h handle;
2415         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2416         if (ret != PMINFO_R_OK)
2417                 return -1;
2418         ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2419         if (ret != PMINFO_R_OK) {
2420                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2421                 return -1;
2422         }
2423         printf("setting icon : %s\n", setting_icon);
2424         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2425         return 0;
2426 }
2427  * @endcode
2428  */
2429 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
2430
2431 /**
2432  * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2433  * @brief       This API gets the type of recent image on app-tray
2434  *
2435  * @par         This API is for package-manager client application
2436  * @par Sync (or) Async : Synchronous API
2437  *
2438  * @param[in] handle            pointer to the application info handle.
2439  * @param[out] type             pointer to hold image type
2440  * @return      0 if success, error code(<0) if fail
2441  * @retval      PMINFO_R_OK     success
2442  * @retval      PMINFO_R_EINVAL invalid argument
2443  * @retval      PMINFO_R_ERROR  internal error
2444  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2445  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2446  * @see         pkgmgrinfo_appinfo_get_appid()
2447  * @see         pkgmgrinfo_appinfo_is_multiple()
2448  * @code
2449 static int get_app_recent_image_type(const char *appid)
2450 {
2451         int ret = 0;
2452         pkgmgrinfo_app_recentimage type;
2453         pkgmgrinfo_appinfo_h handle;
2454         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2455         if (ret != PMINFO_R_OK)
2456                 return -1;
2457         ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2458         if (ret != PMINFO_R_OK) {
2459                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2460                 return -1;
2461         }
2462         printf("recent image type: %d\n", type);
2463         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2464         return 0;
2465 }
2466  * @endcode
2467  */
2468 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_recentimage *type);
2469
2470 /**
2471  * @fn  int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
2472                         pkgmgrinfo_app_category_list_cb category_func, void *user_data);
2473  * @brief       This API gets the list of category for a particular application
2474  *
2475  * @par         This API is for package-manager client application
2476  * @par Sync (or) Async : Synchronous API
2477  * @param[in]   handle          pointer to the application info handle.
2478  * @param[in]   category_func           callback function for list
2479  * @param[in] user_data user data to be passed to callback function
2480  * @return      0 if success, error code(<0) if fail
2481  * @retval      PMINFO_R_OK     success
2482  * @retval      PMINFO_R_EINVAL invalid argument
2483  * @retval      PMINFO_R_ERROR  internal error
2484  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2485  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2486  * @code
2487 int category_func(const char *name, void *user_data)
2488 {
2489         if (strcmp(name, (char *)user_data) == 0)
2490                 return -1;
2491         else
2492                 return 0;
2493 }
2494
2495 static int list_category(const char *appid, char *category)
2496 {
2497         int ret = 0;
2498         pkgmgrinfo_appinfo_h handle;
2499         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2500         if (ret != PMINFO_R_OK)
2501                 return -1;
2502         ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
2503         if (ret != PMINFO_R_OK) {
2504                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2505                 return -1;
2506         }
2507         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2508         return 0;
2509 }
2510  * @endcode
2511  */
2512 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
2513                         pkgmgrinfo_app_category_list_cb category_func, void *user_data);
2514
2515
2516 /**
2517  * @fn  int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
2518                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
2519  * @brief       This API gets the list of app-control for a particular application
2520  *
2521  * @par         This API is for package-manager client application
2522  * @par Sync (or) Async : Synchronous API
2523  * @param[in]   handle          pointer to the application info handle.
2524  * @param[in]   appcontrol_func         callback function for list
2525  * @param[in] user_data user data to be passed to callback function
2526  * @return      0 if success, error code(<0) if fail
2527  * @retval      PMINFO_R_OK     success
2528  * @retval      PMINFO_R_EINVAL invalid argument
2529  * @retval      PMINFO_R_ERROR  internal error
2530  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2531  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2532  * @code
2533 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2534 {
2535         int oc = 0;
2536         int i = 0;
2537         char **operation;
2538         pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2539         for (i = 0; i < oc; i++) {
2540                 if (strcmp(operation[i], (char *)user_data) == 0)
2541                         return -1;
2542                 else
2543                         return 0;
2544         }
2545 }
2546
2547 static int check_operation(const char *appid, char *operation)
2548 {
2549         int ret = 0;
2550         pkgmgrinfo_appinfo_h handle;
2551         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2552         if (ret != PMINFO_R_OK)
2553                 return -1;
2554         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2555         if (ret != PMINFO_R_OK) {
2556                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2557                 return -1;
2558         }
2559         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2560         return 0;
2561 }
2562  * @endcode
2563  */
2564 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
2565                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
2566
2567 /**
2568  * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
2569  * @brief       This API gets the application 'nodisplay' value from the app ID
2570  *
2571  * @par         This API is for package-manager client application
2572  * @par Sync (or) Async : Synchronous API
2573  *
2574  * @param[in]   handle  pointer to application info handle
2575  * @param[out] nodisplay                pointer to hold package nodisplay value
2576  * @return      0 if success, error code(<0) if fail
2577  * @retval      PMINFO_R_OK     success
2578  * @retval      PMINFO_R_EINVAL invalid argument
2579  * @retval      PMINFO_R_ERROR  internal error
2580  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2581  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2582  * @see         pkgmgrinfo_appinfo_get_appid()
2583  * @see         pkgmgrinfo_appinfo_is_multiple()
2584  * @code
2585 static int get_app_nodisplay(const char *appid)
2586 {
2587         int ret = 0;
2588         bool nodisplay;
2589         pkgmgrinfo_appinfo_h handle;
2590         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2591         if (ret != PMINFO_R_OK)
2592                 return -1;
2593         ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
2594         if (ret != PMINFO_R_OK) {
2595                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2596                 return -1;
2597         }
2598         printf("app nodisplay: %d\n", nodisplay);
2599         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2600         return 0;
2601 }
2602  * @endcode
2603  */
2604 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h  handle, bool *nodisplay);
2605
2606 /**
2607  * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
2608  * @brief       This API gets the application 'multiple' value from the app ID
2609  *
2610  * @par         This API is for package-manager client application
2611  * @par Sync (or) Async : Synchronous API
2612  *
2613  * @param[in]   handle  pointer to application info handle
2614  * @param[out] multiple         pointer to hold package multiple value
2615  * @return      0 if success, error code(<0) if fail
2616  * @retval      PMINFO_R_OK     success
2617  * @retval      PMINFO_R_EINVAL invalid argument
2618  * @retval      PMINFO_R_ERROR  internal error
2619  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2620  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2621  * @see         pkgmgrinfo_appinfo_get_appid()
2622  * @see         pkgmgrinfo_appinfo_is_nodisplay()
2623  * @code
2624 static int get_app_multiple(const char *appid)
2625 {
2626         int ret = 0;
2627         bool multiple;
2628         pkgmgrinfo_appinfo_h handle;
2629         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2630         if (ret != PMINFO_R_OK)
2631                 return -1;
2632         ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
2633         if (ret != PMINFO_R_OK) {
2634                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2635                 return -1;
2636         }
2637         printf("app multiple: %d\n", multiple);
2638         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2639         return 0;
2640 }
2641  * @endcode
2642  */
2643 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h  handle, bool *multiple);
2644
2645 /**
2646  * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
2647  * @brief       This API gets the application 'taskmanage' value from the app ID
2648  *
2649  * @par         This API is for package-manager client application
2650  * @par Sync (or) Async : Synchronous API
2651  *
2652  * @param[in]   handle  pointer to application info handle
2653  * @param[out] taskmanage               pointer to hold package taskmanage value
2654  * @return      0 if success, error code(<0) if fail
2655  * @retval      PMINFO_R_OK     success
2656  * @retval      PMINFO_R_EINVAL invalid argument
2657  * @retval      PMINFO_R_ERROR  internal error
2658  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2659  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2660  * @see         pkgmgrinfo_appinfo_get_appid()
2661  * @see         pkgmgrinfo_appinfo_is_multiple()
2662  * @code
2663 static int get_app_taskmanage(const char *appid)
2664 {
2665         int ret = 0;
2666         bool taskmanage;
2667         pkgmgrinfo_appinfo_h handle;
2668         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2669         if (ret != PMINFO_R_OK)
2670                 return -1;
2671         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
2672         if (ret != PMINFO_R_OK) {
2673                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2674                 return -1;
2675         }
2676         printf("app taskmanage: %d\n", taskmanage);
2677         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2678         return 0;
2679 }
2680  * @endcode
2681  */
2682 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h  handle, bool *taskmanage);
2683
2684 /**
2685  * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
2686  * @brief       This API gets the application 'hwacceleration' value from the app ID
2687  *
2688  * @par         This API is for package-manager client application
2689  * @par Sync (or) Async : Synchronous API
2690  *
2691  * @param[in]   handle  pointer to application info handle
2692  * @param[out] hwacceleration           pointer to hold package hwacceleration value
2693  * @return      0 if success, error code(<0) if fail
2694  * @retval      PMINFO_R_OK     success
2695  * @retval      PMINFO_R_EINVAL invalid argument
2696  * @retval      PMINFO_R_ERROR  internal error
2697  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2698  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
2699  * @see         pkgmgrinfo_appinfo_get_appid()
2700  * @see         pkgmgrinfo_appinfo_is_multiple()
2701  * @code
2702 static int get_app_hwacceleration(const char *appid)
2703 {
2704         int ret = 0;
2705         pkgmgrinfo_app_hwacceleration hwacceleration;
2706         pkgmgrinfo_appinfo_h handle;
2707         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2708         if (ret != PMINFO_R_OK)
2709                 return -1;
2710         ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
2711         if (ret != PMINFO_R_OK) {
2712                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2713                 return -1;
2714         }
2715         printf("app hwacceleration: %d\n", hwacceleration);
2716         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2717         return 0;
2718 }
2719  * @endcode
2720  */
2721 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
2722
2723 /**
2724  * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
2725  * @brief       This API gets the application 'onboot' value from the app ID
2726  *
2727  * @par         This API is for package-manager client application
2728  * @par Sync (or) Async : Synchronous API
2729  *
2730  * @param[in]   handle  pointer to application info handle
2731  * @param[out] onboot           pointer to hold package onboot value
2732  * @return      0 if success, error code(<0) if fail
2733  * @retval      PMINFO_R_OK     success
2734  * @retval      PMINFO_R_EINVAL invalid argument
2735  * @retval      PMINFO_R_ERROR  internal error
2736  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2737  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2738  * @see         pkgmgrinfo_appinfo_get_appid()
2739  * @see         pkgmgrinfo_appinfo_is_multiple()
2740  * @code
2741 static int get_app_onboot(const char *appid)
2742 {
2743         int ret = 0;
2744         bool onboot;
2745         pkgmgrinfo_appinfo_h handle;
2746         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2747         if (ret != PMINFO_R_OK)
2748                 return -1;
2749         ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
2750         if (ret != PMINFO_R_OK) {
2751                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2752                 return -1;
2753         }
2754         printf("app onboot: %d\n", onboot);
2755         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2756         return 0;
2757 }
2758  * @endcode
2759  */
2760 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h  handle, bool *onboot);
2761
2762 /**
2763  * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
2764  * @brief       This API gets the application 'autorestart' value from the app ID
2765  *
2766  * @par         This API is for package-manager client application
2767  * @par Sync (or) Async : Synchronous API
2768  *
2769  * @param[in]   handle  pointer to application info handle
2770  * @param[out] autorestart              pointer to hold package autorestart value
2771  * @return      0 if success, error code(<0) if fail
2772  * @retval      PMINFO_R_OK     success
2773  * @retval      PMINFO_R_EINVAL invalid argument
2774  * @retval      PMINFO_R_ERROR  internal error
2775  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2776  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2777  * @see         pkgmgrinfo_appinfo_get_appid()
2778  * @see         pkgmgrinfo_appinfo_is_multiple()
2779  * @code
2780 static int get_app_autorestart(const char *appid)
2781 {
2782         int ret = 0;
2783         bool autorestart;
2784         pkgmgrinfo_appinfo_h handle;
2785         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2786         if (ret != PMINFO_R_OK)
2787                 return -1;
2788         ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
2789         if (ret != PMINFO_R_OK) {
2790                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2791                 return -1;
2792         }
2793         printf("app autorestart: %d\n", autorestart);
2794         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2795         return 0;
2796 }
2797  * @endcode
2798  */
2799 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h  handle, bool *autorestart);
2800
2801 /**
2802  * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp)
2803  * @brief       This API gets the value for given application is main app or not from handle
2804  *
2805  * @par         This API is for package-manager client application
2806  * @par Sync (or) Async : Synchronous API
2807  *
2808  * @param[in]   handle  pointer to application info handle
2809  * @param[out] mainapp          pointer to hold package mainapp is or not
2810  * @return      0 if success, error code(<0) if fail
2811  * @retval      PMINFO_R_OK     success
2812  * @retval      PMINFO_R_EINVAL invalid argument
2813  * @retval      PMINFO_R_ERROR  internal error
2814  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2815  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2816  * @see         pkgmgrinfo_appinfo_get_appid()
2817  * @see         pkgmgrinfo_appinfo_is_multiple()
2818  * @code
2819 static int get_app_mainapp(const char *appid)
2820 {
2821         int ret = 0;
2822         bool mainapp;
2823         pkgmgrinfo_appinfo_h handle;
2824         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2825         if (ret != PMINFO_R_OK)
2826                 return -1;
2827         ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
2828         if (ret != PMINFO_R_OK) {
2829                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2830                 return -1;
2831         }
2832         printf("mainapp: %d\n", mainapp);
2833         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2834         return 0;
2835 }
2836  * @endcode
2837  */
2838 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp);
2839
2840 /**
2841  * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
2842  * @brief       This API destroys the application information handle freeing up all the resources
2843  *
2844  * @par         This API is for package-manager client application
2845  * @par Sync (or) Async : Synchronous API
2846  *
2847  * @param[in] handle            pointer to the application info handle.
2848  * @return      0 if success, error code(<0) if fail
2849  * @retval      PMINFO_R_OK     success
2850  * @retval      PMINFO_R_EINVAL invalid argument
2851  * @retval      PMINFO_R_ERROR  internal error
2852  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2853  * @post                None
2854  * @see         pkgmgrinfo_appinfo_get_pkgid()
2855  * @see         pkgmgrinfo_appinfo_is_multiple()
2856  * @code
2857 static int get_app_type(const char *appid)
2858 {
2859         int ret = 0;
2860         char *type = NULL;
2861         pkgmgrinfo_appinfo_h handle;
2862         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2863         if (ret != PMINFO_R_OK)
2864                 return -1;
2865         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2866         if (ret != PMINFO_R_OK) {
2867                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2868                 return -1;
2869         }
2870         printf("apptype: %s\n", type);
2871         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2872         return 0;
2873 }
2874  * @endcode
2875  */
2876 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h  handle);
2877
2878 /**
2879  * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
2880  * @brief       This API creates the application information filter handle from db.  All filter properties will be ANDed.
2881  The query will search the entire application information collected from the manifest file of all the installed packages
2882  *
2883  * @par         This API is for package-manager client application
2884  * @par Sync (or) Async : Synchronous API
2885  *
2886  * @param[out] handle           pointer to the application info filter handle.
2887  * @return      0 if success, error code(<0) if fail
2888  * @retval      PMINFO_R_OK     success
2889  * @retval      PMINFO_R_EINVAL invalid argument
2890  * @retval      PMINFO_R_ERROR  internal error
2891  * @pre         None
2892  * @post                pkgmgrinfo_appinfo_filter_destroy()
2893  * @see         pkgmgrinfo_appinfo_filter_count()
2894  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
2895  * @code
2896 static int get_capp_count()
2897 {
2898         int ret = 0;
2899         int count = 0;
2900         pkgmgrinfo_appinfo_filter_h handle;
2901         ret = pkgmgrinfo_appinfo_filter_create(&handle);
2902         if (ret != PMINFO_R_OK)
2903                 return -1;
2904         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
2905         if (ret != PMINFO_R_OK) {
2906                 pkgmgrinfo_appinfo_filter_destroy(handle);
2907                 return -1;
2908         }
2909         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
2910         if (ret != PMINFO_R_OK) {
2911                 pkgmgrinfo_appinfo_filter_destroy(handle);
2912                 return -1;
2913         }
2914         printf("No of capp: %d\n", count);
2915         pkgmgrinfo_appinfo_filter_destroy(handle);
2916         return 0;
2917 }
2918  * @endcode
2919  */
2920 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
2921
2922 /**
2923  * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
2924  * @brief       This API destroys the application information filter handle freeing up all the resources
2925  *
2926  * @par         This API is for package-manager client application
2927  * @par Sync (or) Async : Synchronous API
2928  *
2929  * @param[in] handle            pointer to the application info filter handle.
2930  * @return      0 if success, error code(<0) if fail
2931  * @retval      PMINFO_R_OK     success
2932  * @retval      PMINFO_R_EINVAL invalid argument
2933  * @retval      PMINFO_R_ERROR  internal error
2934  * @pre         pkgmgrinfo_appinfo_filter_create()
2935  * @post                None
2936  * @see         pkgmgrinfo_appinfo_filter_count()
2937  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
2938  * @code
2939 static int get_capp_count()
2940 {
2941         int ret = 0;
2942         int count = 0;
2943         pkgmgrinfo_appinfo_filter_h handle;
2944         ret = pkgmgrinfo_appinfo_filter_create(&handle);
2945         if (ret != PMINFO_R_OK)
2946                 return -1;
2947         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
2948         if (ret != PMINFO_R_OK) {
2949                 pkgmgrinfo_appinfo_filter_destroy(handle);
2950                 return -1;
2951         }
2952         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
2953         if (ret != PMINFO_R_OK) {
2954                 pkgmgrinfo_appinfo_filter_destroy(handle);
2955                 return -1;
2956         }
2957         printf("No of capp: %d\n", count);
2958         pkgmgrinfo_appinfo_filter_destroy(handle);
2959         return 0;
2960 }
2961  * @endcode
2962  */
2963 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
2964
2965 /**
2966  * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
2967  * @brief       This API adds a boolean filter property to the filter handle
2968  *
2969  * @par         This API is for package-manager client application
2970  * @par Sync (or) Async : Synchronous API
2971  *
2972  * @param[in] handle            pointer to the application info filter handle.
2973  * @param[in] property          boolean property name.
2974  * @param[in] value             value corresponding to the property.
2975  * @return      0 if success, error code(<0) if fail
2976  * @retval      PMINFO_R_OK     success
2977  * @retval      PMINFO_R_EINVAL invalid argument
2978  * @retval      PMINFO_R_ERROR  internal error
2979  * @pre         pkgmgrinfo_appinfo_filter_create()
2980  * @post                pkgmgrinfo_appinfo_filter_destroy()
2981  * @see         pkgmgrinfo_appinfo_filter_count()
2982  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
2983  * @code
2984 static int get_taskmanageable_app_count()
2985 {
2986         int ret = 0;
2987         int count = 0;
2988         pkgmgrinfo_appinfo_filter_h handle;
2989         ret = pkgmgrinfo_appinfo_filter_create(&handle);
2990         if (ret != PMINFO_R_OK)
2991                 return -1;
2992         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
2993         if (ret != PMINFO_R_OK) {
2994                 pkgmgrinfo_appinfo_filter_destroy(handle);
2995                 return -1;
2996         }
2997         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
2998         if (ret != PMINFO_R_OK) {
2999                 pkgmgrinfo_appinfo_filter_destroy(handle);
3000                 return -1;
3001         }
3002         printf("No of taskmanageable apps: %d\n", count);
3003         pkgmgrinfo_appinfo_filter_destroy(handle);
3004         return 0;
3005 }
3006  * @endcode
3007  */
3008 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3009                 const char *property, const bool value);
3010
3011 /**
3012  * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3013  * @brief       This API adds an integer filter property to the filter handle
3014  *
3015  * @par         This API is for package-manager client application
3016  * @par Sync (or) Async : Synchronous API
3017  *
3018  * @param[in] handle            pointer to the application info filter handle.
3019  * @param[in] property          integer property name.
3020  * @param[in] value             value corresponding to the property.
3021  * @return      0 if success, error code(<0) if fail
3022  * @retval      PMINFO_R_OK     success
3023  * @retval      PMINFO_R_EINVAL invalid argument
3024  * @retval      PMINFO_R_ERROR  internal error
3025  * @pre         pkgmgrinfo_appinfo_filter_create()
3026  * @post                pkgmgrinfo_appinfo_filter_destroy()
3027  * @see         pkgmgrinfo_appinfo_filter_count()
3028  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
3029  * @code
3030 static int get_taskmanageable_app_count()
3031 {
3032         int ret = 0;
3033         int count = 0;
3034         pkgmgrinfo_appinfo_filter_h handle;
3035         ret = pkgmgrinfo_appinfo_filter_create(&handle);
3036         if (ret != PMINFO_R_OK)
3037                 return -1;
3038         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3039         if (ret != PMINFO_R_OK) {
3040                 pkgmgrinfo_appinfo_filter_destroy(handle);
3041                 return -1;
3042         }
3043         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3044         if (ret != PMINFO_R_OK) {
3045                 pkgmgrinfo_appinfo_filter_destroy(handle);
3046                 return -1;
3047         }
3048         printf("No of apps: %d\n", count);
3049         pkgmgrinfo_appinfo_filter_destroy(handle);
3050         return 0;
3051 }
3052  * @endcode
3053  */
3054 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3055                 const char *property, const int value);
3056
3057 /**
3058  * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3059  * @brief       This API adds a string filter property to the filter handle
3060  *
3061  * @par         This API is for package-manager client application
3062  * @par Sync (or) Async : Synchronous API
3063  *
3064  * @param[in] handle            pointer to the application info filter handle.
3065  * @param[in] property          string property name.
3066  * @param[in] value             value corresponding to the property.
3067  * @return      0 if success, error code(<0) if fail
3068  * @retval      PMINFO_R_OK     success
3069  * @retval      PMINFO_R_EINVAL invalid argument
3070  * @retval      PMINFO_R_ERROR  internal error
3071  * @pre         pkgmgrinfo_appinfo_filter_create()
3072  * @post                pkgmgrinfo_appinfo_filter_destroy()
3073  * @see         pkgmgrinfo_appinfo_filter_count()
3074  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
3075  * @code
3076 static int get_capp_count()
3077 {
3078         int ret = 0;
3079         int count = 0;
3080         pkgmgrinfo_appinfo_filter_h handle;
3081         ret = pkgmgrinfo_appinfo_filter_create(&handle);
3082         if (ret != PMINFO_R_OK)
3083                 return -1;
3084         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3085         if (ret != PMINFO_R_OK) {
3086                 pkgmgrinfo_appinfo_filter_destroy(handle);
3087                 return -1;
3088         }
3089         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3090         if (ret != PMINFO_R_OK) {
3091                 pkgmgrinfo_appinfo_filter_destroy(handle);
3092                 return -1;
3093         }
3094         printf("No of capp: %d\n", count);
3095         pkgmgrinfo_appinfo_filter_destroy(handle);
3096         return 0;
3097 }
3098  * @endcode
3099  */
3100 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
3101                 const char *property, const char *value);
3102
3103 /**
3104  * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3105  * @brief       This API executes the user supplied callback function for each application that satisfy the filter conditions
3106  *
3107  * @par         This API is for package-manager client application
3108  * @par Sync (or) Async : Synchronous API
3109  *
3110  * @param[in] handle            pointer to the application info filter handle.
3111  * @param[in] app_cb            callback function.
3112  * @param[in] user_data         user data to be passed to the callback function
3113  * @return      0 if success, error code(<0) if fail
3114  * @retval      PMINFO_R_OK     success
3115  * @retval      PMINFO_R_EINVAL invalid argument
3116  * @retval      PMINFO_R_ERROR  internal error
3117  * @pre         pkgmgrinfo_appinfo_filter_create()
3118  * @post                pkgmgrinfo_appinfo_filter_destroy()
3119  * @see         pkgmgrinfo_appinfo_filter_count()
3120  * @code
3121 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3122 {
3123         char *appid = NULL;
3124         pkgmgrinfo_appinfo_get_appid(handle, &appid);
3125         printf("appid : %s\n", appid);
3126         return 0;
3127 }
3128
3129 static int get_capp_list()
3130 {
3131         int ret = 0;
3132         pkgmgrinfo_appinfo_filter_h handle;
3133         ret = pkgmgrinfo_appinfo_filter_create(&handle);
3134         if (ret != PMINFO_R_OK)
3135                 return -1;
3136         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3137         if (ret != PMINFO_R_OK) {
3138                 pkgmgrinfo_appinfo_filter_destroy(handle);
3139                 return -1;
3140         }
3141         ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
3142         if (ret != PMINFO_R_OK) {
3143                 pkgmgrinfo_appinfo_filter_destroy(handle);
3144                 return -1;
3145         }
3146         pkgmgrinfo_appinfo_filter_destroy(handle);
3147         return 0;
3148 }
3149  * @endcode
3150  */
3151 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
3152                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
3153
3154 /**
3155  * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
3156  * @brief       This API counts the application that satisfy the filter conditions
3157  *
3158  * @par         This API is for package-manager client application
3159  * @par Sync (or) Async : Synchronous API
3160  *
3161  * @param[in] handle            pointer to the application info filter handle.
3162  * @param[in] count             pointer to store count value
3163  * @return      0 if success, error code(<0) if fail
3164  * @retval      PMINFO_R_OK     success
3165  * @retval      PMINFO_R_EINVAL invalid argument
3166  * @retval      PMINFO_R_ERROR  internal error
3167  * @pre         pkgmgrinfo_appinfo_filter_create()
3168  * @post                pkgmgrinfo_appinfo_filter_destroy()
3169  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
3170  * @code
3171 static int get_capp_count()
3172 {
3173         int ret = 0;
3174         int count = 0;
3175         pkgmgrinfo_appinfo_filter_h handle;
3176         ret = pkgmgrinfo_appinfo_filter_create(&handle);
3177         if (ret != PMINFO_R_OK)
3178                 return -1;
3179         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3180         if (ret != PMINFO_R_OK) {
3181                 pkgmgrinfo_appinfo_filter_destroy(handle);
3182                 return -1;
3183         }
3184         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3185         if (ret != PMINFO_R_OK) {
3186                 pkgmgrinfo_appinfo_filter_destroy(handle);
3187                 return -1;
3188         }
3189         printf("No of capp: %d\n", count);
3190         pkgmgrinfo_appinfo_filter_destroy(handle);
3191         return 0;
3192 }
3193  * @endcode
3194  */
3195 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
3196
3197 /**
3198  * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
3199  * @brief       This API creates the package cert information handle to get data from db.
3200  *
3201  * @par         This API is for package-manager client application
3202  * @par Sync (or) Async : Synchronous API
3203  *
3204  * @param[out] handle           pointer to the package cert handle.
3205  * @return      0 if success, error code(<0) if fail
3206  * @retval      PMINFO_R_OK     success
3207  * @retval      PMINFO_R_EINVAL invalid argument
3208  * @retval      PMINFO_R_ERROR  internal error
3209  * @pre         None
3210  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
3211  * @see         pkgmgrinfo_pkginfo_get_cert_value()
3212  * @see         pkgmgrinfo_pkginfo_load_certinfo()
3213  * @code
3214 static int get_cert_info(const char *pkgid)
3215 {
3216         int ret = 0;
3217         pkgmgrinfo_certinfo_h handle;
3218         char *auth_cert = NULL;
3219         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3220         if (ret != PMINFO_R_OK)
3221                 return -1;
3222         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3223         if (ret != PMINFO_R_OK) {
3224                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3225                 return -1;
3226         }
3227         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3228         if (ret != PMINFO_R_OK) {
3229                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3230                 return -1;
3231         }
3232         printf("Author root certificate: %s\n", auth_root);
3233         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3234         return 0;
3235 }
3236  * @endcode
3237  */
3238 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
3239
3240 /**
3241  * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
3242  * @brief       This API loads the package cert information handle with data from db.
3243  *
3244  * @par         This API is for package-manager client application
3245  * @par Sync (or) Async : Synchronous API
3246  *
3247  * @param[in] pkgid             pointer to the package ID.
3248  * @param[in] handle            pointer to the package cert handle.
3249  * @return      0 if success, error code(<0) if fail
3250  * @retval      PMINFO_R_OK     success
3251  * @retval      PMINFO_R_EINVAL invalid argument
3252  * @retval      PMINFO_R_ERROR  internal error
3253  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
3254  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
3255  * @see         pkgmgrinfo_pkginfo_get_cert_value()
3256  * @code
3257 static int get_cert_info(const char *pkgid)
3258 {
3259         int ret = 0;
3260         pkgmgrinfo_certinfo_h handle;
3261         char *auth_cert = NULL;
3262         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3263         if (ret != PMINFO_R_OK)
3264                 return -1;
3265         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3266         if (ret != PMINFO_R_OK) {
3267                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3268                 return -1;
3269         }
3270         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3271         if (ret != PMINFO_R_OK) {
3272                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3273                 return -1;
3274         }
3275         printf("Author root certificate: %s\n", auth_root);
3276         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3277         return 0;
3278 }
3279  * @endcode
3280  */
3281 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle);
3282
3283 /**
3284  * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
3285  * @brief       This API gets the package cert information from the handle
3286  *
3287  * @par         This API is for package-manager client application
3288  * @par Sync (or) Async : Synchronous API
3289  *
3290  * @param[in] handle            pointer to the package cert handle.
3291  * @param[in] cert_type         certificate type
3292  * @param[out] cert_value       pointer to hold certificate value
3293  * @return      0 if success, error code(<0) if fail
3294  * @retval      PMINFO_R_OK     success
3295  * @retval      PMINFO_R_EINVAL invalid argument
3296  * @retval      PMINFO_R_ERROR  internal error
3297  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
3298  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
3299  * @see         pkgmgrinfo_pkginfo_load_certinfo()
3300  * @code
3301 static int get_cert_info(const char *pkgid)
3302 {
3303         int ret = 0;
3304         pkgmgrinfo_certinfo_h handle;
3305         char *auth_cert = NULL;
3306         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3307         if (ret != PMINFO_R_OK)
3308                 return -1;
3309         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3310         if (ret != PMINFO_R_OK) {
3311                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3312                 return -1;
3313         }
3314         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3315         if (ret != PMINFO_R_OK) {
3316                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3317                 return -1;
3318         }
3319         printf("Author root certificate: %s\n", auth_root);
3320         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3321         return 0;
3322 }
3323  * @endcode
3324  */
3325 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
3326
3327 /**
3328  * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
3329  * @brief       This API destroys the package cert information handle freeing up all the resources
3330  *
3331  * @par         This API is for package-manager client application
3332  * @par Sync (or) Async : Synchronous API
3333  *
3334  * @param[in] handle            pointer to the package cert handle.
3335  * @return      0 if success, error code(<0) if fail
3336  * @retval      PMINFO_R_OK     success
3337  * @retval      PMINFO_R_EINVAL invalid argument
3338  * @retval      PMINFO_R_ERROR  internal error
3339  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
3340  * @post                None
3341  * @see         pkgmgrinfo_pkginfo_load_certinfo()
3342  * @code
3343 static int get_cert_info(const char *pkgid)
3344 {
3345         int ret = 0;
3346         pkgmgrinfo_certinfo_h handle;
3347         char *auth_cert = NULL;
3348         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3349         if (ret != PMINFO_R_OK)
3350                 return -1;
3351         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3352         if (ret != PMINFO_R_OK) {
3353                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3354                 return -1;
3355         }
3356         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3357         if (ret != PMINFO_R_OK) {
3358                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3359                 return -1;
3360         }
3361         printf("Author root certificate: %s\n", auth_root);
3362         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3363         return 0;
3364 }
3365  * @endcode
3366  */
3367 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
3368
3369 /**
3370  * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
3371  * @brief       This API deletes the package cert information from DB
3372  *
3373  * @par         This API is for package-manager client application
3374  * @par Sync (or) Async : Synchronous API
3375  *
3376  * @param[in] pkgid             pointer to the package ID.
3377  * @return      0 if success, error code(<0) if fail
3378  * @retval      PMINFO_R_OK     success
3379  * @retval      PMINFO_R_EINVAL invalid argument
3380  * @retval      PMINFO_R_ERROR  internal error
3381  * @pre         None
3382  * @post                None
3383  * @code
3384 static int delete_cert_info(const char *pkgid)
3385 {
3386         int ret = 0;
3387         ret = pkgmgrinfo_delete_certinfo(pkgid);
3388         if (ret != PMINFO_R_OK)
3389                 return -1;
3390         return 0;
3391 }
3392  * @endcode
3393  */
3394  int pkgmgrinfo_delete_certinfo(const char *pkgid);
3395
3396 /**
3397  * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
3398  * @brief       This API creates the package db information handle to set data in db.
3399  *
3400  * @par         This API is for package-manager client application
3401  * @par Sync (or) Async : Synchronous API
3402  *
3403  * @param[in] pkgid     pointer to the package ID.
3404  * @param[out] handle           pointer to the package db info handle.
3405  * @return      0 if success, error code(<0) if fail
3406  * @retval      PMINFO_R_OK     success
3407  * @retval      PMINFO_R_EINVAL invalid argument
3408  * @retval      PMINFO_R_ERROR  internal error
3409  * @pre         None
3410  * @post                pkgmgrinfo_destroy_pkgdbinfo()
3411  * @see         pkgmgrinfo_save_pkgdbinfo()
3412  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
3413  * @code
3414 static int set_pkg_in_db(const char *pkgid)
3415 {
3416         int ret = 0;
3417         pkgmgrinfo_pkgdbinfo_h handle;
3418         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3419         if (ret != PMINFO_R_OK)
3420                 return -1;
3421         ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
3422         if (ret != PMINFO_R_OK) {
3423                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3424                 return -1;
3425         }
3426         ret = pkgmgrinfo_save_pkgdbinfo(handle);
3427         if (ret != PMINFO_R_OK) {
3428                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3429                 return -1;
3430         }
3431         pkgmgrinfo_destroy_pkgdbinfo(handle);
3432         return 0;
3433 }
3434  * @endcode
3435  */
3436 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
3437
3438 /**
3439  * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
3440  * @brief       This API sets the package type in db handle
3441  *
3442  * @par         This API is for package-manager client application
3443  * @par Sync (or) Async : Synchronous API
3444  *
3445  * @param[in] handle    pointer to the pkgdbinfo handle.
3446  * @param[in] type              pointer to the package type.
3447  * @return      0 if success, error code(<0) if fail
3448  * @retval      PMINFO_R_OK     success
3449  * @retval      PMINFO_R_EINVAL invalid argument
3450  * @retval      PMINFO_R_ERROR  internal error
3451  * @pre         pkgmgrinfo_create_pkgdbinfo()
3452  * @post                pkgmgrinfo_destroy_pkgdbinfo()
3453  * @see         pkgmgrinfo_save_pkgdbinfo()
3454  * @see         pkgmgrinfo_set_version_to_pkgdbinfo()
3455  * @code
3456 static int set_pkg_type_in_db(const char *pkgid)
3457 {
3458         int ret = 0;
3459         pkgmgrinfo_pkgdbinfo_h handle;
3460         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3461         if (ret != PMINFO_R_OK)
3462                 return -1;
3463         ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
3464         if (ret != PMINFO_R_OK) {
3465                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3466                 return -1;
3467         }
3468         ret = pkgmgrinfo_save_pkgdbinfo(handle);
3469         if (ret != PMINFO_R_OK) {
3470                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3471                 return -1;
3472         }
3473         pkgmgrinfo_destroy_pkgdbinfo(handle);
3474         return 0;
3475 }
3476  * @endcode
3477  */
3478 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
3479
3480 /**
3481  * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
3482  * @brief       This API sets the package version in db handle
3483  *
3484  * @par         This API is for package-manager client application
3485  * @par Sync (or) Async : Synchronous API
3486  *
3487  * @param[in] handle    pointer to the pkgdbinfo handle.
3488  * @param[in] version           pointer to the package version
3489  * @return      0 if success, error code(<0) if fail
3490  * @retval      PMINFO_R_OK     success
3491  * @retval      PMINFO_R_EINVAL invalid argument
3492  * @retval      PMINFO_R_ERROR  internal error
3493  * @pre         pkgmgrinfo_create_pkgdbinfo()
3494  * @post                pkgmgrinfo_destroy_pkgdbinfo()
3495  * @see         pkgmgrinfo_save_pkgdbinfo()
3496  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
3497  * @code
3498 static int set_pkg_version_in_db(const char *pkgid)
3499 {
3500         int ret = 0;
3501         pkgmgrinfo_pkgdbinfo_h handle;
3502         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3503         if (ret != PMINFO_R_OK)
3504                 return -1;
3505         ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
3506         if (ret != PMINFO_R_OK) {
3507                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3508                 return -1;
3509         }
3510         ret = pkgmgrinfo_save_pkgdbinfo(handle);
3511         if (ret != PMINFO_R_OK) {
3512                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3513                 return -1;
3514         }
3515         pkgmgrinfo_destroy_pkgdbinfo(handle);
3516         return 0;
3517 }
3518  * @endcode
3519  */
3520 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
3521
3522 /**
3523  * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
3524  * @brief       This API sets the package install location in db handle
3525  *
3526  * @par         This API is for package-manager client application
3527  * @par Sync (or) Async : Synchronous API
3528  *
3529  * @param[in] handle    pointer to the pkgdbinfo handle.
3530  * @param[in] location  package install location
3531  * @return      0 if success, error code(<0) if fail
3532  * @retval      PMINFO_R_OK     success
3533  * @retval      PMINFO_R_EINVAL invalid argument
3534  * @retval      PMINFO_R_ERROR  internal error
3535  * @pre         pkgmgrinfo_create_pkgdbinfo()
3536  * @post                pkgmgrinfo_destroy_pkgdbinfo()
3537  * @see         pkgmgrinfo_save_pkgdbinfo()
3538  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
3539  * @code
3540 static int set_pkg_install_location_in_db(const char *pkgid)
3541 {
3542         int ret = 0;
3543         pkgmgrinfo_pkgdbinfo_h handle;
3544         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3545         if (ret != PMINFO_R_OK)
3546                 return -1;
3547         ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
3548         if (ret != PMINFO_R_OK) {
3549                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3550                 return -1;
3551         }
3552         ret = pkgmgrinfo_save_pkgdbinfo(handle);
3553         if (ret != PMINFO_R_OK) {
3554                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3555                 return -1;
3556         }
3557         pkgmgrinfo_destroy_pkgdbinfo(handle);
3558         return 0;
3559 }
3560  * @endcode
3561  */
3562 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
3563
3564 /**
3565  * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
3566  * @brief       This API sets the package size in db handle
3567  *
3568  * @par         This API is for package-manager client application
3569  * @par Sync (or) Async : Synchronous API
3570  *
3571  * @param[in] handle    pointer to the pkgdbinfo handle.
3572  * @param[in] size              pointer to the package size
3573  * @return      0 if success, error code(<0) if fail
3574  * @retval      PMINFO_R_OK     success
3575  * @retval      PMINFO_R_EINVAL invalid argument
3576  * @retval      PMINFO_R_ERROR  internal error
3577  * @pre         pkgmgrinfo_create_pkgdbinfo()
3578  * @post                pkgmgrinfo_destroy_pkgdbinfo()
3579  * @see         pkgmgrinfo_save_pkgdbinfo()
3580  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
3581  * @code
3582 static int set_pkg_size_in_db(const char *pkgid)
3583 {
3584         int ret = 0;
3585         pkgmgrinfo_pkgdbinfo_h handle;
3586         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3587         if (ret != PMINFO_R_OK)
3588                 return -1;
3589         ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
3590         if (ret != PMINFO_R_OK) {
3591                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3592                 return -1;
3593         }
3594         ret = pkgmgrinfo_save_pkgdbinfo(handle);
3595         if (ret != PMINFO_R_OK) {
3596                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3597                 return -1;
3598         }
3599         pkgmgrinfo_destroy_pkgdbinfo(handle);
3600         return 0;
3601 }
3602  * @endcode
3603  */
3604 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
3605
3606 /**
3607  * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
3608  * @brief       This API sets the package label in db handle
3609  *
3610  * @par         This API is for package-manager client application
3611  * @par Sync (or) Async : Synchronous API
3612  *
3613  * @param[in] handle    pointer to the pkgdbinfo handle.
3614  * @param[in] label             pointer to the package label
3615  * @param[in] locale    pointer to the locale
3616  * @return      0 if success, error code(<0) if fail
3617  * @retval      PMINFO_R_OK     success
3618  * @retval      PMINFO_R_EINVAL invalid argument
3619  * @retval      PMINFO_R_ERROR  internal error
3620  * @pre         pkgmgrinfo_create_pkgdbinfo()
3621  * @post                pkgmgrinfo_destroy_pkgdbinfo()
3622  * @see         pkgmgrinfo_save_pkgdbinfo()
3623  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
3624  * @code
3625 static int set_pkg_label_in_db(const char *pkgid)
3626 {
3627         int ret = 0;
3628         pkgmgrinfo_pkgdbinfo_h handle;
3629         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3630         if (ret != PMINFO_R_OK)
3631                 return -1;
3632         ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
3633         if (ret != PMINFO_R_OK) {
3634                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3635                 return -1;
3636         }
3637         ret = pkgmgrinfo_save_pkgdbinfo(handle);
3638         if (ret != PMINFO_R_OK) {
3639                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3640                 return -1;
3641         }
3642         pkgmgrinfo_destroy_pkgdbinfo(handle);
3643         return 0;
3644 }
3645  * @endcode
3646  */
3647 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
3648
3649 /**
3650  * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
3651  * @brief       This API sets the package icon in db handle
3652  *
3653  * @par         This API is for package-manager client application
3654  * @par Sync (or) Async : Synchronous API
3655  *
3656  * @param[in] handle    pointer to the pkgdbinfo handle.
3657  * @param[in] icon              pointer to the package icon
3658  * @param[in] locale    pointer to the locale
3659  * @return      0 if success, error code(<0) if fail
3660  * @retval      PMINFO_R_OK     success
3661  * @retval      PMINFO_R_EINVAL invalid argument
3662  * @retval      PMINFO_R_ERROR  internal error
3663  * @pre         pkgmgrinfo_create_pkgdbinfo()
3664  * @post                pkgmgrinfo_destroy_pkgdbinfo()
3665  * @see         pkgmgrinfo_save_pkgdbinfo()
3666  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
3667  * @code
3668 static int set_pkg_icon_in_db(const char *pkgid)
3669 {
3670         int ret = 0;
3671         pkgmgrinfo_pkgdbinfo_h handle;
3672         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3673         if (ret != PMINFO_R_OK)
3674                 return -1;
3675         ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
3676         if (ret != PMINFO_R_OK) {
3677                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3678                 return -1;
3679         }
3680         ret = pkgmgrinfo_save_pkgdbinfo(handle);
3681         if (ret != PMINFO_R_OK) {
3682                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3683                 return -1;
3684         }
3685         pkgmgrinfo_destroy_pkgdbinfo(handle);
3686         return 0;
3687 }
3688  * @endcode
3689  */
3690 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
3691
3692 /**
3693  * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
3694  * @brief       This API sets the package description in db handle
3695  *
3696  * @par         This API is for package-manager client application
3697  * @par Sync (or) Async : Synchronous API
3698  *
3699  * @param[in] handle    pointer to the pkgdbinfo handle.
3700  * @param[in] description               pointer to the package description
3701  * @param[in] locale    pointer to the locale
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         pkgmgrinfo_create_pkgdbinfo()
3707  * @post                pkgmgrinfo_destroy_pkgdbinfo()
3708  * @see         pkgmgrinfo_save_pkgdbinfo()
3709  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
3710  * @code
3711 static int set_pkg_description_in_db(const char *pkgid)
3712 {
3713         int ret = 0;
3714         pkgmgrinfo_pkgdbinfo_h handle;
3715         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3716         if (ret != PMINFO_R_OK)
3717                 return -1;
3718         ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
3719         if (ret != PMINFO_R_OK) {
3720                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3721                 return -1;
3722         }
3723         ret = pkgmgrinfo_save_pkgdbinfo(handle);
3724         if (ret != PMINFO_R_OK) {
3725                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3726                 return -1;
3727         }
3728         pkgmgrinfo_destroy_pkgdbinfo(handle);
3729         return 0;
3730 }
3731  * @endcode
3732  */
3733 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
3734
3735 /**
3736  * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
3737  const char *author_email, const char *author_href, const char *locale)
3738  * @brief       This API sets the package author info in db handle
3739  *
3740  * @par         This API is for package-manager client application
3741  * @par Sync (or) Async : Synchronous API
3742  *
3743  * @param[in] handle    pointer to the pkgdbinfo handle.
3744  * @param[in] author_name               pointer to the package author name
3745  * @param[in] author_email              pointer to the package author email
3746  * @param[in] author_href               pointer to the package author href
3747  * @param[in] locale    pointer to the locale
3748  * @return      0 if success, error code(<0) if fail
3749  * @retval      PMINFO_R_OK     success
3750  * @retval      PMINFO_R_EINVAL invalid argument
3751  * @retval      PMINFO_R_ERROR  internal error
3752  * @pre         pkgmgrinfo_create_pkgdbinfo()
3753  * @post                pkgmgrinfo_destroy_pkgdbinfo()
3754  * @see         pkgmgrinfo_save_pkgdbinfo()
3755  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
3756  * @code
3757 static int set_pkg_author_in_db(const char *pkgid)
3758 {
3759         int ret = 0;
3760         pkgmgrinfo_pkgdbinfo_h handle;
3761         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3762         if (ret != PMINFO_R_OK)
3763                 return -1;
3764         ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
3765         if (ret != PMINFO_R_OK) {
3766                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3767                 return -1;
3768         }
3769         ret = pkgmgrinfo_save_pkgdbinfo(handle);
3770         if (ret != PMINFO_R_OK) {
3771                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3772                 return -1;
3773         }
3774         pkgmgrinfo_destroy_pkgdbinfo(handle);
3775         return 0;
3776 }
3777  * @endcode
3778  */
3779 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
3780                         const char *author_email, const char *author_href, const char *locale);
3781
3782 /**
3783  * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
3784  * @brief       This API sets the package 'removable' value in db handle
3785  *
3786  * @par         This API is for package-manager client application
3787  * @par Sync (or) Async : Synchronous API
3788  *
3789  * @param[in] handle    pointer to the pkgdbinfo handle.
3790  * @param[in] removable         package removable value
3791  * @return      0 if success, error code(<0) if fail
3792  * @retval      PMINFO_R_OK     success
3793  * @retval      PMINFO_R_EINVAL invalid argument
3794  * @retval      PMINFO_R_ERROR  internal error
3795  * @pre         pkgmgrinfo_create_pkgdbinfo()
3796  * @post                pkgmgrinfo_destroy_pkgdbinfo()
3797  * @see         pkgmgrinfo_save_pkgdbinfo()
3798  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
3799  * @code
3800 static int set_pkg_removable_in_db(const char *pkgid)
3801 {
3802         int ret = 0;
3803         pkgmgrinfo_pkgdbinfo_h handle;
3804         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3805         if (ret != PMINFO_R_OK)
3806                 return -1;
3807         ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
3808         if (ret != PMINFO_R_OK) {
3809                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3810                 return -1;
3811         }
3812         ret = pkgmgrinfo_save_pkgdbinfo(handle);
3813         if (ret != PMINFO_R_OK) {
3814                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3815                 return -1;
3816         }
3817         pkgmgrinfo_destroy_pkgdbinfo(handle);
3818         return 0;
3819 }
3820  * @endcode
3821  */
3822 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
3823
3824 /**
3825  * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
3826  * @brief       This API sets the package 'preload' value in db handle
3827  *
3828  * @par         This API is for package-manager client application
3829  * @par Sync (or) Async : Synchronous API
3830  *
3831  * @param[in] handle    pointer to the pkgdbinfo handle.
3832  * @param[in] preload           package preload value
3833  * @return      0 if success, error code(<0) if fail
3834  * @retval      PMINFO_R_OK     success
3835  * @retval      PMINFO_R_EINVAL invalid argument
3836  * @retval      PMINFO_R_ERROR  internal error
3837  * @pre         pkgmgrinfo_create_pkgdbinfo()
3838  * @post                pkgmgrinfo_destroy_pkgdbinfo()
3839  * @see         pkgmgrinfo_save_pkgdbinfo()
3840  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
3841  * @code
3842 static int set_pkg_preload_in_db(const char *pkgid)
3843 {
3844         int ret = 0;
3845         pkgmgrinfo_pkgdbinfo_h handle;
3846         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3847         if (ret != PMINFO_R_OK)
3848                 return -1;
3849         ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
3850         if (ret != PMINFO_R_OK) {
3851                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3852                 return -1;
3853         }
3854         ret = pkgmgrinfo_save_pkgdbinfo(handle);
3855         if (ret != PMINFO_R_OK) {
3856                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3857                 return -1;
3858         }
3859         pkgmgrinfo_destroy_pkgdbinfo(handle);
3860         return 0;
3861 }
3862  * @endcode
3863  */
3864 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
3865
3866 /**
3867  * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
3868  * @brief       This API saves all the information from the handle to the DB.
3869  *
3870  * @par         This API is for package-manager client application
3871  * @par Sync (or) Async : Synchronous API
3872  *
3873  * @param[in] handle            pointer to the package db info handle.
3874  * @return      0 if success, error code(<0) if fail
3875  * @retval      PMINFO_R_OK     success
3876  * @retval      PMINFO_R_EINVAL invalid argument
3877  * @retval      PMINFO_R_ERROR  internal error
3878  * @pre         pkgmgrinfo_create_pkgdbinfo()
3879  * @post                pkgmgrinfo_destroy_pkgdbinfo()
3880  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
3881  * @code
3882 static int set_pkg_in_db(const char *pkgid)
3883 {
3884         int ret = 0;
3885         pkgmgrinfo_pkgdbinfo_h handle;
3886         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3887         if (ret != PMINFO_R_OK)
3888                 return -1;
3889         ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
3890         if (ret != PMINFO_R_OK) {
3891                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3892                 return -1;
3893         }
3894         ret = pkgmgrinfo_save_pkgdbinfo(handle);
3895         if (ret != PMINFO_R_OK) {
3896                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3897                 return -1;
3898         }
3899         pkgmgrinfo_destroy_pkgdbinfo(handle);
3900         return 0;
3901 }
3902  * @endcode
3903  */
3904 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
3905
3906 /**
3907  * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
3908  * @brief       This API destroys the package db information handle freeing up all the resources
3909  *
3910  * @par         This API is for package-manager client application
3911  * @par Sync (or) Async : Synchronous API
3912  *
3913  * @param[in] handle            pointer to the package db info handle.
3914  * @return      0 if success, error code(<0) if fail
3915  * @retval      PMINFO_R_OK     success
3916  * @retval      PMINFO_R_EINVAL invalid argument
3917  * @retval      PMINFO_R_ERROR  internal error
3918  * @pre         pkgmgrinfo_create_pkgdbinfo()
3919  * @post                None
3920  * @see         pkgmgrinfo_save_pkgdbinfo()
3921  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
3922  * @code
3923 static int set_pkg_in_db(const char *pkgid)
3924 {
3925         int ret = 0;
3926         pkgmgrinfo_pkgdbinfo_h handle;
3927         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3928         if (ret != PMINFO_R_OK)
3929                 return -1;
3930         ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
3931         if (ret != PMINFO_R_OK) {
3932                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3933                 return -1;
3934         }
3935         ret = pkgmgrinfo_save_pkgdbinfo(handle);
3936         if (ret != PMINFO_R_OK) {
3937                 pkgmgrinfo_destroy_pkgdbinfo(handle);
3938                 return -1;
3939         }
3940         pkgmgrinfo_destroy_pkgdbinfo(handle);
3941         return 0;
3942 }
3943  * @endcode
3944  */
3945 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
3946
3947 /**
3948  * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
3949  * @brief       This API creates the package cert information handle to set data in db.
3950  *
3951  * @par         This API is for package-manager client application
3952  * @par Sync (or) Async : Synchronous API
3953  *
3954  * @param[out] handle           pointer to the package cert handle.
3955  * @return      0 if success, error code(<0) if fail
3956  * @retval      PMINFO_R_OK     success
3957  * @retval      PMINFO_R_EINVAL invalid argument
3958  * @retval      PMINFO_R_ERROR  internal error
3959  * @pre         None
3960  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
3961  * @see         pkgmgrinfo_set_cert_value()
3962  * @see         pkgmgrinfo_save_certinfo()
3963  * @code
3964 static int set_cert_in_db(const char *pkgid)
3965 {
3966         int ret = 0;
3967         pkgmgrinfo_instcertinfo_h handle;
3968         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
3969         if (ret != PMINFO_R_OK)
3970                 return -1;
3971         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
3972         if (ret != PMINFO_R_OK) {
3973                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
3974                 return -1;
3975         }
3976         ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
3977         if (ret != PMINFO_R_OK) {
3978                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
3979                 return -1;
3980         }
3981         pkgmgrinfo_destroy_certinfo_set_handle(handle);
3982         return 0;
3983 }
3984  * @endcode
3985  */
3986 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
3987
3988 /**
3989  * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
3990  * @brief       This API sets the package cert information in the handle.
3991  *
3992  * @par         This API is for package-manager client application
3993  * @par Sync (or) Async : Synchronous API
3994  *
3995  * @param[in] handle            pointer to the package cert handle.
3996  * @param[in] cert_type         certificate type.
3997  * @param[in] cert_value        certificate value.
3998  * @return      0 if success, error code(<0) if fail
3999  * @retval      PMINFO_R_OK     success
4000  * @retval      PMINFO_R_EINVAL invalid argument
4001  * @retval      PMINFO_R_ERROR  internal error
4002  * @pre         pkgmgrinfo_create_certinfo_set_handle()
4003  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
4004  * @see         pkgmgrinfo_save_certinfo()
4005  * @code
4006 static int set_cert_in_db(const char *pkgid)
4007 {
4008         int ret = 0;
4009         pkgmgrinfo_instcertinfo_h handle;
4010         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4011         if (ret != PMINFO_R_OK)
4012                 return -1;
4013         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4014         if (ret != PMINFO_R_OK) {
4015                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4016                 return -1;
4017         }
4018         ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4019         if (ret != PMINFO_R_OK) {
4020                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4021                 return -1;
4022         }
4023         pkgmgrinfo_destroy_certinfo_set_handle(handle);
4024         return 0;
4025 }
4026  * @endcode
4027  */
4028 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
4029
4030 /**
4031  * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
4032  * @brief       This API saves the package cert information in the DB.
4033  *
4034  * @par         This API is for package-manager client application
4035  * @par Sync (or) Async : Synchronous API
4036  *
4037  * @param[in] pkgid             pointer to the package ID.
4038  * @param[in] handle            pointer to the package cert handle.
4039  * @return      0 if success, error code(<0) if fail
4040  * @retval      PMINFO_R_OK     success
4041  * @retval      PMINFO_R_EINVAL invalid argument
4042  * @retval      PMINFO_R_ERROR  internal error
4043  * @pre         pkgmgrinfo_create_certinfo_set_handle()
4044  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
4045  * @see         pkgmgrinfo_save_certinfo()
4046  * @code
4047 static int set_cert_in_db(const char *pkgid)
4048 {
4049         int ret = 0;
4050         pkgmgrinfo_instcertinfo_h handle;
4051         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4052         if (ret != PMINFO_R_OK)
4053                 return -1;
4054         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4055         if (ret != PMINFO_R_OK) {
4056                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4057                 return -1;
4058         }
4059         ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4060         if (ret != PMINFO_R_OK) {
4061                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4062                 return -1;
4063         }
4064         pkgmgrinfo_destroy_certinfo_set_handle(handle);
4065         return 0;
4066 }
4067  * @endcode
4068  */
4069 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle);
4070
4071 /**
4072  * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
4073  * @brief       This API destroys the package cert information handle freeing up all the resources.
4074  *
4075  * @par         This API is for package-manager client application
4076  * @par Sync (or) Async : Synchronous API
4077  *
4078  * @param[in] handle            pointer to the package cert handle.
4079  * @return      0 if success, error code(<0) if fail
4080  * @retval      PMINFO_R_OK     success
4081  * @retval      PMINFO_R_EINVAL invalid argument
4082  * @retval      PMINFO_R_ERROR  internal error
4083  * @pre         pkgmgrinfo_create_certinfo_set_handle()
4084  * @post                None
4085  * @see         pkgmgrinfo_save_certinfo()
4086  * @code
4087 static int set_cert_in_db(const char *pkgid)
4088 {
4089         int ret = 0;
4090         pkgmgrinfo_instcertinfo_h handle;
4091         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4092         if (ret != PMINFO_R_OK)
4093                 return -1;
4094         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4095         if (ret != PMINFO_R_OK) {
4096                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4097                 return -1;
4098         }
4099         ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4100         if (ret != PMINFO_R_OK) {
4101                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4102                 return -1;
4103         }
4104         pkgmgrinfo_destroy_certinfo_set_handle(handle);
4105         return 0;
4106 }
4107  * @endcode
4108  */
4109 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
4110
4111 /**
4112  * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
4113  * @brief       This API gets the datacontrol info
4114  *
4115  * @par         This API is for package-manager client application
4116  * @par Sync (or) Async : Synchronous API
4117  *
4118  * @param[in] providerid                pointer to the providerid of dataconltrol.
4119  * @param[in] type                      pointer to the type of dataconltrol.
4120  * @param[out] appid                    pointer to hold appid, need to free after using
4121  * @param[out] access                   pointer to hold access, need to free after using
4122  * @return      0 if success, error code(<0) if fail
4123  * @retval      PMINFO_R_OK     success
4124  * @retval      PMINFO_R_EINVAL invalid argument
4125  * @retval      PMINFO_R_ERROR  internal error
4126  * @endcode
4127  */
4128 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
4129
4130 /** @} */
4131 #ifdef __cplusplus
4132 }
4133 #endif
4134 #endif                          /* __PKG_INFO_H__ */
4135 /**
4136  * @}
4137  * @}
4138  */
4139