Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
nsIDownloadManager Interface Reference

import "nsIDownloadManager.idl";

Inheritance diagram for nsIDownloadManager:
Inheritance graph
[legend]
Collaboration diagram for nsIDownloadManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

nsIDownload addDownload (in short aDownloadType, in nsIURI aSource, in nsIURI aTarget, in AString aDisplayName, in AString aIconURL, in nsIMIMEInfo aMIMEInfo, in PRTime aStartTime, in nsILocalFile aTempFile, in nsICancelable aCancelable)
 Creates an nsIDownload and adds it to be managed by the download manager.
nsIDownload getDownload (in wstring aPersistentDescriptor)
 Retrieves an in-progress download managed by the download manager.
void cancelDownload (in wstring aPersistentDescriptor)
 Cancels the download with the specified persistent descriptor if it's currently in progress.
void removeDownload (in wstring aPersistentDescriptor)
 Removes the download with the specified persistent descriptor if it's not currently in progress.
void pauseDownload (in wstring aPersistentDescriptor)
 Pause the specified download.
void resumeDownload (in wstring aPersistentDescriptor)
 Resume the specified download.
void open (in nsIDOMWindow aParent, in wstring aPersistentDescriptor)
 Opens the Download Manager front end.
void startBatchUpdate ()
 Indicate that a batch update (e.g.
void endBatchUpdate ()
 Indicate that a batch update is ending.
void cleanUp ()
 Removes completed, failed, and canceled downloads from the list.
void saveState ()
 Update the download datasource.
void flush ()
 Flush the download datasource to disk.
nsIDownload addDownload (in nsIURI aSource, in nsIURI aTarget, in AString aDisplayName, in nsIMIMEInfo aMIMEInfo, in PRTime startTime, in nsILocalFile aTempFile, in nsICancelable aCancelable)
 Creates an nsIDownload and adds it to be managed by the download manager.
nsIDownload getDownload (in AUTF8String aTargetPath)
 Retrieves an in-progress download managed by the download manager.
void cancelDownload (in AUTF8String aTargetPath)
 Cancels the download with the specified target path if it's currently in progress.
void pauseDownload (in nsIDownload aDownload)
 Pause a download to allow later resumal.
void resumeDownload (in AUTF8String aTargetPath)
 Resume a previously paused download.
void removeDownload (in AUTF8String aTargetPath)
 Removes the download with the specified target path if it's not currently in progress.
void open (in nsIDOMWindow aParent, in nsIDownload aDownload)
 Opens the Download Manager front end.
void openProgressDialogFor (in nsIDownload aDownload, in nsIDOMWindow aParent, in boolean aCancelDownloadOnClose)
 Opens an individual progress dialog displaying progress for the download.
void onClose ()
 Called when the download manager front end is closed.
void startBatchUpdate ()
 Indicate that a batch update (e.g.
void endBatchUpdate ()
 Indicate that a batch update is ending.

Public Attributes

const short DOWNLOAD_NOTSTARTED = -1
const short DOWNLOAD_DOWNLOADING = 0
const short DOWNLOAD_FINISHED = 1
const short DOWNLOAD_FAILED = 2
const short DOWNLOAD_CANCELED = 3
const short DOWNLOAD_PAUSED = 4
const short DOWNLOAD_TYPE_DOWNLOAD = 0
attribute
nsIDownloadProgressListener 
listener
 The Download Manager's progress listener.
readonly attribute boolean canCleanUp
 Whether or not there are downloads that can be cleaned up (removed) i.e.
readonly attribute long activeDownloadCount
 The number of files currently being downloaded.
readonly attribute nsISupportsArray activeDownloads
 An enumeration of active downloads.
readonly attribute nsIRDFDataSource datasource

Detailed Description

Definition at line 55 of file nsIDownloadManager.idl.


Member Function Documentation

nsIDownload nsIDownloadManager::addDownload ( in nsIURI  aSource,
in nsIURI  aTarget,
in AString  aDisplayName,
in nsIMIMEInfo  aMIMEInfo,
in PRTime  startTime,
in nsILocalFile  aTempFile,
in nsICancelable  aCancelable 
)

Creates an nsIDownload and adds it to be managed by the download manager.

Parameters:
aSourceThe source URI of the transfer. Must not be null.
aTargetThe target URI of the transfer. Must not be null.
aDisplayNameThe user-readable description of the transfer. Can be empty.
aMIMEInfoThe MIME info associated with the target, including MIME type and helper app when appropriate. This parameter is optional.
startTimeTime when the download started (ie, when the first response from the server was received)
aTempFileThe 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.
aCancelableAn object that can be used to abort the download. Must not be null.
Returns:
The newly created download item with the passed-in properties.
nsIDownload nsIDownloadManager::addDownload ( in short  aDownloadType,
in nsIURI  aSource,
in nsIURI  aTarget,
in AString  aDisplayName,
in AString  aIconURL,
in nsIMIMEInfo  aMIMEInfo,
in PRTime  aStartTime,
in nsILocalFile  aTempFile,
in nsICancelable  aCancelable 
)

Creates an nsIDownload and adds it to be managed by the download manager.

Parameters:
aSourceThe source URI of the transfer. Must not be null.
aTargetThe target URI of the transfer. Must not be null.
aDisplayNameThe user-readable description of the transfer. Can be empty.
aMIMEInfoThe MIME info associated with the target, including MIME type and helper app when appropriate. This parameter is optional.
startTimeTime when the download started
aTempFileThe 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.
aCancelableAn object that can be used to abort the download. Must not be null.
Returns:
The newly created download item with the passed-in properties.
void nsIDownloadManager::cancelDownload ( in AUTF8String  aTargetPath)

Cancels the download with the specified target path if it's currently in progress.

If a "persist" was specified for the download, nsIWebBrowserPersist::CancelSave will be called. If an observer was set on the nsIDownload, it will be notified with the "oncancel" topic. Clients that don't provide a "persist" must listen for this topic and cancel the download.

Parameters:
aTargetPathThe target path of the download to be cancelled.
void nsIDownloadManager::cancelDownload ( in wstring  aPersistentDescriptor)

Cancels the download with the specified persistent descriptor if it's currently in progress.

This calls cancel(NS_BINDING_ABORTED) on the nsICancelable provided for the download.

Parameters:
aPersistentDescriptorThe persistent descriptor of the download to be cancelled.

Removes completed, failed, and canceled downloads from the list.

Indicate that a batch update is ending.

Indicate that a batch update is ending.

Flush the download datasource to disk.

nsIDownload nsIDownloadManager::getDownload ( in AUTF8String  aTargetPath)

Retrieves an in-progress download managed by the download manager.

Parameters:
aTargetPathA UTF8-encoded path to the target file.
Returns:
The download with the specified path.
nsIDownload nsIDownloadManager::getDownload ( in wstring  aPersistentDescriptor)

Retrieves an in-progress download managed by the download manager.

Parameters:
aPersistentDescriptorThe unique identifier used to describe a a download, and an attribute of nsILocalFile. On Windows and Linux, this is just the path of the target, but on Mac this is guaranteed to be unique.
Returns:
The download with the specified persistent descriptor.

Called when the download manager front end is closed.

Useful for third party managers to let us know when they've closed.

void nsIDownloadManager::open ( in nsIDOMWindow  aParent,
in wstring  aPersistentDescriptor 
)

Opens the Download Manager front end.

Parameters:
aParentThe parent, or opener, of the front end (optional).
aDownloadA download to pass to the manager widnow. Useful if, for example, you want the window to select a certain download (optional).

Opens the Download Manager front end.

Parameters:
aParentThe parent, or opener, of the front end (optional).
aDownloadA download to pass to the manager window. Useful if, for example, you want the window to select a certain download (optional).
void nsIDownloadManager::openProgressDialogFor ( in nsIDownload  aDownload,
in nsIDOMWindow  aParent,
in boolean  aCancelDownloadOnClose 
)

Opens an individual progress dialog displaying progress for the download.

Parameters:
aDownloadThe download object to display progress for, as returned by getDownload or addDownload.
aParentThe parent, or opener, of the front end (optional).
aCancelDownloadOnCloseWhether closing the dialog should cancel the download.

Pause a download to allow later resumal.

This may or may not close the network connection. In either case, new data won't be received.

Parameters:
aDownloadDownload to pause, as returned by getDownload or addDownload.

Trying to pause a download that is already paused will throw NS_ERROR_NOT_AVAILABLE. NS_ERROR_UNEXPECTED may be thrown to indicate an internal error. Any exception defined by nsIRequest::Suspend may be thrown. No other exceptions will be thrown.

void nsIDownloadManager::pauseDownload ( in wstring  aPersistentDescriptor)

Pause the specified download.

void nsIDownloadManager::removeDownload ( in wstring  aPersistentDescriptor)

Removes the download with the specified persistent descriptor if it's not currently in progress.

Whereas cancelDownload simply cancels the transfer but retains information about it, removeDownload removes all knowledge of it.

Parameters:
aPersistentDescriptorThe persistent descriptor of the download to be removed.
void nsIDownloadManager::removeDownload ( in AUTF8String  aTargetPath)

Removes the download with the specified target path if it's not currently in progress.

Whereas cancelDownload simply cancels the transfer but retains information about it, removeDownload removes all knowledge of it.

Parameters:
aTargetPathThe target path of the download to be removed.
void nsIDownloadManager::resumeDownload ( in AUTF8String  aTargetPath)

Resume a previously paused download.

Parameters:
aTargetPathTarget path of the download to be resumed.
Exceptions:
NS_ERROR_NOT_RESUMABLEIf resuming is not supported for this entity, or if the entity has changed since the download was paused
NS_ERROR_NOT_AVAILABLEIf no such download exists, or if the download was not paused, or if the download is finished already. In addition, this may throw NS_ERROR_OUT_OF_MEMORY, or any error defined by nsIResumableChannel::setEntityID, nsIResumableChannel::asyncOpenAt, nsIRequest::Resume, or nsIIOService::newChannel. Also, NS_ERROR_UNEXPECTED may be thrown to indicate an internal error.
void nsIDownloadManager::resumeDownload ( in wstring  aPersistentDescriptor)

Resume the specified download.

Update the download datasource.

Indicate that a batch update (e.g.

mass removal) is about to start.

Indicate that a batch update (e.g.

mass removal) is about to start.


Member Data Documentation

The number of files currently being downloaded.

Definition at line 194 of file nsIDownloadManager.idl.

An enumeration of active downloads.

Definition at line 199 of file nsIDownloadManager.idl.

Whether or not there are downloads that can be cleaned up (removed) i.e.

downloads that have completed, have failed or have been canceled.

Definition at line 184 of file nsIDownloadManager.idl.

Definition at line 211 of file nsIDownloadManager.idl.

Definition at line 61 of file nsIDownloadManager.idl.

Definition at line 58 of file nsIDownloadManager.idl.

Definition at line 60 of file nsIDownloadManager.idl.

Definition at line 59 of file nsIDownloadManager.idl.

Definition at line 57 of file nsIDownloadManager.idl.

Definition at line 62 of file nsIDownloadManager.idl.

Definition at line 64 of file nsIDownloadManager.idl.

The Download Manager's progress listener.

Definition at line 164 of file nsIDownloadManager.idl.


The documentation for this interface was generated from the following files: