GCF LOGO VCL LOGO
GCF::IGDriveLiteFileDownloaderListModel Class Referenceabstract

Provides access to all downloaders from this component as a model

#include <GCF3/IGDriveLiteFileDownloaderListModel>
. More...

Public Types

enum  Field {
  SourceFileId = GCF::JobListModel::Object+1, SourceFileName, SourceFileIcon, DownloadedFileName,
  Downloader, DownloaderTitle, DownloaderDescription, DownloaderIcon,
  DownloaderIconUrl, DownloaderProgress, DownloaderStatus, DownloaderIsStarted,
  DownloaderIsSuspended, DownloaderIsComplete, DownloaderIsRunning, DownloaderHasError,
  DownloaderError
}
 
- Public Types inherited from GCF::JobListModel
enum  Field {
  Kind = Qt::UserRole+1, Title, Description, Icon,
  IconUrl, Progress, Status, IsStarted,
  IsSuspended, IsComplete, IsRunning, HasError,
  Error, Object
}
 

Public Member Functions

virtual
GCF::IGDriveLiteFileDownloader
downloader (const QString &id) const =0
 
GCF::IGDriveLiteFileDownloaderdownloaderAt (int index) const
 
virtual Q_INVOKABLE int downloaderCount () const =0
 
virtual Q_SIGNAL void allDownloadsComplete ()=0
 
virtual Q_INVOKABLE void cancelAllDownloads ()=0
 
virtual Q_INVOKABLE void clearCompletedDownloads ()=0
 
virtual Q_INVOKABLE bool abortDownloadAt (int index)=0
 
virtual Q_INVOKABLE bool retryDownloadAt (int index)=0
 
virtual Q_INVOKABLE bool suspendDownloadAt (int index)=0
 
virtual Q_INVOKABLE bool resumeDownloadAt (int index)=0
 
- Public Member Functions inherited from GCF::JobListModel
 JobListModel (QObject *parent=0)
 
 ~JobListModel ()
 
virtual bool addJob (AbstractJob *job)
 
void removeJob (AbstractJob *job)
 
AbstractJobjobAt (int index) const
 
Q_INVOKABLE bool containsJob (GCF::AbstractJob *job) const
 
Q_INVOKABLE int indexOfJob (GCF::AbstractJob *job) const
 
Q_INVOKABLE QObject * jobObjectAt (int index) const
 
void setColumns (const QList< int > &columns)
 
QList< int > columns () const
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 
int columnCount (const QModelIndex &parent=QModelIndex()) const
 
QVariant data (const QModelIndex &index, int role) const
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const
 
QHash< int, QByteArray > roleNames () const
 
Q_INVOKABLE void cancelAllJobs ()
 
Q_INVOKABLE void clearCompletedJobs ()
 
Q_INVOKABLE bool cancelJobAt (int index)
 
Q_INVOKABLE bool retryJobAt (int index)
 
Q_INVOKABLE bool suspendJobAt (int index)
 
Q_INVOKABLE bool resumeJobAt (int index)
 
- Public Member Functions inherited from GCF::ObjectListEventListener
 ObjectListEventListener ()
 
virtual ~ObjectListEventListener ()
 
virtual QString listenerType () const
 
virtual void objectAdded (int index, QObject *obj)
 
virtual void objectDeleted (int index, QObject *obj)
 

Additional Inherited Members

- Signals inherited from GCF::JobListModel
void jobCountChanged ()
 
void allJobsComplete ()
 
void jobUpdated (GCF::AbstractJob *job)
 
void jobStarted (GCF::AbstractJob *job)
 
void jobSuspended (GCF::AbstractJob *job)
 
void jobResumed (GCF::AbstractJob *job)
 
void jobCompleted (GCF::AbstractJob *job)
 
- Properties inherited from GCF::JobListModel
int jobCount
 

Detailed Description

