2017-10-18 12:56:27 +10:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsfiledownloader.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsFileDownloader : QObject
|
|
|
|
{
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
QgsFileDownloader is a utility class for downloading files.
|
2017-10-18 12:56:27 +10:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
To use this class, it is necessary to pass the URL and an output file name as
|
|
|
|
arguments to the constructor, the download will start immediately.
|
2017-10-18 12:56:27 +10:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
The download is asynchronous.
|
2017-10-18 12:56:27 +10:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
The object will destroy itself when the request completes, errors or is canceled.
|
|
|
|
An optional authentication configuration can be specified.
|
2017-10-18 12:56:27 +10:00
|
|
|
|
2017-10-19 07:29:48 +10:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
This class was part of the GUI library from QGIS 2.18.1 until QGIS 3.0
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-10-19 07:29:48 +10:00
|
|
|
.. versionadded:: 3.0
|
2017-10-18 12:56:27 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsfiledownloader.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
|
|
|
QgsFileDownloader( const QUrl &url, const QString &outputFileName, const QString &authcfg = QString(), bool delayStart = false );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
QgsFileDownloader
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param url: the download url
|
|
|
|
:param outputFileName: file name where the downloaded content will be stored
|
|
|
|
:param authcfg: optionally apply this authentication configuration
|
|
|
|
:param delayStart: if true, the download will not be commenced immediately and must
|
2018-05-24 21:21:14 +10:00
|
|
|
be triggered by a later call to startDownload(). This can be useful if connections need
|
|
|
|
to be made to the downloader and there's a chance the download will emit
|
|
|
|
signals before these connections have been made.
|
2017-10-18 12:56:27 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void downloadCompleted();
|
|
|
|
%Docstring
|
|
|
|
Emitted when the download has completed successfully
|
|
|
|
%End
|
|
|
|
void downloadExited();
|
|
|
|
%Docstring
|
|
|
|
Emitted always when the downloader exits
|
|
|
|
%End
|
2017-10-19 07:29:48 +10:00
|
|
|
|
2017-10-18 12:56:27 +10:00
|
|
|
void downloadCanceled();
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Emitted when the download was canceled by the user.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`cancelDownload`
|
2017-10-18 12:56:27 +10:00
|
|
|
%End
|
2017-10-19 07:29:48 +10:00
|
|
|
|
2017-10-18 12:56:27 +10:00
|
|
|
void downloadError( QStringList errorMessages );
|
|
|
|
%Docstring
|
|
|
|
Emitted when an error makes the download fail
|
|
|
|
%End
|
|
|
|
void downloadProgress( qint64 bytesReceived, qint64 bytesTotal );
|
|
|
|
%Docstring
|
|
|
|
Emitted when data are ready to be processed
|
|
|
|
%End
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
2017-10-19 07:29:48 +10:00
|
|
|
void cancelDownload();
|
2017-10-18 12:56:27 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Call to abort the download and delete this object after the cancelation
|
|
|
|
has been processed.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`downloadCanceled`
|
2017-10-18 12:56:27 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void startDownload();
|
|
|
|
%Docstring
|
|
|
|
Called to start the download
|
|
|
|
%End
|
|
|
|
|
|
|
|
protected:
|
|
|
|
~QgsFileDownloader();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsfiledownloader.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|