Make encoder name conversion functions static to the base class.
[Rockbox.git] / rbutil / rbutilqt / httpget.h
blob4a3d811e05523df574b797fb770d823c3ce22ec1
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 <QtCore>
25 #include <QtNetwork>
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 void setCache(QDir);
42 void setCache(bool);
43 int httpResponse(void);
44 QByteArray readAll(void);
45 bool isCached() { return cached; }
47 public slots:
48 void abort(void);
50 signals:
51 void done(bool);
52 void dataReadProgress(int, int);
53 void requestFinished(int, bool);
55 private slots:
56 void httpDone(bool error);
57 void httpProgress(int, int);
58 void httpFinished(int, bool);
59 void httpResponseHeader(const QHttpResponseHeader&);
60 void httpState(int);
61 void httpStarted(int);
63 private:
64 QHttp http;
65 QFile *outputFile;
66 int response;
67 int getRequest;
68 QByteArray dataBuffer;
69 bool outputToBuffer;
70 QString query;
71 bool m_usecache;
72 QDir m_cachedir;
73 QString cachefile;
74 bool cached;
77 #endif