|
1 | | -/*************************************************************************** |
2 | | - qgsfiledownloader.sip |
3 | | - -------------------------------------- |
4 | | - Date : November 2016 |
5 | | - Copyright : (C) 2016 by Alessandro Pasotti |
6 | | - Email : elpaso at itopen dot it |
7 | | - *************************************************************************** |
8 | | - * * |
9 | | - * This program is free software; you can redistribute it and/or modify * |
10 | | - * it under the terms of the GNU General Public License as published by * |
11 | | - * the Free Software Foundation; either version 2 of the License, or * |
12 | | - * (at your option) any later version. * |
13 | | - * * |
14 | | - ***************************************************************************/ |
| 1 | +/************************************************************************ |
| 2 | + * This file has been generated automatically from * |
| 3 | + * * |
| 4 | + * src/gui/qgsfiledownloader.h * |
| 5 | + * * |
| 6 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 7 | + ************************************************************************/ |
15 | 8 |
|
16 | | -/** \ingroup gui |
17 | | - * QgsFileDownloader is a utility class for downloading files. |
18 | | - * |
19 | | - * To use this class, it is necessary to pass the URL and an output file name as |
20 | | - * arguments to the constructor, the download will start immediately. |
21 | | - * The download is asynchronous and depending on the guiNotificationsEnabled |
22 | | - * parameter accepted by the constructor (default = true) the class will |
23 | | - * show a progress dialog and report all errors in a QMessageBox::warning dialog. |
24 | | - * If the guiNotificationsEnabled parameter is set to false, the class can still |
25 | | - * be used through the signals and slots mechanism. |
26 | | - * The object will destroy itself when the request completes, errors or is canceled. |
27 | | - * |
28 | | - * @note added in QGIS 2.18.1 |
29 | | - */ |
30 | | -class QgsFileDownloader : public QObject |
| 9 | + |
| 10 | + |
| 11 | +class QgsFileDownloader : QObject |
31 | 12 | { |
32 | | - %TypeHeaderCode |
33 | | - #include <qgsfiledownloader.h> |
34 | | - %End |
| 13 | +%Docstring |
| 14 | + QgsFileDownloader is a utility class for downloading files. |
| 15 | + |
| 16 | + To use this class, it is necessary to pass the URL and an output file name as |
| 17 | + arguments to the constructor, the download will start immediately. |
| 18 | + The download is asynchronous and depending on the guiNotificationsEnabled |
| 19 | + parameter accepted by the constructor (default = true) the class will |
| 20 | + show a progress dialog and report all errors in a QMessageBox.warning dialog. |
| 21 | + If the guiNotificationsEnabled parameter is set to false, the class can still |
| 22 | + be used through the signals and slots mechanism. |
| 23 | + The object will destroy itself when the request completes, errors or is canceled. |
| 24 | + An optional authentication configuration can be specified. |
| 25 | + |
| 26 | +.. versionadded:: 2.18.1 |
| 27 | +%End |
| 28 | + |
| 29 | +%TypeHeaderCode |
| 30 | +#include "qgsfiledownloader.h" |
| 31 | +%End |
35 | 32 | public: |
36 | | - /** |
37 | | - * QgsFileDownloader |
38 | | - * @param url the download url |
39 | | - * @param outputFileName file name where the downloaded content will be stored |
40 | | - * @param guiNotificationsEnabled if false, the downloader will not display any progress bar or error message |
41 | | - */ |
42 | | - QgsFileDownloader(QUrl url, QString outputFileName, bool guiNotificationsEnabled = true); |
43 | 33 |
|
44 | | - signals: |
45 | | - /** Emitted when the download has completed successfully */ |
46 | | - void downloadCompleted(); |
47 | | - /** Emitted always when the downloader exits */ |
48 | | - void downloadExited(); |
49 | | - /** Emitted when the download was canceled by the user */ |
50 | | - void downloadCanceled(); |
51 | | - /** Emitted when an error makes the download fail */ |
52 | | - void downloadError( QStringList errorMessages ); |
53 | | - /** Emitted when data ready to be processed */ |
54 | | - void downloadProgress(qint64 bytesReceived, qint64 bytesTotal); |
| 34 | + QgsFileDownloader( const QUrl &url, const QString &outputFileName, bool guiNotificationsEnabled = true, QString authcfg = QString() ); |
| 35 | +%Docstring |
| 36 | + QgsFileDownloader |
| 37 | + \param url the download url |
| 38 | + \param outputFileName file name where the downloaded content will be stored |
| 39 | + \param guiNotificationsEnabled if false, the downloader will not display any progress bar or error message |
| 40 | + \param authcfg optionally apply this authentication configuration |
| 41 | +%End |
| 42 | + |
| 43 | + signals: |
| 44 | + void downloadCompleted(); |
| 45 | +%Docstring |
| 46 | +Emitted when the download has completed successfully |
| 47 | +%End |
| 48 | + void downloadExited(); |
| 49 | +%Docstring |
| 50 | +Emitted always when the downloader exits |
| 51 | +%End |
| 52 | + void downloadCanceled(); |
| 53 | +%Docstring |
| 54 | +Emitted when the download was canceled by the user |
| 55 | +%End |
| 56 | + void downloadError( QStringList errorMessages ); |
| 57 | +%Docstring |
| 58 | +Emitted when an error makes the download fail |
| 59 | +%End |
| 60 | + void downloadProgress( qint64 bytesReceived, qint64 bytesTotal ); |
| 61 | +%Docstring |
| 62 | +Emitted when data are ready to be processed |
| 63 | +%End |
55 | 64 |
|
56 | | - public slots: |
57 | | - /** |
58 | | - * Called when a download is canceled by the user |
59 | | - * this slot aborts the download and deletes the object |
60 | | - * Never call this slot directly: this is meant to |
61 | | - * be managed by the signal-slot system. |
62 | | - */ |
63 | | - void onDownloadCanceled(); |
| 65 | + public slots: |
64 | 66 |
|
65 | | - private: |
66 | | - ~QgsFileDownloader(); |
| 67 | + void onDownloadCanceled(); |
| 68 | +%Docstring |
| 69 | + Called when a download is canceled by the user |
| 70 | + this slot aborts the download and deletes |
| 71 | + the object. |
| 72 | + Never call this slot directly: this is meant to |
| 73 | + be managed by the signal-slot system. |
| 74 | +%End |
| 75 | + |
| 76 | + protected: |
| 77 | + ~QgsFileDownloader(); |
67 | 78 |
|
68 | 79 | }; |
| 80 | + |
| 81 | +/************************************************************************ |
| 82 | + * This file has been generated automatically from * |
| 83 | + * * |
| 84 | + * src/gui/qgsfiledownloader.h * |
| 85 | + * * |
| 86 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 87 | + ************************************************************************/ |
0 commit comments