Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Attributes | Friends
nsDownloadManager Class Reference

#include <nsDownloadManager.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIDOWNLOADMANAGER
NS_DECL_NSIXPINSTALLMANAGERUI
NS_DECL_NSIOBSERVER nsresult 
Init ()
 nsDownloadManager ()
virtual ~nsDownloadManager ()
nsresult DownloadEnded (const PRUnichar *aPersistentDescriptor, const PRUnichar *aMessage)
nsresult AssertProgressInfoFor (const PRUnichar *aPersistentDescriptor)
NS_DECL_ISUPPORTS
NS_DECL_NSIDOWNLOADMANAGER
NS_DECL_NSIDOMEVENTLISTENER
NS_DECL_NSIOBSERVER nsresult 
Init ()
 nsDownloadManager ()
 ~nsDownloadManager ()
void observe (in nsISupports aSubject, in string aTopic, in wstring aData)
 Observe will be called when there is a notification for the topic |aTopic|.
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 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 wstring aPersistentDescriptor)
 Retrieves an in-progress download managed by the download manager.
nsIDownload getDownload (in AUTF8String aTargetPath)
 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 cancelDownload (in AUTF8String aTargetPath)
 Cancels the download with the specified target path 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 removeDownload (in AUTF8String aTargetPath)
 Removes the download with the specified target path if it's not currently in progress.
void pauseDownload (in wstring aPersistentDescriptor)
 Pause the specified download.
void pauseDownload (in nsIDownload aDownload)
 Pause a download to allow later resumal.
void resumeDownload (in wstring aPersistentDescriptor)
 Resume the specified download.
void resumeDownload (in AUTF8String aTargetPath)
 Resume a previously paused download.
void open (in nsIDOMWindow aParent, in wstring aPersistentDescriptor)
 Opens the Download Manager front end.
void open (in nsIDOMWindow aParent, in nsIDownload aDownload)
 Opens the Download Manager front end.
