(hopefully) fix some broken download stuff I introduced yesterday.
[Rockbox.git] / rbutil / rbutilqt / httpget.h
blobfe8ee3fc520efd47aa2b4749eccaa7d0c37f677b
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);
42 QByteArray readAll(void);
44 public slots:
45 void abort(void);
47 signals:
48 void done(bool);
49 void dataReadProgress(int, int);
50 void requestFinished(int, bool);
52 private slots:
53 void httpDone(bool error);
54 void httpProgress(int, int);
55 void httpFinished(int, bool);
56 void httpResponseHeader(const QHttpResponseHeader&);
57 void httpState(int);
58 void httpStarted(int);
60 private:
61 QHttp http;
62 QFile *outputFile;
63 int response;
64 int getRequest;
65 QByteArray dataBuffer;
66 bool outputToBuffer;
69 #endif