Fix description of package updateinfo APIs
[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_updateinfo_s *package_updateinfo_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_updateinfo_type_e;
95
96 /**
97  * @brief Called for each update information of all packages.
98  * @since_tizen 4.0
99  * @remarks @a info should not be freed and can be used only in the callback.
100  * @param[in] info       The package update information handle
101  * @param[in] user_data  The user data passed from the foreach function
102  * @return @c true to continue with the next iteration of the loop,
103  *         otherwise @c false to break out of the loop
104  * @pre package_info_updateinfo_foreach_updateinfo() will invoke this callback.
105  * @see package_info_updateinfo_foreach_updateinfo()
106  */
107 typedef bool (*package_info_updateinfo_cb) (package_updateinfo_h info, void *user_data);
108
109 /**
110  * @brief Called to get the application ID once for each installed package.
111  * @since_tizen 2.3
112  * @param[in] comp_type The Application Component type
113  * @param[in] callback  The callback function to be invoked
114  * @param[in] user_data The user data passed from the foreach function
115  * @return @c true to continue with the next iteration of the loop,
116  *         otherwise @c false to break out of the loop
117  * @pre package_info_foreach_app_from_package() will invoke this callback.
118  * @see package_info_foreach_app_from_package()
119  */
120 typedef bool (*package_info_app_cb) (package_info_app_component_type_e comp_type, const char *app_id, void *user_data);
121
122
123 /**
124  * @brief Called to get the certification information.
125  * @since_tizen 2.3
126  * @param[in] package_info The package info handle
127  * @param[in] cert_type    The certificate type
128  * @param[in] cert_value   The certificate value of corresponding certificate key \n
129  *                         This value is base64 encoded data.
130  * @param[in] user_data    The user data passed from the foreach function
131  * @return @c true to continue with the next iteration of the loop,
132  *         otherwise @c false to break out of the loop
133  * @pre package_info_foreach_cert_info() will invoke this callback.
134  * @see package_info_foreach_cert_info()
135  */
136 typedef bool (*package_info_cert_info_cb) (package_info_h handle, package_cert_type_e cert_type, const char *cert_value, void *user_data);
137
138
139 /**
140  * @brief Called to get the privilege information.
141  * @since_tizen 2.3
142  * @param[in] privilege_name the name of the privilege
143  * @param[in] user_data    The user data passed from the foreach function
144  * @return  @c true to continue with the next iteration of the loop,
145  *          otherwise @c false to break out of the loop
146  * @pre package_info_foreach_privilege_info() will invoke this callback.
147  * @see package_info_foreach_privilege_info()
148  */
149 typedef bool (*package_info_privilege_info_cb) (const char *privilege_name, void *user_data);
150
151
152 /**
153  * @brief Retrieves all application IDs of each package.
154  * @since_tizen 2.3
155  * @param[in] package_info  The package info handle
156  * @param[in] comp_type     The application component type
157  * @param[in] callback      The callback function to invoke
158  * @param[in] user_data     The user data to be passed to the callback function
159  * @return @c 0 on success,
160  *         otherwise a negative error value
161  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
162  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
163  * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE   No such package
164  * @post This function invokes package_info_app_cb() repeatedly for each package.
165  * @see package_info_app_cb()
166  */
167 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);
168
169
170 /**
171  * @brief Destroys the package information handle and releases all its resources.
172  * @since_tizen 2.3
173  * @param[in] package_info The package information handle
174  * @return @c 0 on success,
175  *         otherwise a negative error value
176  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
177  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
178  * @see package_manager_foreach_package_info()
179  * @see package_manager_get_package_info()
180  */
181 int package_info_destroy(package_info_h package_info);
182
183
184 /**
185  * @brief Gets the package name.
186  * @since_tizen 2.3
187  * @remarks You must release @a package using free().
188  * @param[in]  package_info The package information
189  * @param[out] package      The package name
190  * @return @c 0 on success,
191  *         otherwise a negative error value
192  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
193  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
194  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
195  */
196 int package_info_get_package(package_info_h package_info, char **package);
197
198
199 /**
200  * @brief Gets the main application ID of the package.
201  * @since_tizen 4.0
202  * @remarks You must release @a main_app_id using free().
203  * @param[in]  package_info     The package information
204  * @param[out] main_app_id      The main application ID of the package
205  * @return @c 0 on success,
206  *         otherwise a negative error value
207  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
208  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
209  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
210  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
211  */
212 int package_info_get_main_app_id(package_info_h package_info, char **main_app_id);
213
214
215 /**
216  * @brief Gets the label of the package.
217  * @since_tizen 2.3
218  * @remarks You must release @a label using free().
219  * @param[in]  package_info The package information
220  * @param[out] label        The label of the package
221  * @return @c 0 on success,
222  *         otherwise a negative error value
223  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
224  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
225  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
226  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
227  */
228 int package_info_get_label(package_info_h package_info, char **label);
229
230
231 /**
232  * @brief Gets the absolute path to the icon image.
233  * @since_tizen 2.3
234  * @remarks You must release @a path using free().
235  * @param[in]  package_info The package information
236  * @param[out] path         The path of the package
237  * @return @c 0 on success,
238  *         otherwise a negative error value
239  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
240  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
241  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
242  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
243  */
244 int package_info_get_icon(package_info_h package_info, char **path);
245
246
247 /**
248  * @brief Gets the version of the package.
249  * @since_tizen 2.3
250  * @remarks You must release @a version using free().
251  * @param[in]  package_info The package information
252  * @param[out] version      The version of the package
253  * @return @c 0 on success,
254  *         otherwise a negative error value
255  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
256  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
257  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
258  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
259  */
260 int package_info_get_version(package_info_h package_info, char **version);
261
262
263 /**
264  * @brief Gets the type of the package.
265  * @since_tizen 2.3
266  * @remarks You must release @a type using free().
267  * @param[in]  package_info The package information
268  * @param[out] type         The type of the package
269  * @return @c 0 on success,
270  *         otherwise a negative error value
271  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
272  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
273  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
274  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
275  */
276 int package_info_get_type(package_info_h package_info, char **type);
277
278
279 /**
280  * @brief Gets the installed storage for the given package.
281  * @since_tizen 2.3
282  * @param[in]  package_info The package information
283  * @param[out] storage      The installed storage
284  * @return @c 0 on success,
285  *         otherwise a negative error value
286  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
287  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
288  */
289 int package_info_get_installed_storage(package_info_h package_info, package_info_installed_storage_type_e *storage);
290
291
292 /**
293  * @brief Gets the root path of the package.
294  * @since_tizen 2.3
295  * @remarks You must release @a path using free().
296  * @param[in]  package_info The package information
297  * @param[out] path         The root path of the package
298  * @return @c 0 on success,
299  *         otherwise a negative error value
300  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
301  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
302  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
303  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
304  */
305 int package_info_get_root_path(package_info_h package_info, char **path);
306
307
308 /**
309  * @platform
310  * @brief Gets the name of the TEP(Tizen Expansion Package).
311  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
312  * @privlevel platform
313  * @privilege %http://tizen.org/privilege/packagemanager.admin
314  * @remarks Name must be released using free().
315  * @param[in] package_info The package information
316  * @param[out] name The name of the tep
317  * @return 0 on success,
318  *         otherwise a negative error value
319  * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
320  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
321  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
322  * @retval #PACKAGE_MANAGER_ERROR_SYSTEM_ERROR           Severe system error
323  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
324  */
325 int package_info_get_tep_name(package_info_h package_info, char **name);
326
327
328 /**
329  * @brief Checks whether the package is system package.
330  * @since_tizen 2.3
331  * @param[in]  package_info The package information
332  * @param[out] system       @c true if the package is system package,
333  *                          otherwise @c false if the package is not system package
334  * @return @c 0 on success,
335  *         otherwise a negative error value
336  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
337  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
338  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
339  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
340  */
341 int package_info_is_system_package(package_info_h package_info, bool *system);
342
343
344 /**
345  * @brief Checks whether the package is removable.
346  * @since_tizen 2.3
347  * @param[in]  package_info The package information
348  * @param[out] removable    The removable info of the package
349  * @return @c 0 on success,
350  *         otherwise a negative error value
351  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
352  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
353  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
354  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR IO error
355  */
356 int package_info_is_removable_package(package_info_h package_info, bool *removable);
357
358
359 /**
360  * @brief Checks whether the package is preloaded.
361  * @since_tizen 2.3
362  * @param[in]  package_info The package information
363  * @param[out] preload      The preload info of the package
364  * @return @c 0 on success,
365  *         otherwise a negative error value
366  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
367  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
368  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
369  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
370  */
371 int package_info_is_preload_package(package_info_h package_info, bool *preload);
372
373
374 /**
375  * @brief Checks whether two package information is equal.
376  * @since_tizen 2.3
377  * @param[in]  lhs    The first package information to be compared
378  * @param[in]  rhs    The second package information to be compared
379  * @param[out] equal  @c true if the package information are equal,
380  *                    otherwise @c false if package information are not equal
381  * @return @c 0 on success,
382  *         otherwise a negative error value
383  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
384  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
385  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
386  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          Database error occurred
387  */
388 int package_info_is_equal(package_info_h lhs, package_info_h rhs, bool *equal);
389
390
391 /**
392  * @brief Checks whether the package info is accessible for the given package.
393  * @since_tizen 2.3
394  * @param[in]  package_info The package information
395  * @param[out] accessible   @c true if the package info is accessible,
396  *                          otherwise @c false if the package info is not accessible
397  * @return @c 0 on success,
398  *         otherwise a negative error value
399  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
400  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
401  */
402 int package_info_is_accessible(package_info_h package_info, bool *accessible);
403
404 /**
405  * @brief Gets the installed time for the given package.
406  * @details If the package was updated, the @a installed_time represents updated time.
407  *          So, the meaning of 'installed time' corresponds with 'last modified time'.
408  * @since_tizen 4.0
409  * @param[in]  package_info   The package information
410  * @param[out] installed_time The integer value of time_t type for installed time
411  * @return @c 0 on success,
412  *         otherwise a negative error value
413  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
414  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
415  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          Database error occurred
416  */
417 int package_info_get_installed_time(package_info_h package_info, int *installed_time);
418
419 /**
420  * @brief Clones the package information handle.
421  * @since_tizen 2.3
422  * @param[out] clone          The newly created package information handle
423  * @param[in]  package_info   The package information
424  * @return @c 0 on success,
425  *         otherwise a negative error value
426  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
427  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
428  * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE   The package is not installed
429  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
430  */
431 int package_info_clone(package_info_h *clone, package_info_h package_info);
432
433 /**
434  * @brief Gets the package information for the given package
435  * @since_tizen 2.3
436  * @remarks You must release @a package_info using package_info_destroy().
437  * @param[in]  package      The ID of the package
438  * @param[out] package_info The package information for the given package ID
439  * @return @c 0 on success,
440  *         otherwise a negative error value
441  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
442  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
443  * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE   The package is not installed
444  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
445  */
446 int package_info_create(const char *package, package_info_h *package_info);
447
448
449 /**
450  * @brief Retrieves certification information of the package.
451  * @since_tizen 2.3
452  * @param[in] package_info The package information
453  * @param[in] callback     The iteration callback function
454  * @param[in] user_data    The user data to be passed to the callback function
455  * @return @c 0 on success,
456  *         otherwise a negative error value
457  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
458  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
459  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
460  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
461  */
462 int package_info_foreach_cert_info(package_info_h package_info, package_info_cert_info_cb callback, void *user_data);
463
464
465 /**
466  * @brief Retrieves privilege information of the package.
467  * @since_tizen 2.3
468  * @param[in] package_info The package information
469  * @param[in] callback     The iteration callback function
470  * @param[in] user_data    The user data to be passed to the callback function
471  * @return @c 0 on success,
472  *         otherwise a negative error value
473  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
474  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
475  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
476  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
477  */
478 int package_info_foreach_privilege_info(package_info_h package_info, package_info_privilege_info_cb callback, void *user_data);
479
480 /**
481  * @brief Gets the package update information for the given package.
482  * @since_tizen 4.0
483  * @remarks You must release @a info using package_info_updateinfo_destroy().
484  * @param[in]  pkgid       The ID of the package
485  * @param[out] info        The package update information for the given package ID
486  * @return @c 0 on success,
487  *         otherwise a negative error value
488  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
489  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
490  * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE   The package is not installed
491  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
492  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          Database error occurred
493  * @see package_info_updateinfo_destroy()
494  */
495 int package_info_updateinfo_create(const char *pkgid, package_updateinfo_h *info);
496
497 /**
498  * @brief Gets the package name.
499  * @since_tizen 4.0
500  * @remarks You must release @a package using free().
501  * @param[in]  info        The package update information
502  * @param[out] package     The package name
503  * @return @c 0 on success,
504  *         otherwise a negative error value
505  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
506  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
507  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
508  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          Internal I/O error occured
509  */
510 int package_info_updateinfo_get_pkgid(package_updateinfo_h info, char **package);
511
512 /**
513  * @brief Gets the update version of package.
514  * @since_tizen 4.0
515  * @remarks You must release @a version using free().
516  * @param[in]  info        The package update information
517  * @param[out] version     The package update version
518  * @return @c 0 on success,
519  *         otherwise a negative error value
520  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
521  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
522  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
523  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          Internal I/O error occured
524  */
525 int package_info_updateinfo_get_version(package_updateinfo_h info, char **version);
526
527 /**
528  * @brief Gets the update type of package.
529  * @since_tizen 4.0
530  * @param[in]  info        The package update information
531  * @param[out] type        The package update type
532  * @return @c 0 on success,
533  *         otherwise a negative error value
534  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
535  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
536  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          Internal I/O error occured
537  */
538 int package_info_updateinfo_get_type(package_updateinfo_h info,
539                                                 package_updateinfo_type_e *type);
540
541 /**
542  * @brief Destroys the package update information handle and releases all its resources.
543  * @since_tizen 4.0
544  * @param[in] info         The package update information handle
545  * @return @c 0 on success,
546  *         otherwise a negative error value
547  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
548  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
549  * @see package_info_updateinfo_create()
550  */
551 int package_info_updateinfo_destroy(package_updateinfo_h info);
552
553 /**
554  * @brief Retrieve update information of all packages and invoke callback for each of it.
555  * @since_tizen 4.0
556  * @param[in] callback     The iteration callback function
557  * @param[in] user_data    The user data to be passed to the callback function
558  * @return @c 0 on success,
559  *         otherwise a negative error value
560  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
561  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
562  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
563  */
564 int package_info_updateinfo_foreach_info(package_info_updateinfo_cb callback, void *user_data);
565
566
567 /**
568 * @}
569 */
570
571 #ifdef __cplusplus
572 }
573 #endif
574
575 #endif /* __TIZEN_APPFW_PACKAGE_INFO_H */