void startBatchUpdate ()
 Indicate that a batch update (e.g.
void startBatchUpdate ()
 Indicate that a batch update (e.g.
void endBatchUpdate ()
 Indicate that a batch update is ending.
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.
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.

Static Public Member Functions

static PRInt32 PR_CALLBACK CancelAllDownloads (nsHashKey *aKey, void *aData, void *aClosure)
static PRInt32 PR_CALLBACK BuildActiveDownloadsList (nsHashKey *aKey, void *aData, void *aClosure)

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
const short INSTALL_DOWNLOADING = 5
const short INSTALL_INSTALLING = 6
const short INSTALL_FINISHED = 7
const short DOWNLOAD_TYPE_INSTALL = 1
readonly attribute
nsIXPIProgressDialog 
xpiProgress
readonly attribute boolean hasActiveXPIOperations

Protected Member Functions

nsresult GetDownloadsContainer (nsIRDFContainer **aResult)
nsresult GetProfileDownloadsFileURL (nsCString &aDownloadsFileURL)
nsresult GetDataSource (nsIRDFDataSource **aDataSource)
nsresult DownloadStarted (const PRUnichar *aPersistentDescriptor)
nsresult GetInternalListener (nsIDownloadProgressListener **aListener)
nsresult PauseResumeDownload (const PRUnichar *aPath, PRBool aPause)
nsresult RemoveDownload (nsIRDFResource *aDownload)
nsresult ValidateDownloadsContainer ()
void ConfirmCancelDownloads (PRInt32 aCount, nsISupportsPRBool *aCancelDownloads, const PRUnichar *aTitle, const PRUnichar *aCancelMessageMultiple, const PRUnichar *aCancelMessageSingle, const PRUnichar *aDontCancelButton)
PRBool NeedsUIUpdate ()
PRInt32 GetRetentionBehavior ()
nsresult GetDownloadsContainer (nsIRDFContainer **aResult)
nsresult GetProfileDownloadsFileURL (nsCString &aDownloadsFileURL)
nsresult GetInternalListener (nsIDownloadProgressListener **aInternalListener)
nsresult GetDataSource (nsIRDFDataSource **aDataSource)
nsresult AssertProgressInfo ()
nsresult AssertProgressInfoFor (const nsACString &aTargetPath)
nsresult DownloadStarted (const nsACString &aTargetPath)
nsresult DownloadEnded (const nsACString &aTargetPath, const PRUnichar *aMessage)
PRBool MustUpdateUI ()

Static Protected Member Functions

static void OpenTimerCallback (nsITimer *aTimer, void *aClosure)
static nsresult OpenDownloadManager (PRBool aShouldFocus, PRInt32 aFlashCount, nsIDownload *aDownload, nsIDOMWindow *aParent)
static PRBool IsInFinalStage (DownloadState aState)
static PRBool IsInProgress (DownloadState aState)
static PRBool CompletedSuccessfully (DownloadState aState)

Protected Attributes

nsCOMPtr< nsISoundmSoundInterface

Private Attributes

nsCOMPtr
< nsIDownloadProgressListener
mListener
nsCOMPtr< nsIRDFDataSourcemDataSource
nsCOMPtr< nsIXPIProgressDialogmXPIProgress
nsCOMPtr< nsIRDFContainermDownloadsContainer
nsCOMPtr< nsIRDFContainerUtilsmRDFContainerUtils
nsCOMPtr< nsIStringBundlemBundle
nsCOMPtr< nsITimermDMOpenTimer
PRInt32 mBatches
nsHashtable mCurrDownloads
nsCOMPtr< nsIDOMDocumentmDocument
nsRefPtrHashtable
< nsCStringHashKey, nsDownload
mCurrDownloads

Friends

class nsDownload

Detailed Description

Definition at line 76 of file nsDownloadManager.h.


Constructor & Destructor Documentation

Definition at line 121 of file nsDownloadManager.cpp.

                                     : mBatches(0)
{
}

Definition at line 154 of file nsDownloadManager.cpp.

{
  if (--gRefCnt != 0 || !gRDFService  || !gObserverService)
    // Either somebody tried to use |CreateInstance| instead of
    // |GetService| or |Init| failed very early, so there's nothing to
    // do here.
    return;

  gRDFService->UnregisterDataSource(mDataSource);

  gObserverService->RemoveObserver(this, "quit-application");
  gObserverService->RemoveObserver(this, "quit-application-requested");
  gObserverService->RemoveObserver(this, "offline-requested");

  NS_IF_RELEASE(gNC_DownloadsRoot);                                             
  NS_IF_RELEASE(gNC_File);                                                      
  NS_IF_RELEASE(gNC_URL);
  NS_IF_RELEASE(gNC_IconURL);
  NS_IF_RELEASE(gNC_Name);                                                      
  NS_IF_RELEASE(gNC_ProgressPercent);
  NS_IF_RELEASE(gNC_Transferred);
  NS_IF_RELEASE(gNC_DownloadState);
  NS_IF_RELEASE(gNC_StatusText);
  NS_IF_RELEASE(gNC_DateStarted);
  NS_IF_RELEASE(gNC_DateEnded);

  NS_RELEASE(gRDFService);
  NS_RELEASE(gObserverService);
}

Here is the call graph for this function:


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

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

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.

Definition at line 287 of file nsDownloadManager.cpp.

{
  nsCOMPtr<nsISupports> supports;
  nsCOMPtr<nsIRDFResource> res;
  nsCOMPtr<nsIRDFInt> intLiteral;

  gRDFService->GetIntLiteral(DOWNLOADING, getter_AddRefs(intLiteral));
  nsCOMPtr<nsISimpleEnumerator> downloads;
  nsresult rv = mDataSource->GetSources(gNC_DownloadState, intLiteral, PR_TRUE, getter_AddRefs(downloads));
  if (NS_FAILED(rv)) return rv;
  
  PRBool hasMoreElements;
  downloads->HasMoreElements(&hasMoreElements);

  while (hasMoreElements) {
    const char* uri;
    downloads->GetNext(getter_AddRefs(supports));
    res = do_QueryInterface(supports);
    res->GetValueConst(&uri);
    AssertProgressInfoFor(nsDependentCString(uri));
    downloads->HasMoreElements(&hasMoreElements);
  }
  return rv;
}

Here is the call graph for this function:

nsresult nsDownloadManager::AssertProgressInfoFor ( const nsACString &  aTargetPath) [protected]

Definition at line 313 of file nsDownloadManager.cpp.

{
  nsDownload* internalDownload = mCurrDownloads.GetWeak(aTargetPath);
  if (!internalDownload)
    return NS_ERROR_FAILURE;
  
  nsresult rv;
  PRInt32 percentComplete;
  nsCOMPtr<nsIRDFNode> oldTarget;
  nsCOMPtr<nsIRDFInt> intLiteral;
  nsCOMPtr<nsIRDFResource> res;
  nsCOMPtr<nsIRDFLiteral> literal;

  gRDFService->GetResource(aTargetPath, getter_AddRefs(res));

  DownloadState state = internalDownload->GetDownloadState();
 
  // update progress mode
  nsAutoString progressMode;
  if (state == DOWNLOADING)
    progressMode.AssignLiteral("normal");
  else
    progressMode.AssignLiteral("none");

  gRDFService->GetLiteral(progressMode.get(), getter_AddRefs(literal));

  rv = mDataSource->GetTarget(res, gNC_ProgressMode, PR_TRUE, getter_AddRefs(oldTarget));
  
  if (oldTarget)
    rv = mDataSource->Change(res, gNC_ProgressMode, oldTarget, literal);
  else
    rv = mDataSource->Assert(res, gNC_ProgressMode, literal, PR_TRUE);
  if (NS_FAILED(rv)) return rv;

  // update download state (not started, downloading, queued, finished, etc...)
  gRDFService->GetIntLiteral(state, getter_AddRefs(intLiteral));

  mDataSource->GetTarget(res, gNC_DownloadState, PR_TRUE, getter_AddRefs(oldTarget));
  
  if (oldTarget) {
    rv = mDataSource->Change(res, gNC_DownloadState, oldTarget, intLiteral);
    if (NS_FAILED(rv)) return rv;
  }

  nsAutoString strKey;
  if (state == NOTSTARTED)
    strKey.AssignLiteral("notStarted");
  else if (state == DOWNLOADING)
    strKey.AssignLiteral("downloading");
  else if (state == FINISHED)
    strKey.AssignLiteral("finished");
  else if (state == FAILED)
    strKey.AssignLiteral("failed");
  else if (state == CANCELED)
    strKey.AssignLiteral("canceled");

  nsXPIDLString value;
  rv = mBundle->GetStringFromName(strKey.get(), getter_Copies(value));    
  if (NS_FAILED(rv)) return rv;

  gRDFService->GetLiteral(value, getter_AddRefs(literal));

  rv = mDataSource->GetTarget(res, gNC_StatusText, PR_TRUE, getter_AddRefs(oldTarget));
  
  if (oldTarget) {
    rv = mDataSource->Change(res, gNC_StatusText, oldTarget, literal);
    if (NS_FAILED(rv)) return rv;
  }
  else {
    rv = mDataSource->Assert(res, gNC_StatusText, literal, PR_TRUE);
    if (NS_FAILED(rv)) return rv;
  }
  
  // update percentage
  internalDownload->GetPercentComplete(&percentComplete);

  mDataSource->GetTarget(res, gNC_ProgressPercent, PR_TRUE, getter_AddRefs(oldTarget));
  gRDFService->GetIntLiteral(percentComplete, getter_AddRefs(intLiteral));

  if (oldTarget)
    rv = mDataSource->Change(res, gNC_ProgressPercent, oldTarget, intLiteral);
  else
    rv = mDataSource->Assert(res, gNC_ProgressPercent, intLiteral, PR_TRUE);
  if (NS_FAILED(rv)) return rv;

  // update transferred
  nsDownload::TransferInformation transferInfo =
                                 internalDownload->GetTransferInformation();

  // convert from bytes to kbytes for progress display
  PRInt64 current = (PRFloat64)transferInfo.mCurrBytes / 1024 + .5;
  PRInt64 max = (PRFloat64)transferInfo.mMaxBytes / 1024 + .5;

  nsAutoString currBytes; currBytes.AppendInt(current);
  nsAutoString maxBytes; maxBytes.AppendInt(max);
  const PRUnichar *strings[] = {
    currBytes.get(),
    maxBytes.get()
  };
  
  rv = mBundle->FormatStringFromName(NS_LITERAL_STRING("transferred").get(),
                                     strings, 2, getter_Copies(value));
  if (NS_FAILED(rv)) return rv;

  gRDFService->GetLiteral(value, getter_AddRefs(literal));
 
  mDataSource->GetTarget(res, gNC_Transferred, PR_TRUE, getter_AddRefs(oldTarget));
 
  if (oldTarget)
    rv = mDataSource->Change(res, gNC_Transferred, oldTarget, literal);
  else
    rv = mDataSource->Assert(res, gNC_Transferred, literal, PR_TRUE);
  if (NS_FAILED(rv)) return rv;

  nsCOMPtr<nsIRDFRemoteDataSource> remote = do_QueryInterface(mDataSource);
  remote->Flush();

  // XXX should also store and update time elapsed
  return rv;
}  

Here is the call graph for this function:

Definition at line 440 of file nsDownloadManager.cpp.

{
  nsStringKey key(aPath);
  if (!mCurrDownloads.Exists(&key))
    return NS_ERROR_FAILURE;
 
  nsDownload* internalDownload = NS_STATIC_CAST(nsDownload*, mCurrDownloads.Get(&key));
  if (!internalDownload)
    return NS_ERROR_FAILURE;
  
  nsresult rv;
  PRInt32 percentComplete;
  nsCOMPtr<nsIRDFNode> oldTarget;
  nsCOMPtr<nsIRDFInt> intLiteral;
  nsCOMPtr<nsIRDFResource> res;
  nsCOMPtr<nsIRDFLiteral> literal;

  gRDFService->GetUnicodeResource(nsDependentString(aPath), getter_AddRefs(res));

  DownloadState state = internalDownload->GetDownloadState();
 
  // update download state (not started, downloading, queued, finished, etc...)
  gRDFService->GetIntLiteral(state, getter_AddRefs(intLiteral));

  mDataSource->GetTarget(res, gNC_DownloadState, PR_TRUE, getter_AddRefs(oldTarget));
  
  if (oldTarget)
    rv = mDataSource->Change(res, gNC_DownloadState, oldTarget, intLiteral);
  else
    rv = mDataSource->Assert(res, gNC_DownloadState, intLiteral, PR_TRUE);
  if (NS_FAILED(rv)) return rv;

  // update percentage
  internalDownload->GetPercentComplete(&percentComplete);

  mDataSource->GetTarget(res, gNC_ProgressPercent, PR_TRUE, getter_AddRefs(oldTarget));
  gRDFService->GetIntLiteral(percentComplete, getter_AddRefs(intLiteral));

  if (oldTarget)
    rv = mDataSource->Change(res, gNC_ProgressPercent, oldTarget, intLiteral);
  else
    rv = mDataSource->Assert(res, gNC_ProgressPercent, intLiteral, PR_TRUE);
  if (NS_FAILED(rv)) return rv;

  // update transferred
  nsDownload::TransferInformation transferInfo =
                                 internalDownload->GetTransferInformation();

  // convert from bytes to kbytes for progress display
  PRInt64 current = BYTES_TO_KBYTES(transferInfo.mCurrBytes);
  PRInt64 max = BYTES_TO_KBYTES(transferInfo.mMaxBytes);
 
  nsAutoString currBytes; currBytes.AppendInt(current);
  nsAutoString maxBytes; maxBytes.AppendInt(max);
  const PRUnichar *strings[] = {
    currBytes.get(),
    maxBytes.get()
  };

  nsXPIDLString value; 
  rv = mBundle->FormatStringFromName(NS_LITERAL_STRING("transferred").get(),
                                     strings, 2, getter_Copies(value));
  if (NS_FAILED(rv)) return rv;

  gRDFService->GetLiteral(value, getter_AddRefs(literal));
 
  mDataSource->GetTarget(res, gNC_Transferred, PR_TRUE, getter_AddRefs(oldTarget));
 
  if (oldTarget)
    rv = mDataSource->Change(res, gNC_Transferred, oldTarget, literal);
  else
    rv = mDataSource->Assert(res, gNC_Transferred, literal, PR_TRUE);
  if (NS_FAILED(rv)) return rv;

  // XXX should also store and update time elapsed
  return Flush();
}  

Here is the call graph for this function:

Here is the caller graph for this function:

PRInt32 PR_CALLBACK nsDownloadManager::BuildActiveDownloadsList ( nsHashKey *  aKey,
void aData,
void aClosure 
) [static]

Definition at line 395 of file nsDownloadManager.cpp.

{
  nsCOMPtr<nsISupportsArray> ary(do_QueryInterface((nsISupports*)aClosure));
  nsCOMPtr<nsIDownload> dl(do_QueryInterface((nsISupports*)aData));  

  ary->AppendElement(dl);
 
  return kHashEnumerateNext;
}

Here is the call graph for this function:

PRInt32 PR_CALLBACK nsDownloadManager::CancelAllDownloads ( nsHashKey *  aKey,
void aData,
void aClosure 
) [static]

Definition at line 184 of file nsDownloadManager.cpp.

{
  nsStringKey* key = (nsStringKey*)aKey;
  nsresult rv;

  nsCOMPtr<nsIDownloadManager> manager = do_QueryInterface((nsISupports*)aClosure, &rv);
  if (NS_FAILED(rv)) return kHashEnumerateRemove;  
  
  if (IsInProgress(NS_STATIC_CAST(nsDownload*, aData)->GetDownloadState()))  
    manager->CancelDownload(key->GetString());
  else
    NS_STATIC_CAST(nsDownloadManager*, aClosure)->DownloadEnded(key->GetString(), nsnull);
 
  return kHashEnumerateRemove;
}

Here is the call graph for this function:

void nsIDownloadManager::cancelDownload ( in AUTF8String  aTargetPath) [inherited]

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

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.

static PRBool nsDownloadManager::CompletedSuccessfully ( DownloadState  aState) [inline, static, protected]

Definition at line 137 of file nsDownloadManager.h.

void nsDownloadManager::ConfirmCancelDownloads ( PRInt32  aCount,
nsISupportsPRBool aCancelDownloads,
const PRUnichar aTitle,
const PRUnichar aCancelMessageMultiple,
const PRUnichar aCancelMessageSingle,
const PRUnichar aDontCancelButton 
) [protected]

Definition at line 1375 of file nsDownloadManager.cpp.

{
  nsXPIDLString title, message, quitButton, dontQuitButton;
  
  nsCOMPtr<nsIStringBundleService> bundleService = do_GetService(kStringBundleServiceCID);
  nsCOMPtr<nsIStringBundle> bundle;
  if (bundleService)
    bundleService->CreateBundle(DOWNLOAD_MANAGER_BUNDLE, getter_AddRefs(bundle));
  if (bundle) {
    bundle->GetStringFromName(aTitle, getter_Copies(title));    

    nsAutoString countString;
    countString.AppendInt(aCount);
    const PRUnichar* strings[1] = { countString.get() };
    if (aCount > 1) {
      bundle->FormatStringFromName(aCancelMessageMultiple, strings, 1, getter_Copies(message));
      bundle->FormatStringFromName(NS_LITERAL_STRING("cancelDownloadsOKTextMultiple").get(), strings, 1, getter_Copies(quitButton));
    }
    else {
      bundle->GetStringFromName(aCancelMessageSingle, getter_Copies(message));
      bundle->GetStringFromName(NS_LITERAL_STRING("cancelDownloadsOKText").get(), getter_Copies(quitButton));
    }

    bundle->GetStringFromName(aDontCancelButton, getter_Copies(dontQuitButton));
  }

  // Get Download Manager window, to be parent of alert.
  nsCOMPtr<nsIWindowMediator> wm = do_GetService(NS_WINDOWMEDIATOR_CONTRACTID);
  nsCOMPtr<nsIDOMWindowInternal> dmWindow;
  if (wm)
    wm->GetMostRecentWindow(NS_LITERAL_STRING("Download:Manager").get(), getter_AddRefs(dmWindow));

  // Show alert.
  nsCOMPtr<nsIPromptService> prompter(do_GetService(NS_PROMPTSERVICE_CONTRACTID));
  if (prompter) {
    PRInt32 flags = (nsIPromptService::BUTTON_TITLE_IS_STRING * nsIPromptService::BUTTON_POS_0) + (nsIPromptService::BUTTON_TITLE_IS_STRING * nsIPromptService::BUTTON_POS_1);
    PRBool nothing = PR_FALSE;
    PRInt32 button;
    prompter->ConfirmEx(dmWindow, title, message, flags, quitButton.get(), dontQuitButton.get(), nsnull, nsnull, &nothing, &button);

    aCancelDownloads->SetData(button == 1);
  }
}

Here is the call graph for this function:

nsresult nsDownloadManager::DownloadEnded ( const nsACString &  aTargetPath,
const PRUnichar aMessage 
) [protected]

Definition at line 218 of file nsDownloadManager.cpp.

{
  nsDownload* dl = mCurrDownloads.GetWeak(aTargetPath);
  if (dl) {
    AssertProgressInfoFor(aTargetPath);
    mCurrDownloads.Remove(aTargetPath);
  }

  return NS_OK;
}

Here is the call graph for this function:

nsresult nsDownloadManager::DownloadEnded ( const PRUnichar aPersistentDescriptor,
const PRUnichar aMessage 
)

Definition at line 304 of file nsDownloadManager.cpp.

{
  nsStringKey key(aPath);
  if (mCurrDownloads.Exists(&key)) {

    // Assert the date and time that the download ended.    
    nsCOMPtr<nsIRDFDate> dateLiteral;
    if (NS_SUCCEEDED(gRDFService->GetDateLiteral(PR_Now(), getter_AddRefs(dateLiteral)))) {    
      nsCOMPtr<nsIRDFResource> res;
      nsCOMPtr<nsIRDFNode> node;
      
      gRDFService->GetUnicodeResource(nsDependentString(aPath), getter_AddRefs(res));
      
      mDataSource->GetTarget(res, gNC_DateEnded, PR_TRUE, getter_AddRefs(node));
      if (node)
        mDataSource->Change(res, gNC_DateEnded, node, dateLiteral);
      else
        mDataSource->Assert(res, gNC_DateEnded, dateLiteral, PR_TRUE);
    }

    AssertProgressInfoFor(aPath);
    
    nsDownload* download = NS_STATIC_CAST(nsDownload*, mCurrDownloads.Get(&key));
    NS_RELEASE(download);

    if (!gStoppingDownloads)
      mCurrDownloads.Remove(&key);
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsDownloadManager::DownloadStarted ( const nsACString &  aTargetPath) [protected]

Definition at line 209 of file nsDownloadManager.cpp.

{
  if (mCurrDownloads.GetWeak(aTargetPath))
    AssertProgressInfoFor(aTargetPath);

  return NS_OK;
}

Here is the call graph for this function:

nsresult nsDownloadManager::DownloadStarted ( const PRUnichar aPersistentDescriptor) [protected]

Definition at line 277 of file nsDownloadManager.cpp.

{
  nsStringKey key(aPath);
  if (mCurrDownloads.Exists(&key)) {
  
    // Assert the date and time that the download ended.    
    nsCOMPtr<nsIRDFDate> dateLiteral;
    if (NS_SUCCEEDED(gRDFService->GetDateLiteral(PR_Now(), getter_AddRefs(dateLiteral)))) {    
      nsCOMPtr<nsIRDFResource> res;
      nsCOMPtr<nsIRDFNode> node;
      
      gRDFService->GetUnicodeResource(nsDependentString(aPath), getter_AddRefs(res));
      
      mDataSource->GetTarget(res, gNC_DateStarted, PR_TRUE, getter_AddRefs(node));
      if (node)
        mDataSource->Change(res, gNC_DateStarted, node, dateLiteral);
      else
        mDataSource->Assert(res, gNC_DateStarted, dateLiteral, PR_TRUE);
    }
  
    AssertProgressInfoFor(aPath);
  }

  return NS_OK;
}

Here is the call graph for this function:

Indicate that a batch update is ending.

Indicate that a batch update is ending.

Flush the download datasource to disk.

Definition at line 279 of file nsDownloadManager.cpp.

{
  *aDataSource = mDataSource;
  NS_ADDREF(*aDataSource);
  return NS_OK;
}

Here is the call graph for this function:

nsIDownload nsIDownloadManager::getDownload ( in AUTF8String  aTargetPath) [inherited]

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

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.

Definition at line 337 of file nsDownloadManager.cpp.

{
  if (mDownloadsContainer) {
    *aResult = mDownloadsContainer;
    NS_ADDREF(*aResult);
    return NS_OK;
  }

  PRBool isContainer;
  nsresult rv = mRDFContainerUtils->IsContainer(mDataSource, gNC_DownloadsRoot, &isContainer);
  if (NS_FAILED(rv)) return rv;

  if (!isContainer) {
    rv = mRDFContainerUtils->MakeSeq(mDataSource, gNC_DownloadsRoot, getter_AddRefs(mDownloadsContainer));
    if (NS_FAILED(rv)) return rv;
  }
  else {
    mDownloadsContainer = do_CreateInstance(NS_RDF_CONTRACTID "/container;1", &rv);
    if (NS_FAILED(rv)) return rv;
    rv = mDownloadsContainer->Init(mDataSource, gNC_DownloadsRoot);
    if (NS_FAILED(rv)) return rv;
  }

  *aResult = mDownloadsContainer;
  NS_IF_ADDREF(*aResult);

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 367 of file nsDownloadManager.cpp.

{
  *aListener = mListener;
  NS_IF_ADDREF(*aListener);
  return NS_OK;
}

Definition at line 230 of file nsDownloadManager.cpp.

{
  nsCOMPtr<nsIFile> downloadsFile;
  nsresult rv = NS_GetSpecialDirectory(NS_APP_DOWNLOADS_50_FILE, getter_AddRefs(downloadsFile));
  if (NS_FAILED(rv))
    return rv;
    
  return NS_GetURLSpecFromFile(downloadsFile, aDownloadsFileURL);
}

Here is the call graph for this function:

Definition at line 263 of file nsDownloadManager.cpp.

{
  PRInt32 val = 0;
  nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
  if (pref) {
    nsresult rv = pref->GetIntPref(PREF_BDM_RETENTION, &val);
    if (NS_FAILED(rv))
      val = 0; // Use 0 as the default ("remove when done")
  }

  return val;
}

Here is the call graph for this function:

NS_DECL_ISUPPORTS NS_DECL_NSIDOWNLOADMANAGER NS_DECL_NSIDOMEVENTLISTENER NS_DECL_NSIOBSERVER nsresult nsDownloadManager::Init ( )

Definition at line 201 of file nsDownloadManager.cpp.

{
  if (gRefCnt++ != 0) {
    NS_NOTREACHED("download manager should be used as a service");
    return NS_ERROR_UNEXPECTED; // This will make the |CreateInstance| fail.
  }

  nsresult rv;
  mRDFContainerUtils = do_GetService("@mozilla.org/rdf/container-utils;1", &rv);
  if (NS_FAILED(rv)) return rv;

  rv = CallGetService("@mozilla.org/observer-service;1", &gObserverService);
  if (NS_FAILED(rv)) return rv;
  
  rv = CallGetService(kRDFServiceCID, &gRDFService);
  if (NS_FAILED(rv)) return rv;                                                 

  gRDFService->GetResource(NS_LITERAL_CSTRING("NC:DownloadsRoot"), &gNC_DownloadsRoot);
  gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "File"), &gNC_File);
  gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "URL"), &gNC_URL);
  gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "IconURL"), &gNC_IconURL);
  gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Name"), &gNC_Name);
  gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "ProgressPercent"), &gNC_ProgressPercent);
  gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Transferred"), &gNC_Transferred);
  gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "DownloadState"), &gNC_DownloadState);
  gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "StatusText"), &gNC_StatusText);
  gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "DateStarted"), &gNC_DateStarted);
  gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "DateEnded"), &gNC_DateEnded);

  mDataSource = new nsDownloadsDataSource();
  if (!mDataSource)
    return NS_ERROR_OUT_OF_MEMORY;

  rv = NS_STATIC_CAST(nsDownloadsDataSource*, (nsIRDFDataSource*)mDataSource.get())->LoadDataSource();
  if (NS_FAILED(rv)) {
    mDataSource = nsnull; // so we don't UnregisterDataSource on it
    return rv;
  }

  nsCOMPtr<nsIStringBundleService> bundleService = do_GetService(kStringBundleServiceCID, &rv);
  if (NS_FAILED(rv)) return rv;
  
  rv = bundleService->CreateBundle(DOWNLOAD_MANAGER_BUNDLE, getter_AddRefs(mBundle));
  if (NS_FAILED(rv))
    return rv;

  // The following three AddObserver calls must be the last lines in this function,
  // because otherwise, this function may fail (and thus, this object would be not
  // completely initialized), but the observerservice would still keep a reference
  // to us and notify us about shutdown, which may cause crashes.
  // failure to add an observer is not critical
  // Note also that we're assuming that the service manager will hold on
  // to this object until after the "quit-application" notification so
  // that we actually get notified.
  gObserverService->AddObserver(this, "quit-application", PR_TRUE);
  gObserverService->AddObserver(this, "quit-application-requested", PR_TRUE);
  gObserverService->AddObserver(this, "offline-requested", PR_TRUE);

  return NS_OK;
}

