From: Jaehyun Kim Date: Mon, 20 Mar 2023 13:30:19 +0000 (+0900) Subject: Add prototype of new APIs for cache support X-Git-Tag: accepted/tizen/unified/20230414.125150^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d81453a26f21fadac16740d0addd9ed348794c2d;p=platform%2Fcore%2Fapi%2Furl-download.git Add prototype of new APIs for cache support Change-Id: I5fc4c6cc1a7d9e9fb0c39797d988b334f4f3ce73 Signed-off-by: Jaehyun Kim --- diff --git a/include/download.h b/include/download.h index 1a6ee68..630d828 100755 --- a/include/download.h +++ b/include/download.h @@ -1409,6 +1409,74 @@ int download_get_notification_type(int download_id, download_notification_type_e * @see download_set_temp_file_path() */ int download_get_etag(int download_id, char **etag); + + +/** + * @brief Sets the 'enabled' state of the cache feature. + * + * @since_tizen 7.5 + * @privlevel public + * @privilege %http://tizen.org/privilege/download + * + * @param[in] download_id The download id + * @param[in] enable The enable value + * + * @return 0 on success, otherwise a negative error value + * + * @retval #DOWNLOAD_ERROR_NONE Successful + * @retval #DOWNLOAD_ERROR_NOT_SUPPORTED Not supported + * @retval #DOWNLOAD_ERROR_PERMISSION_DENIED Permission denied + * @retval #DOWNLOAD_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #DOWNLOAD_ERROR_ID_NOT_FOUND No download ID + * @retval #DOWNLOAD_ERROR_IO_ERROR Internal I/O error + * + * @see download_get_cache() +*/ +int download_set_cache(int download_id, bool enable); + + +/** + * @brief Gets the 'enabled' state of the cache feature. + * + * @since_tizen 7.5 + * @privlevel public + * @privilege %http://tizen.org/privilege/download + * + * @param[in] download_id The download id + * @param[out] enable The enable value + * + * @return 0 on success, otherwise a negative error value + * + * @retval #DOWNLOAD_ERROR_NONE Successful + * @retval #DOWNLOAD_ERROR_NOT_SUPPORTED Not supported + * @retval #DOWNLOAD_ERROR_PERMISSION_DENIED Permission denied + * @retval #DOWNLOAD_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #DOWNLOAD_ERROR_ID_NOT_FOUND No download ID + * @retval #DOWNLOAD_ERROR_IO_ERROR Internal I/O error + * + * @see download_set_cache() + */ +int download_get_cache(int download_id, bool *enable); + + +/** + * @brief Clears the cache. + * + * @since_tizen 7.5 + * @privlevel public + * @privilege %http://tizen.org/privilege/download + * + * @return 0 on success, otherwise a negative error value + * + * @retval #DOWNLOAD_ERROR_NONE Successful + * @retval #DOWNLOAD_ERROR_NOT_SUPPORTED Not supported + * @retval #DOWNLOAD_ERROR_PERMISSION_DENIED Permission denied + * @retval #DOWNLOAD_ERROR_TOO_MANY_DOWNLOADS Too many simultaneous downloads + * @retval #DOWNLOAD_ERROR_IO_ERROR Internal I/O error + */ +int download_reset_cache(void); + + /** * @} */