libosmscout 1.1.1
Loading...
Searching...
No Matches
osmscout::DownloadJob Class Referenceabstract

#include <libosmscout-client-qt/include/osmscoutclientqt/FileDownloader.h>

Inheritance diagram for osmscout::DownloadJob:
Collaboration diagram for osmscout::DownloadJob:

Public Slots

void onJobFailed (QString errorMessage, bool recoverable)
void onJobFinished (QString path)
void onDownloadProgress (uint64_t)
void downloadNextFile ()

Signals

void finished ()
void failed (QString error)
void canceled ()
void downloadProgress ()

Public Member Functions

 DownloadJob (QNetworkAccessManager *webCtrl, QDir target, bool replaceExisting)
 ~DownloadJob () override
 DownloadJob (const DownloadJob &)=delete
 DownloadJob (DownloadJob &&)=delete
DownloadJoboperator= (const DownloadJob &)=delete
DownloadJoboperator== (const DownloadJob &&)=delete
void start (const QString &serverBasePath, const QStringList &files)
void cancel ()
virtual uint64_t expectedSize () const =0
bool isDone () const
bool isSuccessful () const
bool isDownloading () const
QString getError () const
bool isReplaceExisting () const
QDir getDestinationDirectory () const
double getProgress ()
QString getDownloadingFile ()

Protected Member Functions

void clearJobs ()

Protected Attributes

QList< FileDownloader * > jobs
QNetworkAccessManager * webCtrl
QDir target
bool done {false}
bool started {false}
bool successful {false}
bool canceledByUser {false}
uint64_t downloadedBytes {0}
QString error
bool replaceExisting

Detailed Description

Class that provide abstraction for download job of multiple files in sequence.

Constructor & Destructor Documentation

◆ DownloadJob() [1/3]

osmscout::DownloadJob::DownloadJob ( QNetworkAccessManager * webCtrl,
QDir target,
bool replaceExisting )

◆ ~DownloadJob()

osmscout::DownloadJob::~DownloadJob ( )
override

◆ DownloadJob() [2/3]

osmscout::DownloadJob::DownloadJob ( const DownloadJob & )
delete

◆ DownloadJob() [3/3]

osmscout::DownloadJob::DownloadJob ( DownloadJob && )
delete

Member Function Documentation

◆ cancel()

void osmscout::DownloadJob::cancel ( )

Cancel downloading, remove temporary files (of unfinished jobs), emit canceled signal. Already downloaded files are retained on disk (this behaviour may be modified by subclass).

◆ canceled

void osmscout::DownloadJob::canceled ( )
signal

◆ clearJobs()

void osmscout::DownloadJob::clearJobs ( )
protected

Clear all file download jobs, it removes temporary *.download files

◆ downloadNextFile

void osmscout::DownloadJob::downloadNextFile ( )
slot

◆ downloadProgress

void osmscout::DownloadJob::downloadProgress ( )
signal

◆ expectedSize()

virtual uint64_t osmscout::DownloadJob::expectedSize ( ) const
pure virtual

◆ failed

void osmscout::DownloadJob::failed ( QString error)
signal

◆ finished

void osmscout::DownloadJob::finished ( )
signal

◆ getDestinationDirectory()

QDir osmscout::DownloadJob::getDestinationDirectory ( ) const
inline

◆ getDownloadingFile()

QString osmscout::DownloadJob::getDownloadingFile ( )

◆ getError()

QString osmscout::DownloadJob::getError ( ) const
inline

◆ getProgress()

double osmscout::DownloadJob::getProgress ( )

◆ isDone()

bool osmscout::DownloadJob::isDone ( ) const
inline

◆ isDownloading()

bool osmscout::DownloadJob::isDownloading ( ) const
inline

◆ isReplaceExisting()

bool osmscout::DownloadJob::isReplaceExisting ( ) const
inline

◆ isSuccessful()

bool osmscout::DownloadJob::isSuccessful ( ) const
inline

◆ onDownloadProgress

void osmscout::DownloadJob::onDownloadProgress ( uint64_t )
slot

◆ onJobFailed

void osmscout::DownloadJob::onJobFailed ( QString errorMessage,
bool recoverable )
slot

◆ onJobFinished

void osmscout::DownloadJob::onJobFinished ( QString path)
slot

◆ operator=()

DownloadJob & osmscout::DownloadJob::operator= ( const DownloadJob & )
delete

◆ operator==()

DownloadJob & osmscout::DownloadJob::operator== ( const DownloadJob && )
delete

◆ start()

void osmscout::DownloadJob::start ( const QString & serverBasePath,
const QStringList & files )

Member Data Documentation

◆ canceledByUser

bool osmscout::DownloadJob::canceledByUser {false}
protected

◆ done

bool osmscout::DownloadJob::done {false}
protected

◆ downloadedBytes

uint64_t osmscout::DownloadJob::downloadedBytes {0}
protected

◆ error

QString osmscout::DownloadJob::error
protected

◆ jobs

QList<FileDownloader*> osmscout::DownloadJob::jobs
protected

◆ replaceExisting

bool osmscout::DownloadJob::replaceExisting
protected

◆ started

bool osmscout::DownloadJob::started {false}
protected

◆ successful

bool osmscout::DownloadJob::successful {false}
protected

◆ target

QDir osmscout::DownloadJob::target
protected

◆ webCtrl

QNetworkAccessManager* osmscout::DownloadJob::webCtrl
protected

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