Here is the call graph for this function:

static PRBool nsDownloadManager::IsInFinalStage ( DownloadState  aState) [inline, static, protected]
static PRBool nsDownloadManager::IsInProgress ( DownloadState  aState) [inline, static, protected]

Definition at line 128 of file nsDownloadManager.h.

Here is the caller graph for this function:

PRBool nsDownloadManager::MustUpdateUI ( ) [inline, protected]

Definition at line 92 of file nsDownloadManager.h.

{ if (mDocument) return PR_TRUE; return PR_FALSE; }
PRBool nsDownloadManager::NeedsUIUpdate ( ) [inline, protected]

Definition at line 118 of file nsDownloadManager.h.

{ return mListener != nsnull; }
void nsIObserver::observe ( in nsISupports  aSubject,
in string  aTopic,
in wstring  aData 
) [inherited]

Observe will be called when there is a notification for the topic |aTopic|.

This assumes that the object implementing this interface has been registered with an observer service such as the nsIObserverService.

If you expect multiple topics/subjects, the impl is responsible for filtering.

You should not modify, add, remove, or enumerate notifications in the implemention of observe.

Parameters:
aSubject: Notification specific interface pointer.
aTopic: The notification topic or subject.
aData: Notification specific wide string. subject event.

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

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).
void nsIDownloadManager::open ( in nsIDOMWindow  aParent,
in nsIDownload  aDownload 
) [inherited]

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).
nsresult nsDownloadManager::OpenDownloadManager ( PRBool  aShouldFocus,
PRInt32  aFlashCount,
nsIDownload aDownload,
nsIDOMWindow aParent 
) [static, protected]

