KDECore
kfilterdev.h
Go to the documentation of this file.
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 <kdecore_export.h> 00022 #include <QtCore/QIODevice> 00023 #include <QtCore/QString> 00024 00025 class QFile; 00026 class KFilterBase; 00027 00036 class KDECORE_EXPORT KFilterDev : public QIODevice 00037 { 00038 public: 00043 virtual ~KFilterDev(); 00044 00049 virtual bool open( QIODevice::OpenMode mode ); 00054 virtual void close(); 00055 00061 void setOrigFileName( const QByteArray & fileName ); 00062 00068 void setSkipHeaders(); 00069 00073 virtual bool seek( qint64 ); 00074 00075 virtual bool atEnd() const; 00076 00079 //virtual bool isSequential() const { return true; } 00080 00081 public: 00082 00083 00084 // KDE4 TODO: turn those static methods into constructors 00085 00112 static QIODevice * deviceForFile( const QString & fileName, const QString & mimetype = QString(), 00113 bool forceFilter = false ); 00114 00133 static QIODevice * device( QIODevice* inDevice, const QString & mimetype, bool autoDeleteInDevice = true ); 00134 00135 protected: 00136 virtual qint64 readData( char *data, qint64 maxlen ); 00137 virtual qint64 writeData( const char *data, qint64 len ); 00138 00139 private: 00146 explicit KFilterDev( KFilterBase * filter, bool autoDeleteFilterBase = false ); 00147 private: 00148 class Private; 00149 Private* const d; 00150 }; 00151 00152 00153 #endif
KDE 4.6 API Reference