#include <sbBaseMediaItemDownloadJob.h>
Public Member Functions | |
NS_DECL_ISUPPORTS NS_DECL_SBIMEDIAITEMDOWNLOADJOB NS_DECL_SBIJOBPROGRESS NS_DECL_SBIJOBCANCELABLE virtual NS_DECL_SBIFILEDOWNLOADERLISTENER | ~sbBaseMediaItemDownloadJob () |
Public Member Functions inherited from sbIMediaItemDownloadJob | |
void | start () |
Public Member Functions inherited from sbIJobProgress | |
nsIStringEnumerator | getErrorMessages () |
Enumerate all the errors encountered during the job. More... | |
void | addJobProgressListener (in sbIJobProgressListener aListener) |
Add a listener to be notified when significant job progress has been made. More... | |
void | removeJobProgressListener (in sbIJobProgressListener aListener) |
Remove a previously added listener. More... | |
Public Member Functions inherited from sbIJobCancelable | |
void | cancel () |
Attempt to cancel the job Throws NS_ERROR_FAILURE if canceling fails. More... | |
Public Member Functions inherited from sbIFileDownloaderListener | |
void | onProgress () |
Called when progress is made on file download. More... | |
void | onComplete () |
Called when download has completed. More... | |
Protected Member Functions | |
virtual nsresult | Start (nsIURI *aURI) |
virtual nsresult | Stop () |
virtual nsresult | GetDownloadURI (nsIURI **aURI) |
virtual nsresult | Initialize () |
sbBaseMediaItemDownloadJob (sbIMediaItem *aMediaItem, sbILibrary *aTargetLibrary=nsnull) | |
Protected Attributes | |
PRLock * | mLock |
nsCOMPtr< sbIMediaItem > | mMediaItem |
nsCOMPtr< sbIMutablePropertyArray > | mProperties |
nsCOMPtr< sbILibrary > | mTargetLibrary |
nsCOMPtr< sbIFileDownloader > | mFileDownloader |
nsCOMPtr< sbITemporaryFileFactory > | mTemporaryFileFactory |
nsTArray< nsCOMPtr < sbIJobProgressListener > > | mListenerList |
PRUint16 | mStatus |
Additional Inherited Members | |
Public Attributes inherited from sbIMediaItemDownloadJob | |
readonly attribute nsIFile | downloadedFile |
readonly attribute sbIPropertyArray | properties |
attribute sbITemporaryFileFactory | temporaryFileFactory |
Public Attributes inherited from sbIJobProgress | |
const unsigned short | STATUS_FAILED = 0x00 |
Constant indicating that the job has completed with errors. More... | |
const unsigned short | STATUS_SUCCEEDED = 0x10 |
Constant indicating that the job has completed. More... | |
const unsigned short | STATUS_RUNNING = 0x20 |
Constant indicating that the job is active. More... | |
readonly attribute unsigned short | status |
Current status of the job. More... | |
readonly attribute boolean | blocked |
If true, progress of job is blocked (e.g., due to locked resource). More... | |
readonly attribute AString | statusText |
Localized message describing the status of the job. More... | |
readonly attribute AString | titleText |
Localized message describing the type or purpose of the job. More... | |
readonly attribute unsigned long | progress |
Number of work units completed. More... | |
readonly attribute unsigned long | total |
Total number of work units to be completed May be set to 0 if the job length is indeterminate. More... | |
readonly attribute unsigned long | errorCount |
Number of errors that have been encountered. More... | |
Public Attributes inherited from sbIJobCancelable | |
readonly attribute boolean | canCancel |
True if it is possible to cancel the job. More... | |
This class provides a base class implementation of sbIMediaItemDownloadJob for downloaders that can download using the sbFileDownloader component.
Definition at line 78 of file sbBaseMediaItemDownloadJob.h.
|
virtual |
Destroy a Base media item download job instance.
Definition at line 630 of file sbBaseMediaItemDownloadJob.cpp.
|
protected |
Construct a base media item download job object to download the media item specified by aMediaItem for the library specified by aTargetLibrary. If aLibrary is not specified, download media item for the main library.
aMediaItem | Media item to download. |
aTargetLibrary | Library for which the media item will be downloaded. |
Definition at line 779 of file sbBaseMediaItemDownloadJob.cpp.
|
protectedvirtual |
Return the download source URI in aURI. This method is intended to be overridden by sub-classes. The default implementation uses the download media item content source.
aURI | Returned download source URI. |
Definition at line 725 of file sbBaseMediaItemDownloadJob.cpp.
|
protectedvirtual |
Initialize a base media item download job.
Definition at line 754 of file sbBaseMediaItemDownloadJob.cpp.
|
protectedvirtual |
Start downloading from the source URI specified by aURI. Sub-classes that need to make network requests to get the source URI can override sbIMediaItemDownloadJob.Start, get the source URI, and then call this Start method when the source URI is available.
aURI | Source URI from which to download. |
Definition at line 653 of file sbBaseMediaItemDownloadJob.cpp.
|
protectedvirtual |
Stop downloading. Sub-classes that need to do special actions on stop may override this method and then call the base class version.
Definition at line 709 of file sbBaseMediaItemDownloadJob.cpp.
|
protected |
Definition at line 137 of file sbBaseMediaItemDownloadJob.h.
|
protected |
Definition at line 141 of file sbBaseMediaItemDownloadJob.h.
|
protected |
Definition at line 132 of file sbBaseMediaItemDownloadJob.h.
|
protected |
Definition at line 133 of file sbBaseMediaItemDownloadJob.h.
|
protected |
Definition at line 135 of file sbBaseMediaItemDownloadJob.h.
|
protected |
Definition at line 142 of file sbBaseMediaItemDownloadJob.h.
|
protected |
Definition at line 136 of file sbBaseMediaItemDownloadJob.h.
|
protected |
Definition at line 139 of file sbBaseMediaItemDownloadJob.h.