Definition at line 1192 of file nsDownloadManager.cpp.

{
  nsresult rv = NS_OK;

  nsCOMPtr<nsIWindowMediator> wm = do_GetService(NS_WINDOWMEDIATOR_CONTRACTID, &rv);
  if (NS_FAILED(rv)) return rv;

  nsCOMPtr<nsIDOMWindowInternal> recentWindow;
  wm->GetMostRecentWindow(NS_LITERAL_STRING("Download:Manager").get(), getter_AddRefs(recentWindow));
  if (recentWindow) {
    nsCOMPtr<nsIObserverService> obsService = do_GetService("@mozilla.org/observer-service;1", &rv);
    if (NS_FAILED(rv)) return rv;
    
    if (aShouldFocus)
      recentWindow->Focus();
    else {
      nsCOMPtr<nsIDOMChromeWindow> chromeWindow(do_QueryInterface(recentWindow));
      chromeWindow->GetAttentionWithCycleCount(aFlashCount);
    }
  }
  else {
    // If we ever have the capability to display the UI of third party dl managers,
    // we'll open their UI here instead.
    nsCOMPtr<nsIWindowWatcher> ww = do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);
    if (NS_FAILED(rv)) return rv;

    // pass the datasource to the window
    nsCOMPtr<nsISupportsArray> params;
    NS_NewISupportsArray(getter_AddRefs(params));

    // I love static members. 
    nsCOMPtr<nsIDownloadManager> dlMgr(do_GetService("@mozilla.org/download-manager;1"));
    nsCOMPtr<nsIRDFDataSource> ds;
    dlMgr->GetDatasource(getter_AddRefs(ds));

    params->AppendElement(ds);
    params->AppendElement(aDownload);
    
    nsCOMPtr<nsIDOMWindow> newWindow;
    rv = ww->OpenWindow(aParent,
                        DOWNLOAD_MANAGER_FE_URL,
                        "_blank",
                        "chrome,dialog=no,resizable",
                        params,
                        getter_AddRefs(newWindow));
  }
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIDownloadManager::openProgressDialogFor ( in nsIDownload  aDownload,
in nsIDOMWindow  aParent,
in boolean  aCancelDownloadOnClose 
) [inherited]

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.
void nsDownloadManager::OpenTimerCallback ( nsITimer aTimer,
void aClosure 
) [static, protected]

