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