/// <summary>
/// Enumeration for download state.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public enum DownloadState
{
/// <summary>
/// Unhandled exception
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
None = 0,
/// <summary>
/// Ready to download
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
Ready,
/// <summary>
/// Queued to start downloading
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
Queued,
/// <summary>
/// Currently downloading
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
Downloading,
/// <summary>
/// Download is paused and can be resumed
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
Paused,
/// <summary>
/// The download is completed
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
Completed,
/// <summary>
/// The download failed
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
Failed,
/// <summary>
/// User canceled the download request
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
Canceled
}
/// <summary>
/// Enumeration for network type.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public enum NetworkType
{
/// <summary>
/// Download is available through data network
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
DataNetwork = 0,
/// <summary>
/// Download is available through WiFi
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
Wifi,
/// <summary>
/// Download is available through WiFi-Direct
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
WifiDirect,
/// <summary>
/// Download is available through either data network or WiFi
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
All
}
/// <summary>
/// Enumeration for notification type.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public enum NotificationType
{
/// <summary>
/// Do not register notification
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
None = 0,
/// <summary>
/// Completion notification for success state and failed state
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
CompleteOnly,
/// <summary>
/// All download notifications for ongoing state, success state and failed state
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
All
}
/// <summary>
/// The Notification class consists of all the properties required to set notifications for download operation.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class Notification
{
private int _downloadId;
/// <summary>
/// Creates a Notification object
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Notification(int requestId)
{
_downloadId = requestId;
/// Title of the notification.
/// If user tries to get before setting, empty string is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
/// Description of the notification.
/// If user tries to get before setting, empty string is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
/// Type of Notification.
/// If user tries to get before setting, default NotificationType None is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
/// AppControl for an ongoing download notification.
/// If user tries to get before setting, null is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// When the notification message is clicked, the action is decided by the app control.
/// AppControl for a completed download notification.
/// If user tries to get before setting, null is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// When the notification message is clicked, the action is decided by the app control
/// AppControl for a failed download notification.
/// If user tries to get before setting, null is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// When the notification message is clicked, the action is decided by the app control
/// <summary>
/// The Request class provides functions to create and manage a single download request.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class Request : IDisposable
{
private int _downloadId;
/// <summary>
/// Creates a Request object.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <param name="url"> URL to download</param>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
/// <summary>
/// Creates a Request object.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <param name="url"> URL to download</param>
/// <param name="destinationPath"> Directory path where downloaded file is stored </param>
/// <param name="fileName"> Name of the downloaded file </param>
/// <summary>
/// Creates a Request object.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <param name="url"> URL to download</param>
/// <param name="destinationPath"> Directory path where downloaded file is stored </param>
/// <param name="fileName"> Name of the downloaded file </param>
/// <summary>
/// Event that occurs when the download state changes.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
/// <summary>
/// Event that occurs when the download progress changes.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
/// Absolute path where the file will be downloaded.
/// If you try to get this property value before calling Start(), an empty string is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// Returns empty string if download is not completed or if state has not yet changed to Completed or if any other error occurs.
/// MIME type of the downloaded content.
/// If you try to get this property value before calling Start(), an empty string is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
/// <summary>
/// Current state of the download.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
/// This can be defined with reference of HTTP response header data. The content name can be received when HTTP response header is received.
/// If you try to get this property value before calling Start(), an empty string is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
/// This information is received from the server. If the server does not send the total size of the content, content_size is set to zero.
/// If you try to get this property value before calling Start(), 0 is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
/// HTTP status code when a download exception occurs.
/// If you try to get this property value before calling Start(), 0 is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// State of download request must be DownlodState.Failed.
/// ETag value from the HTTP response header when making a HTTP request for resume.
/// If you try to get this property value before calling Start() or if any other error occurs, an empty string is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// The etag value is available or not depending on the web server. If not available, then on get of the property null is returned.
/// <summary>
/// Contains properties required for creating download notifications.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <remarks>
/// When the notification message is clicked, the action taken by the system is decided by the app control properties of the NotificationProperties instance.
/// If the app control is not set, the following default operation is executed when the notification message is clicked:
/// <summary>
/// Full path of the temporary file which stores downloaded content.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// The download state must be one of the states after Downloading.
/// <summary>
/// URL to download.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// Should be set before calling Start().
/// The file will be downloaded only under the allowed network.
/// If you try to get this property value before setting or if any other error occurs, default value NetworkType All is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <feature>http://tizen.org/feature/network.wifi</feature>
/// <feature>http://tizen.org/feature/network.wifi.direct</feature>
/// The file will be downloaded to the set destination file path. The downloaded file is saved to an auto-generated file name in the destination. If the destination is not specified, the file will be downloaded to default storage.
/// If you try to get this property value before setting or if any other error occurs, an empty string is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// Should be set before calling Start().
/// The file will be saved in the specified destination or default storage with the set file name. If the file name is not specified, the downloaded file will be saved with an auto-generated file name in the destination.
/// If you try to get this property value before setting or if any other error occurs, an empty string is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// Should be set before calling Start().
/// If this option is enabled, the previous downloading item is restarted automatically as soon as the download daemon is restarted. The download progress continues after the client process is terminated.
/// If you try to get this property value before setting, default value false is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// The default value is false.
/// The given HTTP header field will be included with the HTTP request of the download request.
/// If you try to get this property value before setting, an empty dictionary is returned.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <remarks>
/// HTTP header fields should be set before calling Start().
/// HTTP header fields can be removed before calling Start().
/// Sets the directory path of a temporary file used in a previous download request.
/// This is only useful when resuming download to make HTTP request header at the client side. Otherwise, the path is ignored.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// If the etag value is not present in the download database, it is not useful to set the temporary file path.
/// Starts or resumes download.
/// Starts to download the current URL, or resumes the download if paused.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// The URL is the mandatory information to start the download.
/// <summary>
/// Pauses download request.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// The paused download request can be restarted with Start() or canceled with Cancel().
/// <summary>
/// Cancels download request.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// The canceled download can be restarted with Start().
/// <summary>
/// Releases all resources used by the Request class.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <remarks>
/// After calling this method, download request related data exists in the download database for a certain period of time. Within that time, it is possible to use other APIs with this data.
/// <summary>
/// Deletes the corresponding download request.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/download</privilege>
/// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>