00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef OMGWEBPAGEFETCHER_H
00021 #define OMGWEBPAGEFETCHER_H
00022
00023 #include <QObject>
00024 #include <QString>
00025 #include <QUrl>
00026 #include <QHttp>
00027 #include <QHttpResponseHeader>
00034 class OMG_LIB_EXPORT OmgWebPageFetcher : public QObject
00035 {
00036 Q_OBJECT;
00037 public:
00038 OmgWebPageFetcher(QObject *parent=0);
00039 ~OmgWebPageFetcher();
00040 QString url();
00041 QString getPage(QString theUrl);
00042
00043 protected slots:
00044
00045 void slotStateChanged(int state);
00046 void slotResponseHeaderReceived ( const QHttpResponseHeader & resp );
00047 void slotRequestFinished ( int id, bool error );
00048 void slotTimeOut();
00049
00050 signals:
00051 void requestGetFinished(QString);
00052 void statusChanged(QString);
00053 private:
00054 QUrl mQUrl;
00055 int mTimeOut;
00056 QHttp mQHttp;
00057 int mProxyId;
00058 int mHostId;
00059 int mHeaderId;
00060 int mGetId;
00061 QString mRequestQString;
00062 QString mPageContent;
00063 QHttpResponseHeader mQHttpResponseHeader;
00064 bool mBusyFlag;
00065
00066
00067 void requestHeadFinished(int id);
00068 void finish();
00069
00070 };
00071
00072 #endif //OMGWEBPAGEFETCHER