First stab at porting rbutil to Qt4. Currently only installing a current or archived...
[Rockbox.git] / rbutil / rbutilqt / httpget.h
blob1a86e1d4ce4557b4d3a56b59e89f58cbf4e6154e
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
9 * Copyright (C) 2007 by Dominik Riebeling
10 * $Id:$
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
21 #ifndef HTTPGET_H
22 #define HTTPGET_H
24 #include <QFile>
25 #include <QHttp>
27 class QUrl;
29 class HttpGet : public QObject
31 Q_OBJECT
33 public:
34 HttpGet(QObject *parent = 0);
36 bool getFile(const QUrl &url);
37 void setProxy(const QUrl &url);
38 QHttp::Error error(void);
39 QString errorString(void);
40 void setFile(QFile*);
41 int httpResponse(void);
43 public slots:
44 void abort(void);
46 signals:
47 void done(bool);
48 void dataReadProgress(int, int);
49 void requestFinished(int, bool);
51 private slots:
52 void httpDone(bool error);
53 void httpProgress(int, int);
54 void httpFinished(int, bool);
55 void httpResponseHeader(const QHttpResponseHeader&);
57 private:
58 QHttp http;
59 QFile *outputFile;
60 int response;
63 #endif