Struct xpcom::interfaces::nsIDownload
[−]
[src]
#[repr(C)]pub struct nsIDownload { /* fields omitted */ }
interface nsIDownload : nsITransfer
/**
* Represents a download object.
*
* @note This object is no longer updated once it enters a completed state.
* Completed states are the following:
* nsIDownloadManager::DOWNLOAD_FINISHED
* nsIDownloadManager::DOWNLOAD_FAILED
* nsIDownloadManager::DOWNLOAD_CANCELED
* nsIDownloadManager::DOWNLOAD_BLOCKED_PARENTAL
* nsIDownloadManager::DOWNLOAD_DIRTY
* nsIDownloadManager::DOWNLOAD_BLOCKED_POLICY
*/
Methods
impl nsIDownload
[src]
pub fn coerce<T: nsIDownloadCoerce>(&self) -> &T
[src]
Cast this nsIDownload
to one of its base interfaces.
impl nsIDownload
[src]
pub unsafe fn GetTargetFile(&self, aTargetFile: *mut *const nsIFile) -> nsresult
[src]
/**
* The target of a download is always a file on the local file system.
*/
readonly attribute nsIFile targetFile;
pub unsafe fn GetPercentComplete(
&self,
aPercentComplete: *mut int32_t
) -> nsresult
[src]
&self,
aPercentComplete: *mut int32_t
) -> nsresult
/**
* The percentage of transfer completed.
* If the file size is unknown it'll be -1 here.
*/
readonly attribute long percentComplete;
pub unsafe fn GetAmountTransferred(
&self,
aAmountTransferred: *mut int64_t
) -> nsresult
[src]
&self,
aAmountTransferred: *mut int64_t
) -> nsresult
/**
* The amount of bytes downloaded so far.
*/
readonly attribute long long amountTransferred;
pub unsafe fn GetSize(&self, aSize: *mut int64_t) -> nsresult
[src]
/**
* The size of file in bytes.
* Unknown size is represented by -1.
*/
readonly attribute long long size;
pub unsafe fn GetSource(&self, aSource: *mut *const nsIURI) -> nsresult
[src]
/**
* The source of the transfer.
*/
readonly attribute nsIURI source;
pub unsafe fn GetTarget(&self, aTarget: *mut *const nsIURI) -> nsresult
[src]
/**
* The target of the transfer.
*/
readonly attribute nsIURI target;
pub unsafe fn GetCancelable(
&self,
aCancelable: *mut *const nsICancelable
) -> nsresult
[src]
&self,
aCancelable: *mut *const nsICancelable
) -> nsresult
/**
* Object that can be used to cancel the download.
* Will be null after the download is finished.
*/
readonly attribute nsICancelable cancelable;
pub unsafe fn GetDisplayName(&self, aDisplayName: &mut nsAString) -> nsresult
[src]
/**
* The user-readable description of the transfer.
*/
readonly attribute AString displayName;
pub unsafe fn GetStartTime(&self, aStartTime: *mut int64_t) -> nsresult
[src]
/**
* The time a transfer was started.
*/
readonly attribute long long startTime;
pub unsafe fn GetSpeed(&self, aSpeed: *mut c_double) -> nsresult
[src]
/**
* The speed of the transfer in bytes/sec.
*/
readonly attribute double speed;
pub unsafe fn GetMIMEInfo(&self, aMIMEInfo: *mut *const nsIMIMEInfo) -> nsresult
[src]
/**
* Optional. If set, it will contain the target's relevant MIME information.
* This includes its MIME Type, helper app, and whether that helper should be
* executed.
*/
readonly attribute nsIMIMEInfo MIMEInfo;
pub unsafe fn GetId(&self, aId: *mut uint32_t) -> nsresult
[src]
/**
* The id of the download that is stored in the database - not globally unique.
* For example, a private download and a public one might have identical ids.
* Can only be safely used for direct database manipulation in the database that
* contains this download. Use the guid property instead for safe, database-agnostic
* searching and manipulation.
*
* @deprecated
*/
readonly attribute unsigned long id;
pub unsafe fn GetGuid(&self, aGuid: &mut nsACString) -> nsresult
[src]
/**
* The guid of the download that is stored in the database.
* Has the form of twelve alphanumeric characters.
*/
readonly attribute ACString guid;
pub unsafe fn GetState(&self, aState: *mut int16_t) -> nsresult
[src]
/**
* The state of the download.
* @see nsIDownloadManager and nsIXPInstallManagerUI
*/
readonly attribute short state;
pub unsafe fn GetReferrer(&self, aReferrer: *mut *const nsIURI) -> nsresult
[src]
/**
* The referrer uri of the download. This is only valid for HTTP downloads,
* and can be null.
*/
readonly attribute nsIURI referrer;
pub unsafe fn GetResumable(&self, aResumable: *mut bool) -> nsresult
[src]
/**
* Indicates if the download can be resumed after being paused or not. This
* is only the case if the download is over HTTP/1.1 or FTP and if the
* server supports it.
*/
readonly attribute boolean resumable;
pub unsafe fn GetIsPrivate(&self, aIsPrivate: *mut bool) -> nsresult
[src]
/**
* Indicates if the download was initiated from a context marked as private,
* controlling whether it should be stored in a permanent manner or not.
*/
readonly attribute boolean isPrivate;
pub unsafe fn Cancel(&self) -> nsresult
[src]
/**
* Cancel this download if it's currently in progress.
*/
void cancel ();
pub unsafe fn Pause(&self) -> nsresult
[src]
/**
* Pause this download if it is in progress.
*
* @throws NS_ERROR_UNEXPECTED if it cannot be paused.
*/
void pause ();
pub unsafe fn Resume(&self) -> nsresult
[src]
/**
* Resume this download if it is paused.
*
* @throws NS_ERROR_UNEXPECTED if it cannot be resumed or is not paused.
*/
void resume ();
pub unsafe fn Remove(&self) -> nsresult
[src]
/**
* Instruct the download manager to remove this download. Whereas
* cancel simply cancels the transfer, but retains information about it,
* remove removes all knowledge of it.
*
* @see nsIDownloadManager.removeDownload for more detail
* @throws NS_ERROR_FAILURE if the download is active.
*/
void remove ();
pub unsafe fn Retry(&self) -> nsresult
[src]
/**
* Instruct the download manager to retry this failed download
* @throws NS_ERROR_NOT_AVAILABLE if the download is not known.
* @throws NS_ERROR_FAILURE if the download is not in the following states:
* nsIDownloadManager::DOWNLOAD_CANCELED
* nsIDownloadManager::DOWNLOAD_FAILED
*/
void retry ();
Methods from Deref<Target = nsITransfer>
pub fn coerce<T: nsITransferCoerce>(&self) -> &T
[src]
Cast this nsITransfer
to one of its base interfaces.
pub unsafe fn Init(
&self,
aSource: *const nsIURI,
aTarget: *const nsIURI,
aDisplayName: &nsAString,
aMIMEInfo: *const nsIMIMEInfo,
startTime: PRTime,
aTempFile: *const nsIFile,
aCancelable: *const nsICancelable,
aIsPrivate: bool
) -> nsresult
[src]
&self,
aSource: *const nsIURI,
aTarget: *const nsIURI,
aDisplayName: &nsAString,
aMIMEInfo: *const nsIMIMEInfo,
startTime: PRTime,
aTempFile: *const nsIFile,
aCancelable: *const nsICancelable,
aIsPrivate: bool
) -> nsresult
/**
* Initializes the transfer with certain properties. This function must
* be called prior to accessing any properties on this interface.
*
* @param aSource The source URI of the transfer. Must not be null.
*
* @param aTarget The target URI of the transfer. Must not be null.
*
* @param aDisplayName The user-readable description of the transfer.
* Can be empty.
*
* @param aMIMEInfo The MIME info associated with the target,
* including MIME type and helper app when appropriate.
* This parameter is optional.
*
* @param startTime Time when the download started (ie, when the first
* response from the server was received)
* XXX presumably wbp and exthandler do this differently
*
* @param aTempFile The location of a temporary file; i.e. a file in which
* the received data will be stored, but which is not
* equal to the target file. (will be moved to the real
* target by the caller, when the download is finished)
* May be null.
*
* @param aCancelable An object that can be used to abort the download.
* Must not be null.
* Implementations are expected to hold a strong
* reference to this object until the download is
* finished, at which point they should release the
* reference.
*
* @param aIsPrivate Used to determine the privacy status of the new transfer.
* If true, indicates that the transfer was initiated from
* a source that desires privacy.
*/
void init (in nsIURI aSource, in nsIURI aTarget, in AString aDisplayName, in nsIMIMEInfo aMIMEInfo, in PRTime startTime, in nsIFile aTempFile, in nsICancelable aCancelable, in boolean aIsPrivate);
pub unsafe fn SetSha256Hash(&self, aHash: &nsACString) -> nsresult
[src]
void setSha256Hash (in ACString aHash);
pub unsafe fn SetSignatureInfo(
&self,
aSignatureInfo: *const nsIArray
) -> nsresult
[src]
&self,
aSignatureInfo: *const nsIArray
) -> nsresult
void setSignatureInfo (in nsIArray aSignatureInfo);
pub unsafe fn SetRedirects(&self, aRedirects: *const nsIArray) -> nsresult
[src]
void setRedirects (in nsIArray aRedirects);
Trait Implementations
impl XpCom for nsIDownload
[src]
const IID: nsIID
IID: nsIID = nsID(576255077, 25966, 17766, [135, 203, 247, 145, 219, 175, 3, 34])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for nsIDownload
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsIDownload
[src]
type Target = nsITransfer
The resulting type after dereferencing.
fn deref(&self) -> &nsITransfer
[src]
Dereferences the value.