WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

@mozilla.org/download-manager;1

This component implements the following interfaces:

Constants

PRInt16 nsIDownloadManager.DOWNLOAD_NOTSTARTED = -1
PRInt16 nsIDownloadManager.DOWNLOAD_DOWNLOADING = 0
PRInt16 nsIDownloadManager.DOWNLOAD_FINISHED = 1
PRInt16 nsIDownloadManager.DOWNLOAD_FAILED = 2
PRInt16 nsIDownloadManager.DOWNLOAD_CANCELED = 3
PRInt16 nsIDownloadManager.DOWNLOAD_PAUSED = 4
PRInt16 nsIDownloadManager.DOWNLOAD_QUEUED = 5
PRInt16 nsIDownloadManager.DOWNLOAD_BLOCKED = 6
PRInt16 nsIDownloadManager.DOWNLOAD_SCANNING = 7
PRInt16 nsIDownloadManager.DOWNLOAD_DIRTY = 8
PRInt16 nsIDownloadManager.DOWNLOAD_TYPE_DOWNLOAD = 0

Properties

readonly PRInt32 nsIDownloadManager.activeDownloadCount

The number of files currently being downloaded.

readonly nsISimpleEnumerator nsIDownloadManager.activeDownloads

An enumeration of active nsIDownloads

readonly PRBool nsIDownloadManager.canCleanUp

Whether or not there are downloads that can be cleaned up (removed) i.e. downloads that have completed, have failed or have been canceled.

readonly mozIStorageConnection nsIDownloadManager.DBConnection

The database connection to the downloads database.

readonly nsILocalFile nsIDownloadManager.defaultDownloadsDirectory

Returns the platform default downloads directory.

readonly nsILocalFile nsIDownloadManager.userDownloadsDirectory

Returns the user configured downloads directory. The path is dependent on two user configurable prefs set in preferences:

Browser.download.folderList Indicates the location users wish to save downloaded files too. Values: 0 - The desktop is the default download location. 1 - The system's downloads folder is the default download location. 2 - The default download location is elsewhere as specified in browser.download.dir. If invalid, userDownloadsDirectory will fallback on defaultDownloadsDirectory.

Browser.download.dir - A local path the user may have selected at some point where downloaded files are saved. The use of which is enabled when folderList equals 2.

Methods

InterfaceMethod
nsIDownloadManager nsIDownload addDownload ( PRInt16 downloadType , nsIURI source , nsIURI target , AString displayName , nsIMIMEInfo MIMEInfo , PRTime startTime , nsILocalFile tempFile , nsICancelable cancelable )
nsIDownloadManager void addListener ( nsIDownloadProgressListener listener )
nsIDownloadManager void cancelDownload ( PRUint32 ID )
nsIDownloadManager void cleanUp ( )
nsIDownloadManager nsIDownload getDownload ( PRUint32 ID )
nsIDOMEventListener void handleEvent ( nsIDOMEvent event )
nsIObserver void observe ( nsISupports subject , char* topic , PRUnichar* data )
nsIDownloadManager void pauseDownload ( PRUint32 ID )
nsIDownloadManager void removeDownload ( PRUint32 ID )
nsIDownloadManager void removeListener ( nsIDownloadProgressListener listener )
nsIDownloadManager void resumeDownload ( PRUint32 ID )
nsIDownloadManager void retryDownload ( PRUint32 ID )

Reference documentation is generated from Mozilla's source.

Copyright © 1999-2006 XULPlanet.com