Definition at line 1151 of file nsDownloadManager.cpp.

{
  nsVoidArray* params = (nsVoidArray*)aClosure;
  nsIDOMWindow* parent = (nsIDOMWindow*)params->ElementAt(0);
  nsDownload* download = (nsDownload*)params->ElementAt(1);
  
  PRInt32 complete;
  download->GetPercentComplete(&complete);
  
  PRBool closeDM = PR_FALSE;
  nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
  if (pref)
    pref->GetBoolPref(PREF_BDM_CLOSEWHENDONE, &closeDM);

  // Check closeWhenDone pref before opening download manager
  if (!closeDM || complete < 100) {
    PRBool focusDM = PR_FALSE;
    PRBool showDM = PR_TRUE;
    PRInt32 flashCount = -1;

    if (pref) {
      pref->GetBoolPref(PREF_BDM_FOCUSWHENSTARTING, &focusDM);

      // We only flash the download manager if the user has the download manager show
      pref->GetBoolPref(PREF_BDM_SHOWWHENSTARTING, &showDM);
      if (showDM) 
        pref->GetIntPref(PREF_BDM_FLASHCOUNT, &flashCount);
      else
        flashCount = 0;
    }

    nsDownloadManager::OpenDownloadManager(focusDM, flashCount, download, parent);
  }

  NS_RELEASE(download);
  NS_IF_RELEASE(parent);

  delete params;
}

