kfilterdev.h
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2000 David Faure <faure@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 */ 00018 #ifndef __kfilterdev_h 00019 #define __kfilterdev_h 00020 00021 #include <tqiodevice.h> 00022 #include <tqstring.h> 00023 #include <kdelibs_export.h> 00024 00025 class TQFile; 00026 class KFilterBase; 00027 00036 class KIO_EXPORT KFilterDev : public TQIODevice 00037 { 00038 public: 00045 KFilterDev( KFilterBase * filter, bool autoDeleteFilterBase = false ); 00050 virtual ~KFilterDev(); 00051 00056 #ifdef qdoc 00057 #else 00058 virtual bool open( TQ_OpenMode mode ); 00059 #endif 00060 00064 virtual void close(); 00065 virtual void flush(); 00066 00072 void setOrigFileName( const TQCString & fileName ); 00073 00080 void setSkipHeaders(); 00081 00082 // Not implemented 00083 #ifdef qdoc 00084 #else 00085 #ifdef USE_QT4 00086 virtual qint64 size() const; 00087 #else // USE_QT4 00088 virtual TQIODevice::Offset size() const; 00089 #endif // USE_QT4 00090 #endif 00091 00092 virtual TQIODevice::Offset at() const; 00096 virtual bool at( TQIODevice::Offset ); 00097 00098 virtual bool atEnd() const; 00099 00100 #ifdef qdoc 00101 #else 00102 virtual TQT_TQIO_LONG tqreadBlock( char *data, TQT_TQIO_ULONG maxlen ); 00103 virtual TQT_TQIO_LONG tqwriteBlock( const char *data, TQT_TQIO_ULONG len ); 00104 #endif 00105 //int readLine( char *data, uint maxlen ); 00106 00107 virtual int getch(); 00108 virtual int putch( int ); 00109 virtual int ungetch( int ); 00110 00111 #ifdef KDE_NO_COMPAT 00112 private: 00113 #endif 00114 00121 static TQIODevice* createFilterDevice(KFilterBase* base, TQFile* file) KDE_DEPRECATED; 00122 public: 00123 00150 static TQIODevice * deviceForFile( const TQString & fileName, const TQString & mimetype = TQString::null, 00151 bool forceFilter = false ); 00152 00171 static TQIODevice * device( TQIODevice* inDevice, const TQString & mimetype); 00172 // BIC: merge with device() method below, using default value for autoDeleteInDevice 00173 00194 static TQIODevice * device( TQIODevice* inDevice, const TQString & mimetype, bool autoDeleteInDevice ); 00195 00196 private: 00197 KFilterBase *filter; 00198 class KFilterDevPrivate; 00199 KFilterDevPrivate * d; 00200 }; 00201 00202 00203 #endif 00204