1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 by Dominik Riebeling
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 ****************************************************************************/
29 class HttpGet
: public QObject
34 HttpGet(QObject
*parent
= 0);
36 bool getFile(const QUrl
&url
);
37 void setProxy(const QUrl
&url
);
39 QHttp::Error
error(void);
40 QString
errorString(void);
44 int httpResponse(void);
45 QByteArray
readAll(void);
46 bool isCached() { return cached
; }
47 static void setGlobalCache(const QDir d
) //< set global cache path
48 { m_globalCache
= d
; }
49 static void setGlobalProxy(const QUrl p
) //< set global proxy value
50 { m_globalProxy
= p
; }
57 void dataReadProgress(int, int);
58 void requestFinished(int, bool);
61 void httpDone(bool error
);
62 void httpProgress(int, int);
63 void httpFinished(int, bool);
64 void httpResponseHeader(const QHttpResponseHeader
&);
66 void httpStarted(int);
69 bool initializeCache(const QDir
&);
70 QHttp http
; //< download object
72 int response
; //< http response
74 QByteArray dataBuffer
;
82 static QDir m_globalCache
; //< global cache path value
83 static QUrl m_globalProxy
; //< global proxy value