Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

omgwebpagefetcher.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Tim Sutton   *
00003  *   tim@linfiniti.com   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
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   //private methods
00066 
00067   void requestHeadFinished(int id);
00068   void finish();
00069 
00070 };
00071 
00072 #endif //OMGWEBPAGEFETCHER

Generated on Mon Apr 28 15:09:23 2008 for openModellerDesktop by  doxygen 1.4.1-20050210