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