Here is the call graph for this function:

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

Pause the specified download.

nsresult nsDownloadManager::PauseResumeDownload ( const PRUnichar aPath,
PRBool  aPause 
) [protected]

Definition at line 1050 of file nsDownloadManager.cpp.

{
  nsresult rv;

  nsStringKey key(aPath);
  if (!mCurrDownloads.Exists(&key))
    return NS_ERROR_FAILURE;

  nsDownload* internalDownload = NS_STATIC_CAST(nsDownload*, mCurrDownloads.Get(&key));
  if (!internalDownload)
    return NS_ERROR_FAILURE;

  // Update download state in the DataSource
  nsCOMPtr<nsIRDFInt> intLiteral;

  gRDFService->GetIntLiteral(
    aPause ? 
    (PRInt32)nsIDownloadManager::DOWNLOAD_PAUSED : 
    (PRInt32)nsIDownloadManager::DOWNLOAD_DOWNLOADING, getter_AddRefs(intLiteral));

  nsCOMPtr<nsIRDFResource> res;
  gRDFService->GetUnicodeResource(nsDependentString(aPath), getter_AddRefs(res));

  nsCOMPtr<nsIRDFNode> oldTarget;
  mDataSource->GetTarget(res, gNC_DownloadState, PR_TRUE, getter_AddRefs(oldTarget));

  if (oldTarget) {
    rv = mDataSource->Change(res, gNC_DownloadState, oldTarget, intLiteral);
    if (NS_FAILED(rv)) return rv;
  }
  else {
    rv = mDataSource->Assert(res, gNC_DownloadState, intLiteral, PR_TRUE);
    if (NS_FAILED(rv)) return rv;
  }

  // Pause the actual download
  internalDownload->Pause(aPause);

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 782 of file nsDownloadManager.cpp.

{
  nsStringKey key(aPath);
  
  // RemoveDownload is for downloads not currently in progress. Having it
  // cancel in-progress downloads would make things complicated, so just return.
  PRBool inProgress = mCurrDownloads.Exists(&key);
  NS_ASSERTION(!inProgress, "Can't call RemoveDownload on a download in progress!");
  if (inProgress)
    return NS_ERROR_FAILURE;

  nsCOMPtr<nsIRDFResource> res;
  gRDFService->GetUnicodeResource(nsDependentString(aPath), getter_AddRefs(res));

  return RemoveDownload(res);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIDownloadManager::removeDownload ( in wstring  aPersistentDescriptor) [inherited]

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

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

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

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.

Definition at line 944 of file nsDownloadManager.cpp.

{
  // None of the function calls here should need error checking or their results
  // null checked because they should always succeed. If they fail, and there's 
  // a crash, it's a sign that this function is being called after the download 
  // manager or services that it rely on have been shut down, and there's a 
  // problem in some other code, somewhere.
  nsCOMPtr<nsIRDFContainer> downloads;
  GetDownloadsContainer(getter_AddRefs(downloads));

  nsCOMPtr<nsISimpleEnumerator> e;
  downloads->GetElements(getter_AddRefs(e));

  // This is our list of bad download entries. 
  nsCOMPtr<nsISupportsArray> ary;
  NS_NewISupportsArray(getter_AddRefs(ary));

  PRBool hasMore;
  e->HasMoreElements(&hasMore);
  nsCOMPtr<nsIRDFResource> downloadRes;
  while (hasMore) {
    e->GetNext(getter_AddRefs(downloadRes));

    PRBool hasProperty;

    // A valid download entry in the datasource will have at least the following
    // properties:
    // - NC:DownloadState -- the current state of the download, defined as
    //                       an integer value, see enumeration in 
    //                       nsDownloadManager.h, e.g. |0| (|DOWNLOADING|)
    // - NC:File          -- where the file is to be saved, e.g. 
    //                       "C:\\FirebirdSetup.exe"
    // - NC:Name          -- the visual display name of the download, e.g.
    //                       "FirebirdSetup.exe"

    nsIRDFResource* properties[] = { gNC_DownloadState, gNC_File, gNC_Name };
    for (PRInt32 i = 0; i < 3; ++i) {
      mDataSource->HasArcOut(downloadRes, properties[i], &hasProperty);
      if (!hasProperty) {
        ary->AppendElement(downloadRes);
        break;
      }
    }

    e->HasMoreElements(&hasMore);
  }

  // Coalesce notifications
  mDataSource->BeginUpdateBatch();

  // Now Remove all the bad downloads. 
  PRUint32 cnt;
  ary->Count(&cnt);
  for (PRUint32 i = 0; i < cnt; ++i) {
    nsCOMPtr<nsIRDFResource> download(do_QueryElementAt(ary, i));

    // Use the internal method because we know what we're doing! (We hope!)
    RemoveDownload(download);
  }

  mDataSource->EndUpdateBatch();

  return NS_OK;
}

Here is the call graph for this function:


Friends And Related Function Documentation

nsDownload [friend]

Definition at line 154 of file nsDownloadManager.h.


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.

Definition at line 53 of file nsIXPInstallManagerUI.idl.

Definition at line 57 of file nsIXPInstallManagerUI.idl.

Definition at line 49 of file nsIXPInstallManagerUI.idl.

Definition at line 51 of file nsIXPInstallManagerUI.idl.

Definition at line 50 of file nsIXPInstallManagerUI.idl.

The Download Manager's progress listener.

Definition at line 164 of file nsIDownloadManager.idl.

Definition at line 151 of file nsDownloadManager.h.

Definition at line 149 of file nsDownloadManager.h.

Definition at line 104 of file nsDownloadManager.h.

nsHashtable nsDownloadManager::mCurrDownloads [private]

Definition at line 152 of file nsDownloadManager.h.

Definition at line 145 of file nsDownloadManager.h.

Definition at line 150 of file nsDownloadManager.h.

Definition at line 98 of file nsDownloadManager.h.

Definition at line 147 of file nsDownloadManager.h.

Definition at line 141 of file nsDownloadManager.h.

Definition at line 148 of file nsDownloadManager.h.

Definition at line 94 of file nsDownloadManager.h.

Definition at line 146 of file nsDownloadManager.h.

Definition at line 55 of file nsIXPInstallManagerUI.idl.


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