| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2000-2005 Computer Graphics Systems Group at the 00004 * Hasso-Plattner-Institute (HPI), Potsdam, Germany. 00005 * 00006 * This library is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2.1 of the License, or (at 00009 * your option) any later version. This library is distributed in the hope 00010 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 00011 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Lesser General Public License for more details. You should have received 00013 * a copy of the GNU Lesser+ General Public License along with this library; if 00014 * not, write to the FreeSoftware Foundation, Inc., 59 Temple Place, Suite 330, 00015 * Boston, MA, 02111-1307, USA. 00016 ******************************************************************************/ 00017 00018 // $Id: qthttpfilter.h 6676 2009-03-17 12:26:39Z Amir_Semmo $ 00019 // 00020 // $Log$ 00021 // Revision 1.3 2006/02/06 17:22:01 schmidt 00022 // added progress during request 00023 // 00024 // Revision 1.2 2005/10/06 09:53:18 baumann 00025 // using new impl of MemoryDataResource 00026 // 00027 // Revision 1.1 2005/05/12 12:03:19 baumann 00028 // class QtNetworkReader replaced by new class QtHttpFilter 00029 // 00030 00031 #ifndef VRS_QT_QTHTTPFILTER_H 00032 #define VRS_QT_QTHTTPFILTER_H 00033 00034 #include <vrs/io/datafilter.h> 00035 #include <vrs/io/memorydataresource.h> 00036 #include <vrs/qt3/config.h> 00037 #include <qhttp.h> 00038 #include <vector> 00039 00040 #include <memory> 00041 00042 namespace VRS { 00043 00044 class VRS_QT3_API QtHttpFilter : 00045 public QObject, 00046 public DataFilter 00047 { 00048 Q_OBJECT 00049 public: 00050 VRS_TYPEINFO(QtHttpFilter, DataFilter); 00051 00052 virtual SO<DataResource> filter( 00053 DataResource* resource 00054 ) const; 00055 00056 private slots: 00057 virtual void readyRead(const QHttpResponseHeader& header); 00058 virtual void dataReadProgress(int done, int total); 00059 virtual void done(bool error); 00060 00061 private: 00062 mutable std::auto_ptr<QHttp> m_http; 00063 mutable bool m_finished; 00064 mutable SO<MemoryDataResource> m_data; 00065 mutable int m_totalData; 00066 mutable int m_readData; 00067 00068 }; // class QtHttpFilter 00069 00070 } // namespace VRS 00071 00072 #endif // VRS_QT_QTHTTPFILTER_H