2 * Copyright (c) 2023 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __TIZEN_WEB_DOWNLOAD_EXTENSION_H__
18 #define __TIZEN_WEB_DOWNLOAD_EXTENSION_H__
26 * @file download_extension.h
30 * @addtogroup CAPI_WEB_DOWNLOAD_MODULE
36 * @brief Sets the max size of the cache.
40 * @privilege %http://tizen.org/privilege/download
42 * @remarks The default size is 1000 MB.
44 * @param[in] size The max size of the cache (MB)
46 * @return @c 0 on success,
47 * otherwise a negative error value
49 * @retval #DOWNLOAD_ERROR_NONE Successful
50 * @retval #DOWNLOAD_ERROR_NOT_SUPPORTED Not supported
51 * @retval #DOWNLOAD_ERROR_PERMISSION_DENIED Permission denied
52 * @retval #DOWNLOAD_ERROR_INVALID_PARAMETER Invalid parameter
53 * @retval #DOWNLOAD_ERROR_ID_NOT_FOUND No download ID
55 * @see download_get_cache_max_size()
57 int download_set_cache_max_size(unsigned int size);
61 * @brief Gets the max size of the cache.
65 * @privilege %http://tizen.org/privilege/download
67 * @param[out] size The max size of the cache (MB)
69 * @return @c 0 on success,
70 * otherwise a negative error value
72 * @retval #DOWNLOAD_ERROR_NONE Successful
73 * @retval #DOWNLOAD_ERROR_NOT_SUPPORTED Not supported
74 * @retval #DOWNLOAD_ERROR_PERMISSION_DENIED Permission denied
75 * @retval #DOWNLOAD_ERROR_INVALID_PARAMETER Invalid parameter
76 * @retval #DOWNLOAD_ERROR_ID_NOT_FOUND No download ID
78 * @see download_set_cache_max_size()
80 int download_get_cache_max_size(unsigned int *size);
84 * @brief Clears all cache.
88 * @privilege %http://tizen.org/privilege/download
90 * @return 0 on success, otherwise a negative error value
92 * @retval #DOWNLOAD_ERROR_NONE Successful
93 * @retval #DOWNLOAD_ERROR_NOT_SUPPORTED Not supported
94 * @retval #DOWNLOAD_ERROR_PERMISSION_DENIED Permission denied
95 * @retval #DOWNLOAD_ERROR_ID_NOT_FOUND No download ID
97 int download_reset_all_cache(void);
101 * @brief Sets the path of the cache stored.
105 * @privilege %http://tizen.org/privilege/download
107 * @param[in] path the path of the cache stored
109 * @return @c 0 on success,
110 * otherwise a negative error value
112 * @retval #DOWNLOAD_ERROR_NONE Successful
113 * @retval #DOWNLOAD_ERROR_NOT_SUPPORTED Not supported
114 * @retval #DOWNLOAD_ERROR_PERMISSION_DENIED Permission denied
115 * @retval #DOWNLOAD_ERROR_INVALID_PARAMETER Invalid parameter
116 * @retval #DOWNLOAD_ERROR_ID_NOT_FOUND No download ID
118 * @see download_get_cache_path()
120 int download_set_cache_path(const char *path);
124 * @brief Gets the path of the cache stored.
128 * @privilege %http://tizen.org/privilege/download
130 * @param[out] path the path of the cache stored
132 * @return @c 0 on success,
133 * otherwise a negative error value
135 * @retval #DOWNLOAD_ERROR_NONE Successful
136 * @retval #DOWNLOAD_ERROR_NOT_SUPPORTED Not supported
137 * @retval #DOWNLOAD_ERROR_PERMISSION_DENIED Permission denied
138 * @retval #DOWNLOAD_ERROR_INVALID_PARAMETER Invalid parameter
139 * @retval #DOWNLOAD_ERROR_ID_NOT_FOUND No download ID
141 * @see download_set_cache_path()
143 int download_get_cache_path(char **path);
147 * @brief Sets the life cycle of the cache.
151 * @privilege %http://tizen.org/privilege/download
153 * @remarks The default time is 48 * 3600 seconds.
155 * @param[in] time The life cycle of the cache (seconds)
157 * @return @c 0 on success,
158 * otherwise a negative error value
160 * @retval #DOWNLOAD_ERROR_NONE Successful
161 * @retval #DOWNLOAD_ERROR_NOT_SUPPORTED Not supported
162 * @retval #DOWNLOAD_ERROR_PERMISSION_DENIED Permission denied
163 * @retval #DOWNLOAD_ERROR_INVALID_PARAMETER Invalid parameter
164 * @retval #DOWNLOAD_ERROR_ID_NOT_FOUND No download ID
166 * @see download_get_cache_lifecycle()
168 int download_set_cache_lifecycle(unsigned int time);
172 * @brief Gets the life cycle of the cache.
176 * @privilege %http://tizen.org/privilege/download
178 * @param[out] time The life cycle of the cache (seconds)
180 * @return @c 0 on success,
181 * otherwise a negative error value
183 * @retval #DOWNLOAD_ERROR_NONE Successful
184 * @retval #DOWNLOAD_ERROR_NOT_SUPPORTED Not supported
185 * @retval #DOWNLOAD_ERROR_PERMISSION_DENIED Permission denied
186 * @retval #DOWNLOAD_ERROR_INVALID_PARAMETER Invalid parameter
187 * @retval #DOWNLOAD_ERROR_ID_NOT_FOUND No download ID
189 * @see download_set_cache_lifecycle()
191 int download_get_cache_lifecycle(unsigned int *time);
200 #endif /* __TIZEN_WEB_DOWNLOAD_EXTENSION_H__ */