00001
00002
00003 #ifndef _IPTV_URL_FETCHER_H_
00004 #define _IPTV_URL_FETCHER_H_
00005
00006
00007 #include <vector>
00008 using namespace std;
00009
00010
00011 #include <qnetworkprotocol.h>
00012 #include <qcstring.h>
00013 #include <qstring.h>
00014
00015 class QNetworkOperation;
00016 class QUrlOperator;
00017
00018 class URLFetcher : public QObject
00019 {
00020 Q_OBJECT
00021
00022 private:
00023 URLFetcher(const QString &url);
00024 ~URLFetcher() {}
00025
00026 public:
00027 static QString FetchData(const QString &url, bool inQtThread);
00028
00029 public slots:
00030 void deleteLater(void);
00031
00032 private slots:
00033 void Finished(QNetworkOperation *op);
00034 void Data(const QByteArray &data, QNetworkOperation *op);
00035
00036 private:
00037 QUrlOperator *op;
00038 QNetworkProtocol::State state;
00039 vector<unsigned char> buf;
00040 };
00041
00042 #endif // _IPTV_URL_FETCHER_H_