Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerExtensionDownloadTask.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright 2014 Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Matthew Woehlke, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerExtensionDownloadTask_h
22 #define __qSlicerExtensionDownloadTask_h
23 
24 // Qt includes
25 #include <QNetworkReply>
26 
27 // QtGUI includes
28 #include "qSlicerBaseQTCoreExport.h"
29 
30 class qSlicerExtensionDownloadTaskPrivate;
31 
32 class Q_SLICER_BASE_QTCORE_EXPORT qSlicerExtensionDownloadTask : public QObject
33 {
34  Q_OBJECT
35  Q_PROPERTY(QVariantMap metadata READ metadata WRITE setMetadata)
36  Q_PROPERTY(QString extensionName READ extensionName WRITE setExtensionName)
37  Q_PROPERTY(QString archiveName READ archiveName WRITE setArchiveName)
38  Q_PROPERTY(QNetworkReply* reply READ reply)
39 
40 public:
45  explicit qSlicerExtensionDownloadTask(QNetworkReply* reply,
46  QObject* parent = 0);
47 
50 
52  QVariantMap metadata() const;
53 
61  void setMetadata(const QVariantMap&);
62 
64  QString extensionName() const;
65 
67  void setExtensionName(const QString&);
68 
70  QString archiveName() const;
71 
73  void setArchiveName(const QString&);
74 
76  QNetworkReply* reply() const;
77 
78 signals:
79  void finished(qSlicerExtensionDownloadTask*);
80  void error(qSlicerExtensionDownloadTask*, QNetworkReply::NetworkError);
81  void progress(qSlicerExtensionDownloadTask*, qint64 received, qint64 total);
82 
83 protected slots:
84  void emitFinished();
85  void emitError(QNetworkReply::NetworkError);
86  void emitProgress(qint64, qint64);
87 
88 protected:
89  QScopedPointer<qSlicerExtensionDownloadTaskPrivate> d_ptr;
90 
91 private:
92  Q_DECLARE_PRIVATE(qSlicerExtensionDownloadTask);
93  Q_DISABLE_COPY(qSlicerExtensionDownloadTask);
94 };
95 
96 #endif