namespace Cef3 { using System; using System.Collections.Generic; using System.Diagnostics; using System.Runtime.InteropServices; using Cef3.Interop; /// /// Class used to represent a download item. /// public sealed unsafe partial class CefDownloadItem { /// /// Returns true if this object is valid. Do not call any other methods if this /// function returns false. /// public bool IsValid { get { return cef_download_item_t.is_valid(_self) != 0; } } /// /// Returns true if the download is in progress. /// public bool IsInProgress { get { return cef_download_item_t.is_in_progress(_self) != 0; } } /// /// Returns true if the download is complete. /// public bool IsComplete { get { return cef_download_item_t.is_complete(_self) != 0; } } /// /// Returns true if the download has been canceled or interrupted. /// public bool IsCanceled { get { return cef_download_item_t.is_canceled(_self) != 0; } } /// /// Returns a simple speed estimate in bytes/s. /// public long CurrentSpeed { get { return cef_download_item_t.get_current_speed(_self); } } /// /// Returns the rough percent complete or -1 if the receive total size is /// unknown. /// public int PercentComplete { get { return cef_download_item_t.get_percent_complete(_self); } } /// /// Returns the total number of bytes. /// public long TotalBytes { get { return cef_download_item_t.get_total_bytes(_self); } } /// /// Returns the number of received bytes. /// public long ReceivedBytes { get { return cef_download_item_t.get_received_bytes(_self); } } /// /// Returns the time that the download started. /// public DateTime StartTime { get { var n_result = cef_download_item_t.get_start_time(_self); return cef_time_t.ToDateTime(&n_result); } } /// /// Returns the time that the download ended. /// public DateTime EndTime { get { var n_result = cef_download_item_t.get_end_time(_self); return cef_time_t.ToDateTime(&n_result); } } /// /// Returns the full path to the downloaded or downloading file. /// public string FullPath { get { var n_result = cef_download_item_t.get_full_path(_self); return cef_string_userfree.ToString(n_result); } } /// /// Returns the unique identifier for this download. /// public uint Id { get { return cef_download_item_t.get_id(_self); } } /// /// Returns the URL. /// public string Url { get { var n_result = cef_download_item_t.get_url(_self); return cef_string_userfree.ToString(n_result); } } /// /// Returns the original URL before any redirections. /// public string OriginalUrl { get { var n_result = cef_download_item_t.get_original_url(_self); return cef_string_userfree.ToString(n_result); } } /// /// Returns the suggested file name. /// public string SuggestedFileName { get { var n_result = cef_download_item_t.get_suggested_file_name(_self); return cef_string_userfree.ToString(n_result); } } /// /// Returns the content disposition. /// public string ContentDisposition { get { var n_result = cef_download_item_t.get_content_disposition(_self); return cef_string_userfree.ToString(n_result); } } /// /// Returns the mime type. /// public string MimeType { get { var n_result = cef_download_item_t.get_mime_type(_self); return cef_string_userfree.ToString(n_result); } } } }