Add new APIs for register, unregister and get pkg update info
[platform/core/api/package-manager.git] / include / package_info.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18 #ifndef __TIZEN_APPFW_PACKAGE_INFO_H
19 #define __TIZEN_APPFW_PACKAGE_INFO_H
20
21 #include <tizen.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /**
28  * @file package_info.h
29  */
30
31 /**
32  * @addtogroup CAPI_PACKAGE_INFO_MODULE
33  * @{
34  */
35
36
37 /**
38  * @brief The package information handle.
39  * @since_tizen 2.3
40  */
41 typedef struct package_info_s *package_info_h;
42
43 /**
44  * @brief The package update information handle.
45  * @since_tizen 4.0
46  */
47 typedef struct package_update_info_s *package_update_info_h;
48
49 /**
50  * @brief Enumeration for storage type.
51  * @since_tizen 2.3
52  */
53 typedef enum {
54         PACKAGE_INFO_INTERNAL_STORAGE = 0,    /**< Internal storage */
55         PACKAGE_INFO_EXTERNAL_STORAGE = 1,    /**< External storage */
56 } package_info_installed_storage_type_e;
57
58
59 /**
60  * @brief Enumeration for app component type.
61  * @since_tizen 2.3
62  */
63 typedef enum {
64         PACKAGE_INFO_ALLAPP = 0,        /**< All application */
65         PACKAGE_INFO_UIAPP = 1,         /**< UI application */
66         PACKAGE_INFO_SERVICEAPP = 2,    /**< Service application */
67 } package_info_app_component_type_e;
68
69
70 /**
71  * @brief Enumeration for certification type.
72  * @since_tizen 2.3
73  */
74 typedef enum {
75         PACKAGE_INFO_AUTHOR_ROOT_CERT = 0,               /**< Author Root Certificate*/
76         PACKAGE_INFO_AUTHOR_INTERMEDIATE_CERT = 1,       /**< Author Intermediate Certificate*/
77         PACKAGE_INFO_AUTHOR_SIGNER_CERT = 2,             /**< Author Signer Certificate*/
78         PACKAGE_INFO_DISTRIBUTOR_ROOT_CERT = 3,          /**< Distributor Root Certificate*/
79         PACKAGE_INFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4,  /**< Distributor Intermediate Certificate*/
80         PACKAGE_INFO_DISTRIBUTOR_SIGNER_CERT = 5,        /**< Distributor Signer Certificate*/
81         PACKAGE_INFO_DISTRIBUTOR2_ROOT_CERT = 6,         /**< Distributor2 Root Certificate*/
82         PACKAGE_INFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< Distributor2 Intermediate Certificate*/
83         PACKAGE_INFO_DISTRIBUTOR2_SIGNER_CERT = 8,       /**< Distributor2 Signer Certificate*/
84 } package_cert_type_e;
85
86 /**
87  * @brief Enumeration for package update info type.
88  * @since_tizen 4.0
89  */
90 typedef enum {
91         PACKAGE_UPDATEINFO_TYPE_NONE = 0,   /**< None type */
92         PACKAGE_UPDATEINFO_TYPE_FORCE,      /**< Force type */
93         PACKAGE_UPDATEINFO_TYPE_OPTIONAL    /**< Optional type */
94 } package_update_info_type_e;
95
96 /**
97  * @brief Called for each update information of all packages.
98  * @since_tizen 4.0
99  * @param[in] package_updateinfo   The application update information handle
100  * @param[in] user_data            The user data passed from the foreach function
101  * @return @c true to continue with the next iteration of the loop,
102  *         otherwise @c false to break out of the loop
103  * @pre package_info_updateinfo_foreach_updateinfo() will invoke this callback.
104  * @see package_info_updateinfo_foreach_updateinfo()
105  */
106 typedef bool (*package_info_updateinfo_cb) (package_update_info_h package_updateinfo, void *user_data);
107
108 /**
109  * @brief Called to get the application ID once for each installed package.
110  * @since_tizen 2.3
111  * @param[in] comp_type The Application Component type
112  * @param[in] callback  The callback function to be invoked
113  * @param[in] user_data The user data passed from the foreach function
114  * @return @c true to continue with the next iteration of the loop,
115  *         otherwise @c false to break out of the loop
116  * @pre package_info_foreach_app_from_package() will invoke this callback.
117  * @see package_info_foreach_app_from_package()
118  */
119 typedef bool (*package_info_app_cb) (package_info_app_component_type_e comp_type, const char *app_id, void *user_data);
120
121
122 /**
123  * @brief Called to get the certification information.
124  * @since_tizen 2.3
125  * @param[in] package_info The package info handle
126  * @param[in] cert_type    The certificate type
127  * @param[in] cert_value   The certificate value of corresponding certificate key \n
128  *                         This value is base64 encoded data.
129  * @param[in] user_data    The user data passed from the foreach function
130  * @return @c true to continue with the next iteration of the loop,
131  *         otherwise @c false to break out of the loop
132  * @pre package_info_foreach_cert_info() will invoke this callback.
133  * @see package_info_foreach_cert_info()
134  */
135 typedef bool (*package_info_cert_info_cb) (package_info_h handle, package_cert_type_e cert_type, const char *cert_value, void *user_data);
136
137
138 /**
139  * @brief Called to get the privilege information.
140  * @since_tizen 2.3
141  * @param[in] privilege_name the name of the privilege
142  * @param[in] user_data    The user data passed from the foreach function
143  * @return  @c true to continue with the next iteration of the loop,
144  *          otherwise @c false to break out of the loop
145  * @pre package_info_foreach_privilege_info() will invoke this callback.
146  * @see package_info_foreach_privilege_info()
147  */
148 typedef bool (*package_info_privilege_info_cb) (const char *privilege_name, void *user_data);
149
150
151 /**
152  * @brief Retrieves all application IDs of each package.
153  * @since_tizen 2.3
154  * @param[in] package_info  The package info handle
155  * @param[in] comp_type     The application component type
156  * @param[in] callback      The callback function to invoke
157  * @param[in] user_data     The user data to be passed to the callback function
158  * @return @c 0 on success,
159  *         otherwise a negative error value
160  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
161  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
162  * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE   No such package
163  * @post This function invokes package_info_app_cb() repeatedly for each package.
164  * @see package_info_app_cb()
165  */
166 int package_info_foreach_app_from_package(package_info_h package_info, package_info_app_component_type_e comp_type, package_info_app_cb callback, void *user_data);
167
168
169 /**
170  * @brief Destroys the package information handle and releases all its resources.
171  * @since_tizen 2.3
172  * @param[in] package_info The package information handle
173  * @return @c 0 on success,
174  *         otherwise a negative error value
175  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
176  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
177  * @see package_manager_foreach_package_info()
178  * @see package_manager_get_package_info()
179  */
180 int package_info_destroy(package_info_h package_info);
181
182
183 /**
184  * @brief Gets the package name.
185  * @since_tizen 2.3
186  * @remarks You must release @a package using free().
187  * @param[in]  package_info The package information
188  * @param[out] package      The package name
189  * @return @c 0 on success,
190  *         otherwise a negative error value
191  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
192  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
193  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
194  */
195 int package_info_get_package(package_info_h package_info, char **package);
196
197
198 /**
199  * @brief Gets the main application ID of the package.
200  * @since_tizen 4.0
201  * @remarks You must release @a main_app_id using free().
202  * @param[in]  package_info     The package information
203  * @param[out] main_app_id      The main application ID of the package
204  * @return @c 0 on success,
205  *         otherwise a negative error value
206  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
207  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
208  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
209  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
210  */
211 int package_info_get_main_app_id(package_info_h package_info, char **main_app_id);
212
213
214 /**
215  * @brief Gets the label of the package.
216  * @since_tizen 2.3
217  * @remarks You must release @a label using free().
218  * @param[in]  package_info The package information
219  * @param[out] label        The label of the package
220  * @return @c 0 on success,
221  *         otherwise a negative error value
222  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
223  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
224  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
225  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
226  */
227 int package_info_get_label(package_info_h package_info, char **label);
228
229
230 /**
231  * @brief Gets the absolute path to the icon image.
232  * @since_tizen 2.3
233  * @remarks You must release @a path using free().
234  * @param[in]  package_info The package information
235  * @param[out] path         The path of the package
236  * @return @c 0 on success,
237  *         otherwise a negative error value
238  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
239  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
240  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
241  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
242  */
243 int package_info_get_icon(package_info_h package_info, char **path);
244
245
246 /**
247  * @brief Gets the version of the package.
248  * @since_tizen 2.3
249  * @remarks You must release @a version using free().
250  * @param[in]  package_info The package information
251  * @param[out] version      The version of the package
252  * @return @c 0 on success,
253  *         otherwise a negative error value
254  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
255  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
256  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
257  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
258  */
259 int package_info_get_version(package_info_h package_info, char **version);
260
261
262 /**
263  * @brief Gets the type of the package.
264  * @since_tizen 2.3
265  * @remarks You must release @a type using free().
266  * @param[in]  package_info The package information
267  * @param[out] type         The type of the package
268  * @return @c 0 on success,
269  *         otherwise a negative error value
270  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
271  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
272  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
273  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
274  */
275 int package_info_get_type(package_info_h package_info, char **type);
276
277
278 /**
279  * @brief Gets the installed storage for the given package.
280  * @since_tizen 2.3
281  * @param[in]  package_info The package information
282  * @param[out] storage      The installed storage
283  * @return @c 0 on success,
284  *         otherwise a negative error value
285  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
286  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
287  */
288 int package_info_get_installed_storage(package_info_h package_info, package_info_installed_storage_type_e *storage);
289
290
291 /**
292  * @brief Gets the root path of the package.
293  * @since_tizen 2.3
294  * @remarks You must release @a path using free().
295  * @param[in]  package_info The package information
296  * @param[out] path         The root path of the package
297  * @return @c 0 on success,
298  *         otherwise a negative error value
299  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
300  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
301  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
302  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
303  */
304 int package_info_get_root_path(package_info_h package_info, char **path);
305
306
307 /**
308  * @platform
309  * @brief Gets the name of the TEP(Tizen Expansion Package).
310  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
311  * @privlevel platform
312  * @privilege %http://tizen.org/privilege/packagemanager.admin
313  * @remarks Name must be released using free().
314  * @param[in] package_info The package information
315  * @param[out] name The name of the tep
316  * @return 0 on success,
317  *         otherwise a negative error value
318  * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
319  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
320  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
321  * @retval #PACKAGE_MANAGER_ERROR_SYSTEM_ERROR           Severe system error
322  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
323  */
324 int package_info_get_tep_name(package_info_h package_info, char **name);
325
326
327 /**
328  * @brief Checks whether the package is system package.
329  * @since_tizen 2.3
330  * @param[in]  package_info The package information
331  * @param[out] system       @c true if the package is system package,
332  *                          otherwise @c false if the package is not system package
333  * @return @c 0 on success,
334  *         otherwise a negative error value
335  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
336  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
337  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
338  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
339  */
340 int package_info_is_system_package(package_info_h package_info, bool *system);
341
342
343 /**
344  * @brief Checks whether the package is removable.
345  * @since_tizen 2.3
346  * @param[in]  package_info The package information
347  * @param[out] removable    The removable info of the package
348  * @return @c 0 on success,
349  *         otherwise a negative error value
350  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
351  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
352  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
353  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR IO error
354  */
355 int package_info_is_removable_package(package_info_h package_info, bool *removable);
356
357
358 /**
359  * @brief Checks whether the package is preloaded.
360  * @since_tizen 2.3
361  * @param[in]  package_info The package information
362  * @param[out] preload      The preload info of the package
363  * @return @c 0 on success,
364  *         otherwise a negative error value
365  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
366  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
367  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
368  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
369  */
370 int package_info_is_preload_package(package_info_h package_info, bool *preload);
371
372
373 /**
374  * @brief Checks whether two package information is equal.
375  * @since_tizen 2.3
376  * @param[in]  lhs    The first package information to be compared
377  * @param[in]  rhs    The second package information to be compared
378  * @param[out] equal  @c true if the package information are equal,
379  *                    otherwise @c false if package information are not equal
380  * @return @c 0 on success,
381  *         otherwise a negative error value
382  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
383  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
384  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
385  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          Database error occurred
386  */
387 int package_info_is_equal(package_info_h lhs, package_info_h rhs, bool *equal);
388
389
390 /**
391  * @brief Checks whether the package info is accessible for the given package.
392  * @since_tizen 2.3
393  * @param[in]  package_info The package information
394  * @param[out] accessible   @c true if the package info is accessible,
395  *                          otherwise @c false if the package info is not accessible
396  * @return @c 0 on success,
397  *         otherwise a negative error value
398  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
399  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
400  */
401 int package_info_is_accessible(package_info_h package_info, bool *accessible);
402
403 /**
404  * @brief Gets the installed time for the given package.
405  * @details If the package was updated, the @a installed_time represents updated time.
406  *          So, the meaning of 'installed time' corresponds with 'last modified time'.
407  * @since_tizen 4.0
408  * @param[in]  package_info   The package information
409  * @param[out] installed_time The integer value of time_t type for installed time
410  * @return @c 0 on success,
411  *         otherwise a negative error value
412  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
413  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
414  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          Database error occurred
415  */
416 int package_info_get_installed_time(package_info_h package_info, int *installed_time);
417
418 /**
419  * @brief Clones the package information handle.
420  * @since_tizen 2.3
421  * @param[out] clone          The newly created package information handle
422  * @param[in]  package_info   The package information
423  * @return @c 0 on success,
424  *         otherwise a negative error value
425  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
426  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
427  * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE   The package is not installed
428  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
429  */
430 int package_info_clone(package_info_h *clone, package_info_h package_info);
431
432 /**
433  * @brief Gets the package information for the given package
434  * @since_tizen 2.3
435  * @remarks You must release @a package_info using package_info_destroy().
436  * @param[in]  package      The ID of the package
437  * @param[out] package_info The package information for the given package ID
438  * @return @c 0 on success,
439  *         otherwise a negative error value
440  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
441  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
442  * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE   The package is not installed
443  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
444  */
445 int package_info_create(const char *package, package_info_h *package_info);
446
447
448 /**
449  * @brief Retrieves certification information of the package.
450  * @since_tizen 2.3
451  * @param[in] package_info The package information
452  * @param[in] callback     The iteration callback function
453  * @param[in] user_data    The user data to be passed to the callback function
454  * @return @c 0 on success,
455  *         otherwise a negative error value
456  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
457  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
458  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
459  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
460  */
461 int package_info_foreach_cert_info(package_info_h package_info, package_info_cert_info_cb callback, void *user_data);
462
463
464 /**
465  * @brief Retrieves privilege information of the package.
466  * @since_tizen 2.3
467  * @param[in] package_info The package information
468  * @param[in] callback     The iteration callback function
469  * @param[in] user_data    The user data to be passed to the callback function
470  * @return @c 0 on success,
471  *         otherwise a negative error value
472  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
473  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
474  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
475  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
476  */
477 int package_info_foreach_privilege_info(package_info_h package_info, package_info_privilege_info_cb callback, void *user_data);
478
479 /**
480  * @brief Gets the package update information for the given package.
481  * @since_tizen 4.0
482  * @remarks You must release @a package_updateinfo using package_info_updateinfo_destroy().
483  * @param[in] pkgid                The ID of the package
484  * @param[out] package_updateinfo  The package update information for the given package ID
485  * @return @c 0 on success,
486  *         otherwise a negative error value
487  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
488  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
489  * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE   The package is not installed
490  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
491  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          Database error occurred
492  * @see package_info_updateinfo_destroy()
493  */
494 int package_info_updateinfo_create(const char *pkgid, package_update_info_h *package_updateinfo);
495
496 /**
497  * @brief Gets the package name.
498  * @since_tizen 4.0
499  * @remarks You must release @a package using free().
500  * @param[in]  package_updateinfo The package update information
501  * @param[out] package            The package name
502  * @return @c 0 on success,
503  *         otherwise a negative error value
504  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
505  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
506  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
507  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          Internal I/O error occured
508  */
509 int package_info_updateinfo_get_pkgid(package_update_info_h package_updateinfo, char **package);
510
511 /**
512  * @brief Gets the update version of package.
513  * @since_tizen 4.0
514  * @remarks You must release @a version using free().
515  * @param[in]  package_updateinfo The package update information
516  * @param[out] version            The package update version
517  * @return @c 0 on success,
518  *         otherwise a negative error value
519  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
520  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
521  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
522  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          Internal I/O error occured
523  */
524 int package_info_updateinfo_get_version(package_update_info_h package_updateinfo, char **version);
525
526 /**
527  * @brief Gets the update type of package.
528  * @since_tizen 4.0
529  * @param[in]  package_updateinfo The package update information
530  * @param[out] type               The package update type
531  * @return @c 0 on success,
532  *         otherwise a negative error value
533  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
534  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
535  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          Internal I/O error occured
536  */
537 int package_info_updateinfo_get_type(package_update_info_h package_updateinfo, package_update_info_type_e *type);
538
539 /**
540  * @brief Destroys the package update information handle and releases all its resources.
541  * @since_tizen 4.0
542  * @param[in] package_updateinfo The package update information handle
543  * @return @c 0 on success,
544  *         otherwise a negative error value
545  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
546  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
547  * @see package_info_updateinfo_create()
548  */
549 int package_info_updateinfo_destroy(package_update_info_h package_updateinfo);
550
551 /**
552  * @brief Retrieve update information of all packages and invoke callback for each of it.
553  * @since_tizen 4.0
554  * @param[in] callback     The iteration callback function
555  * @param[in] user_data    The user data to be passed to the callback function
556  * @return @c 0 on success,
557  *         otherwise a negative error value
558  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
559  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
560  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
561  */
562 int package_info_updateinfo_foreach_updateinfo(package_info_updateinfo_cb callback, void *user_data);
563
564
565 /**
566 * @}
567 */
568
569 #ifdef __cplusplus
570 }
571 #endif
572
573 #endif /* __TIZEN_APPFW_PACKAGE_INFO_H */