File downloader model helps to create and maintain list of file downloaders. It is caller's responsibility to delete the downloader created using the GCF::IGDriveLite::createFileDownloader(). You can access the details about a downloader at a specific index by using the enumeration values of GCF::IGDriveLiteFileDownloaderListModel::Field. Also this model provides a list of helper functions to control the downloaders at specific indexes.

Downloaders and uploaders can be visualized in QML or a List-View. For example:

downloads-and-uploads-qml.png

Member Enumeration Documentation

The enumeration values of Field represents details of GCF::IGDriveLiteDownloader.

Enumerator
SourceFileId 

file id of the downloading file of downloader. [Role-name: "downloaderSourceFileId"]

SourceFileName 

file name of the downloading file of downloader. [Role-name: "downloaderSourceFileName"]

SourceFileIcon 

icon of the downloading file of downloader. [Role-name: "downloaderSourceFileIcon"]

DownloadedFileName 

file name as which the drive has downloaded the file. [Role-name: "downloaderDownloadedFileName"]

Downloader 

downloader object. [Role-name: "downloader"]

DownloaderTitle 

title of the downloader. [Role-name: "downloaderTitle"]

DownloaderDescription 

description set on the downloader. [Role-name: "downloaderDescription"]

DownloaderIcon 

icon of the downloader. [Role-name: "downloaderIcon"]

DownloaderIconUrl 

icon url of the downloader. [Role-name: "downloaderIconUrl"]

DownloaderProgress 

download progress of the downloader. [Role-name: "downloaderProgress"]

DownloaderStatus 

status of the downloader. [Role-name: "downloaderStatus"]

DownloaderIsStarted 

whether downloading started. [Role-name: "downloaderIsStarted"]

DownloaderIsSuspended 

whether downloader is suspended. [Role-name: "downloaderIsSuspended"]

DownloaderIsComplete 

whether download is complete. [Role-name: "downloaderIsComplete"]

DownloaderIsRunning 

whether downloader is in runnning state. [Role-name: "downloaderIsRunning"]

DownloaderHasError 

whether download has any error. [Role-name: "downloaderHasError"]

DownloaderError 

error while downloading. [Role-name: "downloaderError"]

Member Function Documentation

GCF::IGDriveLiteFileDownloaderListModel::downloader ( const QString &  id) const
pure virtual

Returns downloader for the file id in the current list of downloaders.

Parameters
idQString id of item
Returns
GCF::IGDriveLiteFileDownloader
GCF::IGDriveLiteFileDownloaderListModel::downloaderAt ( int  index) const

Returns the downloader at the specified index.

Parameters
indexindex of donwloader.
Returns
GCF::IGDriveLiteFileDownloader
GCF::IGDriveLiteFileDownloaderListModel::downloaderCount ( ) const
pure virtual

Total number of downloaders in the model.

GCF::IGDriveLiteFileDownloaderListModel::allDownloadsComplete ( )
pure virtual

This signal is emitted when all the downloaders in the current list has been completed downloading.

GCF::IGDriveLiteFileDownloaderListModel::cancelAllDownloads ( )
pure virtual

Cancels all the ongoing downloads in the current list of downloads.

GCF::IGDriveLiteFileDownloaderListModel::clearCompletedDownloads ( )
pure virtual

Removes all the downloaders that have completed downloading.

GCF::IGDriveLiteFileDownloaderListModel::abortDownloadAt ( int  index)
pure virtual

Aborts download of downloader at the specific index.

GCF::IGDriveLiteFileDownloaderListModel::retryDownloadAt ( int  index)
pure virtual

Retries the download of downloader at specified index.

GCF::IGDriveLiteFileDownloaderListModel::suspendDownloadAt ( int  index)
pure virtual

Suspends the download of downloader at specified index.

GCF::IGDriveLiteFileDownloaderListModel::resumeDownloadAt ( int  index)
pure virtual

Resumes the download of downloader at specified index.