Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes
nsXPIProgressListener Class Reference

#include <nsDownloadManager.h>

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

List of all members.

Public Member Functions

NS_DECL_NSIXPIPROGRESSDIALOG
NS_DECL_ISUPPORTS 
nsXPIProgressListener ()
 nsXPIProgressListener (nsDownloadManager *aManager)
virtual ~nsXPIProgressListener ()
void AddDownload (nsIDownload *aDownload)
PRBool HasActiveXPIOperations ()
void onStateChange (in unsigned long index, in short state, in long value)
 basic info to control the install progress dialog.
void onProgress (in unsigned long index, in unsigned long long value, in unsigned long long maxValue)
 download progress

Public Attributes

const short DOWNLOAD_START = 0
 state values for onStateChange
const short DOWNLOAD_DONE = 1
const short INSTALL_START = 2
const short INSTALL_DONE = 3
const short DIALOG_CLOSE = 4

Protected Member Functions

void RemoveDownloadAtIndex (PRUint32 aIndex)
void AssertProgressInfoForDownload (nsDownload *aDownload)

Private Attributes

nsDownloadManagermDownloadManager
nsCOMPtr< nsISupportsArraymDownloads

Detailed Description

Definition at line 157 of file nsDownloadManager.h.


Constructor & Destructor Documentation

NS_DECL_NSIXPIPROGRESSDIALOG NS_DECL_ISUPPORTS nsXPIProgressListener::nsXPIProgressListener ( ) [inline]

Definition at line 163 of file nsDownloadManager.h.

{ };

Definition at line 1447 of file nsDownloadManager.cpp.

Here is the call graph for this function:

Definition at line 1454 of file nsDownloadManager.cpp.

{
  // Release any remaining references to objects held by the downloads array
  mDownloads->Clear();

  mDownloadManager = nsnull;
}

Member Function Documentation

Definition at line 1463 of file nsDownloadManager.cpp.

{
  PRUint32 cnt;
  mDownloads->Count(&cnt);
  PRBool foundMatch = PR_FALSE;

  nsCOMPtr<nsIURI> uri1, uri2;
  for (PRUint32 i = 0; i < cnt; ++i) {
    nsCOMPtr<nsIDownload> download(do_QueryElementAt(mDownloads, i));
    download->GetSource(getter_AddRefs(uri1));
    aDownload->GetSource(getter_AddRefs(uri2));

    uri1->Equals(uri2, &foundMatch);
    if (foundMatch)
      break;
  }
  if (!foundMatch)
    mDownloads->AppendElement(aDownload);
}

Here is the call graph for this function:

Definition at line 1570 of file nsDownloadManager.cpp.

Here is the call graph for this function:

Definition at line 1490 of file nsDownloadManager.cpp.

{
  PRUint32 count;
  mDownloads->Count(&count);
  return count != 0;
}
void nsIXPIProgressDialog::onProgress ( in unsigned long  index,
in unsigned long long  value,
in unsigned long long  maxValue 
) [inherited]

download progress

Parameters:
indexthe package to which this refers
valuenumber of bytes downloaded
maxValuethe total size
void nsIXPIProgressDialog::onStateChange ( in unsigned long  index,
in short  state,
in long  value 
) [inherited]

basic info to control the install progress dialog.

The dialog can go away any time after it has received the DIALOG_CLOSE state message but needs to accept messages until that time even if it is not visible.

Normally for each install package the dialog will receive the download and install messages in START/DONE pairs, but in the case of a download error the dialog will be sent only the DOWNLOAD_START followed by an INSTALL_DONE message with the value nsInstall::DOWNLOAD_ERROR

Parameters:
indexthe package this message is about of those passed into openProgressDialog. ignored when state==DIALOG_CLOSE
statethe kind of message
valuefinal result when state==INSTALL_DONE, otherwise ignored

Definition at line 1484 of file nsDownloadManager.cpp.

{
  mDownloads->RemoveElementAt(aIndex);
}

Member Data Documentation

Definition at line 55 of file nsIXPIProgressDialog.idl.

Definition at line 52 of file nsIXPIProgressDialog.idl.

state values for onStateChange

Definition at line 51 of file nsIXPIProgressDialog.idl.

Definition at line 54 of file nsIXPIProgressDialog.idl.

Definition at line 53 of file nsIXPIProgressDialog.idl.

Definition at line 177 of file nsDownloadManager.h.

Definition at line 178 of file nsDownloadManager.h.


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