Revert "Add new APIs for register, unregister and get pkg update info"
[platform/core/api/package-manager.git] / include / package_manager.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 #ifndef __TIZEN_APPFW_PACKAGE_MANAGER_H
18 #define __TIZEN_APPFW_PACKAGE_MANAGER_H
19
20 #include <sys/types.h>
21
22 #include <tizen.h>
23
24 #include <package_info.h>
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 /**
31  * @file package_manager.h
32  */
33
34 /**
35  * @addtogroup CAPI_PACKAGE_MANAGER_MODULE
36  * @{
37  */
38
39 /**
40  * @brief Definition for value to be used when filtering based on install location: Boolean property for filtering whether the package is removable or not based on package info.
41  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
42  */
43 #define PACKAGE_MANAGER_PKGINFO_PROP_REMOVABLE       "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
44
45
46 /**
47  * @brief Definition for value to be used when filtering based on install location: Boolean property for filtering whether the package is readonly or not based on package info.
48  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
49  */
50 #define PACKAGE_MANAGER_PKGINFO_PROP_READONLY        "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
51
52
53 /**
54  * @brief Definition for value to be used when filtering based on install location: Boolean property for filtering whether the package supports disable or not based on package info.
55  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
56  */
57 #define PACKAGE_MANAGER_PKGINFO_PROP_SUPPORT_DISABLE     "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
58
59
60 /**
61  * @brief Definition for value to be used when filtering based on install location: Boolean property for filtering whether the package is disabled based on package info.
62  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
63  */
64 #define PACKAGE_MANAGER_PKGINFO_PROP_DISABLE             "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
65
66
67 /**
68  * @brief Definition for value to be used when filtering based on install location: Boolean property for filtering whether the package is preload or not based on package info.
69  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
70  */
71 #define PACKAGE_MANAGER_PKGINFO_PROP_PRELOAD            "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
72
73
74 /**
75  * @brief Enumeration for error code.
76  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
77  */
78 typedef enum {
79         PACKAGE_MANAGER_ERROR_NONE = TIZEN_ERROR_NONE,                                /**< Successful */
80         PACKAGE_MANAGER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,      /**< Invalid parameter */
81         PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,              /**< Out of memory */
82         PACKAGE_MANAGER_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR,                        /**< Internal I/O error */
83         PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE = TIZEN_ERROR_PACKAGE_MANAGER | 0x71,   /**< No such package */
84         PACKAGE_MANAGER_ERROR_SYSTEM_ERROR = TIZEN_ERROR_PACKAGE_MANAGER | 0x72,      /**< Severe system error */
85         PACKAGE_MANAGER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED       /**< Permission denied */
86 } package_manager_error_e;
87
88
89 /**
90  * @brief Enumeration for event type.
91  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
92  */
93 typedef enum {
94         PACKAGE_MANAGER_EVENT_TYPE_INSTALL = 0,    /**< Install event type */
95         PACKAGE_MANAGER_EVENT_TYPE_UNINSTALL,      /**< Uninstall event type */
96         PACKAGE_MANAGER_EVENT_TYPE_UPDATE,         /**< Update event type */
97         PACKAGE_MANAGER_EVENT_TYPE_MOVE,           /**< Move event type (Since 3.0) */
98         PACKAGE_MANAGER_EVENT_TYPE_CLEAR,          /**< Clear event type (Since 3.0) */
99
100         /* These enum will be deprecated. Use above enum instead. */
101         PACAKGE_MANAGER_EVENT_TYPE_INSTALL = 0,
102         PACAKGE_MANAGER_EVENT_TYPE_UNINSTALL,
103         PACAKGE_MANAGER_EVENT_TYPE_UPDATE,
104 } package_manager_event_type_e;
105
106
107 /**
108  * @brief Enumeration for event state.
109  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
110  */
111 typedef enum {
112         PACKAGE_MANAGER_EVENT_STATE_STARTED = 0,   /**< Started event state */
113         PACKAGE_MANAGER_EVENT_STATE_PROCESSING,    /**< Processing event state */
114         PACKAGE_MANAGER_EVENT_STATE_COMPLETED,     /**< Completed event state */
115         PACKAGE_MANAGER_EVENT_STATE_FAILED,        /**< Failed event state */
116
117         /* These enum will be deprecated. Use above enum instead. */
118         PACAKGE_MANAGER_EVENT_STATE_STARTED = 0,
119         PACAKGE_MANAGER_EVENT_STATE_PROCESSING,
120         PACAKGE_MANAGER_EVENT_STATE_COMPLETED,
121         PACAKGE_MANAGER_EVENT_STATE_FAILED,
122 } package_manager_event_state_e;
123
124
125 /**
126  * @brief Enumeration for move type.
127  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
128  */
129 typedef enum {
130         PACKAGE_MANAGER_REQUEST_MOVE_TO_INTERNAL = 0,    /**< Internal type */
131         PACKAGE_MANAGER_REQUEST_MOVE_TO_EXTERNAL,        /**< External type */
132
133         /* These enum will be deprecated. Use above enum instead. */
134         PACAKGE_MANAGER_REQUEST_MOVE_TO_INTERNAL = 0,
135         PACAKGE_MANAGER_REQUEST_MOVE_TO_EXTERNAL,
136 } package_manager_move_type_e;
137
138
139 /**
140  * @brief Enumeration for certification compare type.
141  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
142  */
143 typedef enum {
144         PACKAGE_MANAGER_COMPARE_MATCH = 0,      /**< Matching certification */
145         PACKAGE_MANAGER_COMPARE_MISMATCH,       /**< Mismatching certification */
146         PACKAGE_MANAGER_COMPARE_LHS_NO_CERT,    /**< First package has no certification */
147         PACKAGE_MANAGER_COMPARE_RHS_NO_CERT,    /**< Second package has no certification */
148         PACKAGE_MANAGER_COMPARE_BOTH_NO_CERT,   /**< Both have no certification */
149
150         /* These enum will be deprecated. Use above enum instead. */
151         PACAKGE_MANAGER_COMPARE_MATCH = 0,
152         PACAKGE_MANAGER_COMPARE_MISMATCH,
153         PACAKGE_MANAGER_COMPARE_LHS_NO_CERT,
154         PACAKGE_MANAGER_COMPARE_RHS_NO_CERT,
155         PACAKGE_MANAGER_COMPARE_BOTH_NO_CERT,
156 } package_manager_compare_result_type_e;
157
158
159 /**
160  * @brief Enumeration for permission type.
161  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
162  */
163 typedef enum {
164         PACKAGE_MANAGER_PERMISSION_NORMAL = 0,    /**< Normal permission */
165         PACKAGE_MANAGER_PERMISSION_SIGNATURE,     /**< Signature permission */
166         PACKAGE_MANAGER_PERMISSION_PRIVILEGE,     /**< Privilege permission */
167 } package_manager_permission_type_e;
168
169
170 /**
171  * @brief Enumeration for status type.
172  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
173  */
174 typedef enum {
175         PACKAGE_MANAGER_STATUS_TYPE_ALL = 0x00,               /**< All status */
176         PACKAGE_MANAGER_STATUS_TYPE_INSTALL = 0x01,           /**< Install package status */
177         PACKAGE_MANAGER_STATUS_TYPE_UNINSTALL = 0x02,         /**< Uninstall package status */
178         PACKAGE_MANAGER_STATUS_TYPE_UPGRADE = 0x04,           /**< Upgrade package status */
179         PACKAGE_MANAGER_STATUS_TYPE_MOVE = 0x08,              /**< Move package status */
180         PACKAGE_MANAGER_STATUS_TYPE_CLEAR_DATA = 0x10,        /**< Clear data status */
181         PACKAGE_MANAGER_STATUS_TYPE_INSTALL_PROGRESS = 0x20,  /**< Install progress status */
182         PACKAGE_MANAGER_STATUS_TYPE_GET_SIZE = 0x40,          /**< Get size status */
183 } package_manager_status_type_e;
184
185
186 /**
187  * @brief The Package manager handle.
188  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
189  */
190 typedef struct package_manager_s *package_manager_h;
191
192
193 /**
194  * @brief Package manager filter handle.
195  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
196  */
197 typedef struct package_manager_filter_s *package_manager_filter_h;
198
199
200 /**
201  * @brief Called when the package is installed, uninstalled, or updated, and the progress of the request to the package manager changes.
202  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
203  * @param[in] type The type of the package to be installed, uninstalled, or updated
204  * @param[in] package The name of the package to be installed, uninstalled, or updated
205  * @param[in] event_type The type of the request to the package manager
206  * @param[in] event_state The current state of the request to the package manager
207  * @param[in] progress    The progress for the request that is being processed by the package manager \n
208  *                        The range of progress is from @c 0 to @c 100
209  * @param[in] error       The error code when the package manager failed to process the request
210  * @param[in] user_data   The user data passed from package_manager_set_event_cb()
211  * @see package_manager_set_event_cb()
212  * @see package_manager_unset_event_cb()
213  */
214 typedef void (*package_manager_event_cb) (const char *type, const char *package, package_manager_event_type_e event_type, package_manager_event_state_e event_state, int progress, package_manager_error_e error, void *user_data);
215
216
217 /**
218  * @brief Creates a package manager handle.
219  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
220  * @privlevel public
221  * @privilege %http://tizen.org/privilege/packagemanager.info
222  * @remarks You must release @a manager using package_manager_destroy().
223  * @param[out] manager The package manager handle that is newly created on success
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          Internal I/O error
230  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
231  * @see package_manager_destroy()
232  */
233 int package_manager_create(package_manager_h *manager);
234
235
236 /**
237  * @brief Destroys the package manager handle.
238  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
239  * @param[in] manager The package manager handle
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  * @see package_manager_create()
245  */
246 int package_manager_destroy(package_manager_h manager);
247
248
249 /**
250  * @brief Sets the event status of the package when the package is installed, uninstalled, or updated.
251  * @details You can combine multiple status using OR operation which you want to listen.
252  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
253  * @param [in] manager     The package manager handle
254  * @param [in] status_type The status 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_IO_ERROR          Internal I/O error
260  * @see package_manager_status_type_e
261  * @see package_manager_set_event_cb()
262  */
263 int package_manager_set_event_status(package_manager_h manager, int status_type);
264
265
266 /**
267  * @brief Registers a callback function to be invoked when the package is installed, uninstalled, or updated.
268  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
269  * @privlevel public
270  * @privilege %http://tizen.org/privilege/packagemanager.info
271  * @param[in] manager    The package manager handle
272  * @param[in] callback   The callback function to be registered
273  * @param[in] user_data  The user data to be passed to the callback function
274  * @return @c 0 on success,
275  *         otherwise a negative error value
276  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
277  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
278  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
279  * @post package_manager_event_cb() will be invoked.
280  * @see package_manager_set_event_status()
281  * @see package_manager_event_cb()
282  * @see package_manager_unset_event_cb()
283  */
284 int package_manager_set_event_cb(package_manager_h manager, package_manager_event_cb callback, void *user_data);
285
286
287 /**
288  * @brief Unregisters the callback function.
289  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
290  * @param[in] manager The package manager handle
291  * @return @c 0 on success,
292  *         otherwise a negative error value
293  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
294  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
295  * @see package_manager_event_cb()
296  * @see package_manager_set_event_cb()
297  */
298 int package_manager_unset_event_cb(package_manager_h manager);
299
300
301 /**
302  * @brief Called to retrieve all packages.
303  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
304  * @param[in] package_info The package information
305  * @param[in] user_data    The user data passed from the foreach function
306  * @return  @c true to continue with the next iteration of the loop,
307  *          otherwise @c false to break out of the loop
308  * @see package_manager_foreach_package_info()
309  */
310 typedef bool (*package_manager_package_info_cb) (package_info_h package_info, void *user_data);
311
312
313 /**
314  * @brief Retrieves all package information of installed packages.
315  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
316  * @privlevel public
317  * @privilege %http://tizen.org/privilege/packagemanager.info
318  * @param[in] callback  The callback function to be invoked
319  * @param[in] user_data The user data to be passed to the callback function
320  * @return @c 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_PERMISSION_DENIED Permission denied
325  * @post This function invokes package_manager_package_info_cb() repeatedly for each package information.
326  * @see package_manager_package_info_cb()
327  */
328 int package_manager_foreach_package_info(package_manager_package_info_cb callback, void *user_data);
329
330
331 /**
332  * @brief Gets the package ID for the given app ID.
333  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
334  * @privlevel public
335  * @privilege %http://tizen.org/privilege/packagemanager.info
336  * @param[in]  app_id     The ID of the application
337  * @param[out] package_id The ID of the package
338  * @return @c 0 on success,
339  *         otherwise a negative error value
340  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
341  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
342  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
343  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
344  */
345 int package_manager_get_package_id_by_app_id(const char *app_id, char **package_id);
346
347
348 /**
349  * @brief Gets the package information for the given package.
350  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
351  * @privlevel public
352  * @privilege %http://tizen.org/privilege/packagemanager.info
353  * @remarks You must release @a package_info using package_info_destroy().
354  * @param[in]  package_id   The ID of the package
355  * @param[out] package_info The package information for the given package ID
356  * @return @c 0 on success,
357  *         otherwise a negative error value
358  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
359  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
360  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
361  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR Database error occurred
362  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
363  */
364 int package_manager_get_package_info(const char *package_id, package_info_h *package_info);
365
366
367 /**
368  * @brief Compares whether two package certifications are matched.
369  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
370  * @param[in]  lhs_package_id The first package ID to compare
371  * @param[in]  rhs_package_id The second package ID to compare
372  * @param[out] compare_result @c 0 if the certification information are matched,
373  *                            otherwise the compared result
374  * @return @c 0 on success,
375  *         otherwise a negative error value
376  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
377  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
378  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
379  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          Database error occurred
380  */
381 int package_manager_compare_package_cert_info(const char *lhs_package_id, const char *rhs_package_id, package_manager_compare_result_type_e *compare_result);
382
383
384 /**
385  * @brief Compares whether two app certifications are matched.
386  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
387  * @param[in]  lhs_app_id     The first app ID to compare
388  * @param[in]  rhs_app_id     The second app ID to compare
389  * @param[out] compare_result @c 0 if the certification information are matched,
390  *                            otherwise the compared result
391  * @return @c 0 on success,
392  *         otherwise a negative error value
393  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
394  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
395  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
396  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          Database error occurred
397  */
398 int package_manager_compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, package_manager_compare_result_type_e *compare_result);
399
400
401 /**
402  * @brief Checks whether the package is preloaded by @a app_id.
403  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
404  * @privlevel public
405  * @privilege %http://tizen.org/privilege/packagemanager.info
406  * @param[in]  app_id   The ID of the application
407  * @param[out] preload  The preload info of the package
408  * @return @c 0 on success,
409  *         otherwise a negative error value
410  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
411  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
412  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
413  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
414  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
415  */
416 int package_manager_is_preload_package_by_app_id(const char *app_id, bool *preload);
417
418
419 /**
420  * @brief Gets the package permission type by @a app_id.
421  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
422  * @privlevel public
423  * @privilege %http://tizen.org/privilege/packagemanager.info
424  * @param[in]  app_id          The ID of the application
425  * @param[out] permission_type The package permission type
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_OUT_OF_MEMORY     Out of memory
431  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
432  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
433  */
434 int package_manager_get_permission_type(const char *app_id, package_manager_permission_type_e *permission_type);
435
436
437 /**
438  * @brief Clears the application's internal and external cache directory, asynchronously.
439  * @details All files stored in the cache directory of the application specified with the package ID are removed.
440  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
441  * @privlevel public
442  * @privilege %http://tizen.org/privilege/packagemanager.clearcache
443  * @param[in] package_id  The package ID
444  * @return @c 0 on success,
445  *         otherwise a negative error value
446  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
447  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
448  * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE   No such package
449  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
450  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
451  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
452  * @retval #PACKAGE_MANAGER_ERROR_SYSTEM_ERROR      Severe system error
453  */
454 int package_manager_clear_cache_dir(const char *package_id);
455
456 /**
457  * @platform
458  * @brief  Clears all applications' internal and external cache directory, asynchronously.
459  * @details All files stored in the cache directory of each application are removed.
460  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
461  * @privlevel platform
462  * @privilege %http://tizen.org/privilege/packagemanager.admin
463  * @return @c 0 on success,
464  *         otherwise a negative error value
465  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
466  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
467  * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE   No such package
468  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
469  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
470  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
471  * @retval #PACKAGE_MANAGER_ERROR_SYSTEM_ERROR      Severe system error
472  */
473 int package_manager_clear_all_cache_dir(void);
474
475 /**
476  * @platform
477  * @brief Clears internal and external data directories used by applications in the given package.
478  * @details All files stored in data directories used by applications in the package specified with the @a package_id are removed.
479  * @since_tizen 4.0
480  * @privlevel platform
481  * @privilege %http://tizen.org/privilege/packagemanager.admin
482  * @param[in] package_id  The package ID
483  * @return @c 0 on success,
484  *         otherwise a negative error value
485  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
486  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
487  * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE   No such package
488  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
489  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
490  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
491  * @retval #PACKAGE_MANAGER_ERROR_SYSTEM_ERROR      Severe system error
492  */
493 int package_manager_clear_data_dir(const char *package_id);
494
495
496 /**
497  * @brief The package size information handle.
498  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
499  */
500 typedef struct package_size_info *package_size_info_h;
501
502
503 /**
504  * @brief Called when the package size information is obtained.
505  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
506  * @param[in] package_id  The package ID
507  * @param[in] size_info   The pointer to the structure including the package size information
508  * @param[in] user_data   The user data to be passed to the callback function
509  */
510 typedef void (*package_manager_size_info_receive_cb)(const char *package_id, const package_size_info_h size_info, void *user_data);
511
512
513 /**
514  * @platform
515  * @brief Called when the total package size information is obtained.
516  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
517  * @param[in] size_info  The pointer to the structure including the package size information
518  * @param[in] user_data  The user data to be passed to the callback function
519  */
520 typedef void (*package_manager_total_size_info_receive_cb)(const package_size_info_h size_info, void *user_data);
521
522
523 /**
524  * @brief Gets the package size information, asynchronously.
525  * @details The package size info is asynchronously obtained by the callback function.
526  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
527  * @privlevel public
528  * @privilege %http://tizen.org/privilege/packagemanager.info
529  * @param[in] package_id  The package ID
530  * @param[in] callback    The asynchronous callback function to get the package size information
531  * @param[in] user_data   The user data to be passed to the callback function
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_NO_SUCH_PACKAGE   No such package
537  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
538  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
539  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
540  * @retval #PACKAGE_MANAGER_ERROR_SYSTEM_ERROR      Severe system error
541  */
542 int package_manager_get_package_size_info(const char *package_id, package_manager_size_info_receive_cb callback, void *user_data);
543
544
545 /**
546  * @platform
547  * @brief Gets the total package size information, asynchronously.
548  * @details The total package size info is asynchronously obtained by the callback function.
549  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
550  * @privlevel public
551  * @privilege %http://tizen.org/privilege/packagemanager.info
552  * @param[in] callback  The asynchronous callback function to get the total package size information
553  * @param[in] user_data The user data to be passed to the callback function
554  * @return @c 0 on success,
555  *         otherwise a negative error value
556  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
557  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
558  * @retval #PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE   No such package
559  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
560  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
561  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          I/O error
562  * @retval #PACKAGE_MANAGER_ERROR_SYSTEM_ERROR      Severe system error
563  */
564 int package_manager_get_total_package_size_info(package_manager_total_size_info_receive_cb callback, void *user_data);
565
566
567 /**
568  * @brief Creates the package information filter handle from db.
569  * @details The filtered result will be based on AND operation of all added filter properties.
570  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
571  * @privlevel public
572  * @privilege %http://tizen.org/privilege/packagemanager.info
573  * @param[out] handle Pointer to the package info filter handle
574  * @return @c 0 on success,
575  *         otherwise a negative error value
576  * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
577  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
578  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
579  * @post package_manager_filter_destroy()
580  * @see package_manager_filter_add_bool()
581  * @see package_manager_filter_foreach_pkginfo()
582  */
583 int package_manager_filter_create(package_manager_filter_h *handle);
584
585
586 /**
587  * @brief This API destroys the package information filter handle freeing up all the resources
588  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
589  * @param[in] handle Pointer to the package info filter handle
590  * @return @c 0 on success,
591  *         otherwise a negative error value
592  * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
593  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
594  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
595  * @pre package_manager_filter_create()
596  * @see package_manager_filter_count()
597  * @see package_manager_filter_foreach_package_info()
598  */
599 int package_manager_filter_destroy(package_manager_filter_h handle);
600
601
602 /**
603  * @brief This API adds a boolean filter property to the filter handle
604  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
605  * @param[in] handle Pointer to the package info filter handle
606  * @param[in] property boolean property name
607  * @param[in] value value corresponding to the property
608  * @return @c 0 on success,
609  *         otherwise a negative error value
610  * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
611  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
612  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
613  * @pre package_manager_filter_create()
614  * @post package_manager_filter_destroy()
615  * @see package_manager_filter_count()
616  * @see package_manager_filter_foreach_package_info()
617  */
618 int package_manager_filter_add_bool(package_manager_filter_h handle, const char *property, const bool value);
619
620
621 /**
622  * @brief This API counts the package that satisfy the filter conditions
623  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
624  * @privlevel public
625  * @privilege %http://tizen.org/privilege/packagemanager.info
626  * @param[in] handle Pointer to the package info filter handle
627  * @param[out] count Pointer to store the count value
628  * @return @c 0 on success,
629  *         otherwise a negative error value
630  * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
631  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
632  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
633  * @pre package_manager_filter_create()
634  * @post package_manager_filter_destroy()
635  * @see package_manager_filter_foreach_package_info()
636  */
637 int package_manager_filter_count(package_manager_filter_h handle, int *count);
638
639
640 /**
641  * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
642  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
643  * @privlevel public
644  * @privilege %http://tizen.org/privilege/packagemanager.info
645  * @param[in] handle Pointer to the package info filter handle
646  * @param[in] callback callback function
647  * @param[in] user_data user data to be passed to the callback function
648  * @return @c 0 on success,
649  *         otherwise a negative error value
650  * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
651  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
652  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
653  * @pre package_manager_filter_create()
654  * @post package_manager_filter_destroy()
655  * @post This function invokes package_manager_package_info_cb() repeatedly for each package information.
656  * @see package_manager_package_info_cb()
657  * @see package_manager_filter_count()
658  */
659 int package_manager_filter_foreach_package_info(package_manager_filter_h handle, package_manager_package_info_cb callback, void *user_data);
660
661
662 /**
663  * @platform
664  * @brief Generates request for getting License, asynchronously.
665  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
666  * @privlevel platform
667  * @privilege %http://tizen.org/privilege/packagemanager.admin
668  * @remarks You must release @a req_data and @a license_url by yourself.
669  * @param[in] resp_data The response data string of the purchase request
670  * @param[out] req_data License request data
671  * @param[out] license_url License acquisition url data
672  * @return @c 0 on success,
673  *         otherwise a negative error value
674  * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
675  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
676  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
677  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR Internal I/O error
678  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
679  * @post package_manager_drm_register_license
680  */
681 int package_manager_drm_generate_license_request(const char *resp_data, char **req_data, char **license_url);
682
683
684 /**
685  * @platform
686  * @brief Registers encrypted license, asynchronously.
687  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
688  * @privlevel platform
689  * @privilege %http://tizen.org/privilege/packagemanager.admin
690  * @param[in] resp_data The response data string of the rights request
691  * @return @c 0 on success,
692  *         otherwise a negative error value
693  * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
694  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
695  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR Internal I/O error
696  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
697  * @pre package_manager_drm_generate_license_request
698  */
699 int package_manager_drm_register_license(const char *resp_data);
700
701 /**
702  * @platform
703  * @brief Decrypts contents which is encrypted, asynchronously.
704  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
705  * @privlevel platform
706  * @privilege %http://tizen.org/privilege/packagemanager.admin
707  * @param[in] drm_file_path DRM file path
708  * @param[in] decrypted_file_path Decrypted file path
709  * @return @c 0 on success,
710  *         otherwise a negative error value
711  * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
712  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
713  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR Internal I/O error
714  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
715  */
716 int package_manager_drm_decrypt_package(const char *drm_file_path, const char *decrypted_file_path);
717
718
719 /**
720  * @brief Retrieves data size from given handle
721  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
722  * @param[in] handle Package size info handle
723  * @param[out] data_size Data size will be returned
724  * @return @c 0 on success,
725  *         otherwise a negative error value
726  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
727  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
728  */
729 int package_size_info_get_data_size(package_size_info_h handle, long long *data_size);
730
731
732 /**
733  * @brief Retrieves cache size from given handle
734  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
735  * @param[in] handle  Package size info handle
736  * @param[out] cache_size Cache size will be returned
737  * @return @c 0 on success,
738  *         otherwise a negative error value
739  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
740  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
741  */
742 int package_size_info_get_cache_size(package_size_info_h handle, long long *cache_size);
743
744
745 /**
746  * @brief Retrieves application size from given handle
747  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
748  * @param[in] handle Package size info handle
749  * @param[out] app_size App size will be returned
750  * @return @c 0 on success,
751  *         otherwise a negative error value
752  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
753  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
754  */
755 int package_size_info_get_app_size(package_size_info_h handle, long long *app_size);
756
757
758 /**
759  * @brief Retrieves external data size from given handle
760  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
761  * @param[in] handle  Package size info handle
762  * @param[out] ext_data_size External data size will be returned
763  * @return @c 0 on success,
764  *         otherwise a negative error value
765  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
766  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
767  */
768 int package_size_info_get_external_data_size(package_size_info_h handle, long long *ext_data_size);
769
770
771 /**
772  * @brief Retrieves external cache size from given handle
773  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
774  * @param[in] handle Package size info handle
775  * @param[out] ext_cache_size External cache size will be returned
776  * @return @c 0 on success,
777  *         otherwise a negative error value
778  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
779  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
780  */
781 int package_size_info_get_external_cache_size(package_size_info_h handle, long long *ext_cache_size);
782
783
784 /**
785  * @brief Retrieves external application size from given handle
786  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
787  * @param[in] handle Package size info handle
788  * @param[out] ext_app_size External app size will be returned
789  * @return @c 0 on success,
790  *         otherwise a negative error value
791  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
792  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
793  */
794 int package_size_info_get_external_app_size(package_size_info_h handle, long long *ext_app_size);
795
796
797 /**
798 * @}
799 */
800
801 /**
802  * @addtogroup CAPI_PACKAGE_REQUEST_MODULE
803  * @{
804  */
805
806
807 /**
808  * @platform
809  * @brief Enumeration for request mode.
810  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
811  */
812 typedef enum {
813         PACKAGE_MANAGER_REQUEST_MODE_DEFAULT = 0,    /**< @platform Default request mode */
814         PACKAGE_MANAGER_REQUEST_MODE_QUIET,          /**< @platform Quiet request mode */
815
816         /* These enum will be deprecated. Use above enum instead. */
817         PACAKGE_MANAGER_REQUEST_MODE_DEFAULT = 0,
818         PACAKGE_MANAGER_REQUEST_MODE_QUIET,
819 } package_manager_request_mode_e;
820
821
822 /**
823  * @platform
824  * @brief The Package manager request handle.
825  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
826  */
827 typedef struct package_manager_request_s *package_manager_request_h;
828
829
830 /**
831  * @platform
832  * @brief Called when the progress of the request to the package manager changes.
833  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
834  * @param[in] id          The ID of the request to the package manager
835  * @param[in] type        The type of the package to install, uninstall or update
836  * @param[in] package     The name of the package to install, uninstall or update
837  * @param[in] event_type  The type of the request to the package manager
838  * @param[in] event_state The current state of the request to the package manager
839  * @param[in] progress    The progress for the request that is being processed by the package manager \n
840  *                        The range of progress is from @c 0 to @c 100.
841  * @param[in] error       The error code when the package manager failed to process the request
842  * @param[in] user_data   The user data passed from package_manager_request_set_event_cb()
843  * @see package_manager_request_set_event_cb()
844  * @see package_manager_request_unset_event_cb()
845  */
846 typedef void (*package_manager_request_event_cb) (int id, const char *type, const char *package, package_manager_event_type_e event_type, package_manager_event_state_e event_state, int progress, package_manager_error_e error, void *user_data);
847
848
849 /**
850  * @platform
851  * @brief Creates a request handle to the package manager.
852  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
853  * @remarks You must release @a request using package_manager_request_destroy().
854  * @param[out] request The request handle that is newly created on success
855  * @return @c 0 on success,
856  *         otherwise a negative error value
857  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
858  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
859  * @retval #PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY     Out of memory
860  * @retval #PACKAGE_MANAGER_ERROR_IO_ERROR          Internal I/O error
861  * @see package_manager_request_destroy()
862  */
863 int package_manager_request_create(package_manager_request_h *request);
864
865
866 /**
867  * @platform
868  * @brief Destroys the request handle to the package manager.
869  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
870  * @param[in] request The request handle to the package manager
871  * @return @c 0 on success,
872  *         otherwise a negative error value
873  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
874  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
875  * @see package_manager_request_create()
876  */
877 int package_manager_request_destroy(package_manager_request_h request);
878
879
880 /**
881  * @platform
882  * @brief Registers a callback function to be invoked when the progress of the request changes.
883  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
884  * @privlevel public
885  * @privilege %http://tizen.org/privilege/packagemanager.info
886  * @param[in] request The request handle
887  * @param[in] callback The callback function to be registered
888  * @param[in] user_data The user data to be passed to the callback function
889  * @return @c 0 on success,
890  *         otherwise a negative error value
891  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
892  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
893  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
894  * @post package_manager_request_event_cb() will be invoked.
895  * @see package_manager_request_event_cb()
896  * @see package_manager_request_unset_event_cb()
897  */
898 int package_manager_request_set_event_cb(package_manager_request_h request, package_manager_request_event_cb callback, void *user_data);
899
900
901 /**
902  * @platform
903  * @brief Unregisters the callback function.
904  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
905  * @param[in] request The request handle
906  * @return @c 0 on success,
907  *         otherwise a negative error value
908  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
909  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
910  * @see package_manager_request_event_cb()
911  * @see package_manager_request_set_event_cb()
912  */
913 int package_manager_request_unset_event_cb(package_manager_request_h request);
914
915
916 /**
917  * @platform
918  * @brief Sets the type of the package to install, uninstall, or update.
919  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
920  * @param[in] request The request handle
921  * @param[in] type    The type of the package
922  * @return @c 0 on success,
923  *         otherwise a negative error value
924  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
925  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
926  */
927 int package_manager_request_set_type(package_manager_request_h request, const char *type);
928
929
930 /**
931  * @platform
932  * @brief Sets the mode of the request.
933  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
934  * @param[in] request The request handle
935  * @param[in] mode    The mode of the request
936  * @return @c 0 on success,
937  *         otherwise a negative error value
938  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
939  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
940  */
941 int package_manager_request_set_mode(package_manager_request_h request, package_manager_request_mode_e mode);
942
943
944 /**
945  * @platform
946  * @brief Sets the path of TEP file to the request. The TEP file that is set will be installed when the package is installed.
947  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
948  * @privlevel platform
949  * @privilege %http://tizen.org/privilege/packagemanager.admin
950  * @param[in] request The request handle
951  * @param[in] tep_path The TEP path to set. If this is NULL on update, installed TEP will be removed.
952  * @return @c 0 on success,
953  *         otherwise a negative error value
954  * @retval #PACKAGE_MANAGER_ERROR_NONE Successful
955  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
956  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
957  * @retval #PACKAGE_MANAGER_ERROR_SYSTEM_ERROR           Severe system error
958  */
959 int package_manager_request_set_tep(package_manager_request_h request, const char *tep_path);
960
961
962 /**
963  * @platform
964  * @brief Installs the package located at the given path, asynchronously.
965  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
966  * @privlevel platform
967  * @privilege %http://tizen.org/privilege/packagemanager.admin
968  * @param[in]  request The request handle
969  * @param[in]  path    The absolute path to the package to be installed
970  * @param[out] id      The ID of the request to the package manager
971  * @return @c 0 on success,
972  *         otherwise a negative error value
973  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
974  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
975  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
976  * @see package_manager_request_uninstall()
977  */
978 int package_manager_request_install(package_manager_request_h request, const char *path, int *id);
979
980
981 /**
982  * @platform
983  * @brief Installs the package located at the given path, asynchronously.
984  * @details The progress of the request is asynchronously received by the callback function.
985  *          The @a callback is the individual callback only called for the current API call.
986  *          The @a callback is the only callback called, even if another callback was set for this request
987  *          with package_manager_request_set_event_cb().
988  * @since_tizen 4.0
989  * @privlevel platform
990  * @privilege %http://tizen.org/privilege/packagemanager.admin
991  * @param[in]  request   The request handle
992  * @param[in]  path      The absolute path to the package to be installed
993  * @param[in]  callback  The callback function to be invoked
994  * @param[in]  user_data The user data to be passed to the callback function
995  * @param[out] id        The ID of the request to the package manager
996  * @return @c 0 on success,
997  *         otherwise a negative error value
998  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
999  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
1000  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
1001  */
1002 int package_manager_request_install_with_cb(package_manager_request_h request,
1003                                                 const char *path,
1004                                                 package_manager_request_event_cb callback,
1005                                                 void *user_data,
1006                                                 int *id);
1007
1008
1009 /**
1010  * @platform
1011  * @brief Uninstalls the package with the given name, asynchronously.
1012  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1013  * @privlevel platform
1014  * @privilege %http://tizen.org/privilege/packagemanager.admin
1015  * @param[in]  request The request handle
1016  * @param[in]  name    The name of the package to be uninstalled
1017  * @param[out] id      The ID of the request to the package manager
1018  * @return @c 0 on success,
1019  *         otherwise a negative error value
1020  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
1021  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
1022  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
1023  */
1024 int package_manager_request_uninstall(package_manager_request_h request, const char *name, int *id);
1025
1026
1027 /**
1028  * @platform
1029  * @brief Uninstalls the package with the given name, asynchronously.
1030  * @details The progress of the request is asynchronously received by the callback function.
1031  *          The @a callback is the individual callback only called for the current API call.
1032  *          The @a callback is the only callback called, even if another callback was set for this request
1033  *          with package_manager_request_set_event_cb().
1034  * @since_tizen 4.0
1035  * @privlevel platform
1036  * @privilege %http://tizen.org/privilege/packagemanager.admin
1037  * @param[in]  request   The request handle
1038  * @param[in]  name      The name of the package to be uninstalled
1039  * @param[in]  callback  The callback function to be invoked
1040  * @param[in]  user_data The user data to be passed to the callback function
1041  * @param[out] id        The ID of the request to the package manager
1042  * @return @c 0 on success,
1043  *         otherwise a negative error value
1044  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
1045  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
1046  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
1047  */
1048 int package_manager_request_uninstall_with_cb(package_manager_request_h request,
1049                                                 const char *name,
1050                                                 package_manager_request_event_cb callback,
1051                                                 void *user_data,
1052                                                 int *id);
1053
1054
1055 /**
1056  * @platform
1057  * @brief Moves the package from SD card to the internal memory and vice versa, asynchronously.
1058  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1059  * @privlevel platform
1060  * @privilege %http://tizen.org/privilege/packagemanager.admin
1061  * @param[in] request   The request handle
1062  * @param[in] name      The name of the package to be moved
1063  * @param[in] move_type The move type [enum package_manager_move_type_e], [external to internal/internal to external]
1064  * @return @c 0 on success,
1065  *         otherwise a negative error value
1066  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
1067  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
1068  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
1069  */
1070 int package_manager_request_move(package_manager_request_h request, const char *name, package_manager_move_type_e move_type);
1071
1072
1073 /**
1074  * @platform
1075  * @brief Moves the package from SD card to the internal memory and vice versa, asynchronously.
1076  * @details The progress of the request is asynchronously received by the callback function.
1077  *          The @a callback is the individual callback only called for the current API call.
1078  *          The @a callback is the only callback called, even if another callback was set for this request
1079  *          with package_manager_request_set_event_cb().
1080  * @since_tizen 4.0
1081  * @privlevel platform
1082  * @privilege %http://tizen.org/privilege/packagemanager.admin
1083  * @param[in]  request   The request handle
1084  * @param[in]  name      The name of the package to be moved
1085  * @param[in]  move_type The move type [enum package_manager_move_type_e], [external to internal/internal to external]
1086  * @param[in]  callback  The callback function to be invoked
1087  * @param[in]  user_data The user data to be passed to the callback function
1088  * @param[out] id        The ID of the request to the package manager
1089  * @return @c 0 on success,
1090  *         otherwise a negative error value
1091  * @retval #PACKAGE_MANAGER_ERROR_NONE              Successful
1092  * @retval #PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
1093  * @retval #PACKAGE_MANAGER_ERROR_PERMISSION_DENIED Permission denied
1094  */
1095 int package_manager_request_move_with_cb(package_manager_request_h request,
1096                                                 const char *name,
1097                                                 package_manager_move_type_e move_type,
1098                                                 package_manager_request_event_cb callback,
1099                                                 void *user_data,
1100                                                 int *id);
1101
1102
1103 /**
1104 * @}
1105 */
1106
1107 #ifdef __cplusplus
1108 }
1109 #endif
1110
1111 #endif /* __TIZEN_APPFW_PACKAGE_MANAGER_H */