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]

[src]

Cast this nsIDownload to one of its base interfaces.

impl nsIDownload
[src]

[src]

/**
     * The target of a download is always a file on the local file system.
     */

readonly attribute nsIFile targetFile;

[src]

/**
     * The percentage of transfer completed.
     * If the file size is unknown it'll be -1 here.
     */

readonly attribute long percentComplete;

[src]

/**
     * The amount of bytes downloaded so far.
     */

readonly attribute long long amountTransferred;

[src]

/**
     * The size of file in bytes.
     * Unknown size is represented by -1.
     */

readonly attribute long long size;

[src]

/**
     * The source of the transfer.
     */

readonly attribute nsIURI source;

[src]

/**
     * The target of the transfer.
     */

readonly attribute nsIURI target;

[src]

/**
     * Object that can be used to cancel the download.
     * Will be null after the download is finished.
     */

readonly attribute nsICancelable cancelable;

[src]

/**
     * The user-readable description of the transfer.
     */

readonly attribute AString displayName;

[src]

/**
     * The time a transfer was started.
     */

readonly attribute long long startTime;

[src]

/**
     * The speed of the transfer in bytes/sec.
     */

readonly attribute double speed;

[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;

[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;

[src]

/**
     * The guid of the download that is stored in the database.
     * Has the form of twelve alphanumeric characters.
     */

readonly attribute ACString guid;

[src]

/**
     * The state of the download.
     * @see nsIDownloadManager and nsIXPInstallManagerUI
     */

readonly attribute short state;

[src]

/**
     * The referrer uri of the download.  This is only valid for HTTP downloads,
     * and can be null.
     */

readonly attribute nsIURI referrer;

[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;

[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;

[src]

/**
     * Cancel this download if it's currently in progress.
     */

void cancel ();

[src]

/**
     * Pause this download if it is in progress.
     *
     * @throws NS_ERROR_UNEXPECTED if it cannot be paused.
     */

void pause ();

[src]

/**
     * Resume this download if it is paused.
     *
     * @throws NS_ERROR_UNEXPECTED if it cannot be resumed or is not paused.
     */

void resume ();

[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 ();

[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>

[src]

Cast this nsITransfer to one of its base interfaces.

[src]

/**
     * 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);

[src]

void setSha256Hash (in ACString aHash);

[src]

void setSignatureInfo (in nsIArray aSignatureInfo);

[src]

void setRedirects (in nsIArray aRedirects);

Trait Implementations

impl XpCom for nsIDownload
[src]

IID: nsIID = nsID(576255077, 25966, 17766, [135, 203, 247, 145, 219, 175, 3, 34])

[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]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIDownload
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.