3
Copyright (C) Philipp Schmieder
5
feedback [at] clipgrab [dot] de
7
This file is part of ClipGrab.
8
ClipGrab is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
13
ClipGrab is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
18
You should have received a copy of the GNU General Public License
19
along with ClipGrab. If not, see <http://www.gnu.org/licenses/>.
24
#ifndef HTTP_HANDLER_H
25
#define HTTP_HANDLER_H
28
#include <QTemporaryFile>
48
QTemporaryFile* tempFile;
53
qint64 currentProgress;
61
return currentProgress + progress;
65
class http_handler : public QObject
73
QNetworkReply* addDownload(QString, bool chunked=false, QByteArray postData=NULL);
74
void continueDownload(download*);
75
void cancelAllDownloads();
76
void clearDownloads();
77
QList<download*> downloads;
79
QNetworkAccessManager* networkAccessManager;
81
QNetworkRequest createRequest(QUrl);
82
download* getDownload(QNetworkReply*);
86
void handleFinishedDownload(download* );
87
void handleNetworkReply(QNetworkReply*);
88
void handleSSLError(QNetworkReply* reply, const QList<QSslError> & errors);
93
void downloadProgress(qint64, qint64);
95
void downloadFinished(download*);
96
void allDownloadsFinished();
97
void progressChanged(qint64 bytesReceived, qint64 bytesTotal);
100
#endif // HTTP_HANDLER_H