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