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