Add prototype of new APIs for cache support 41/290141/3 accepted/tizen/unified/20230414.125150
authorJaehyun Kim <jeik01.kim@samsung.com>
Mon, 20 Mar 2023 13:30:19 +0000 (22:30 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Fri, 24 Mar 2023 08:20:36 +0000 (17:20 +0900)
Change-Id: I5fc4c6cc1a7d9e9fb0c39797d988b334f4f3ce73
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
include/download.h

index 1a6ee68..630d828 100755 (executable)
@@ -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);
+
+
 /**
  * @}
  */