• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDECore

kfilterbase.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 
00019 #ifndef __kfilterbase__h
00020 #define __kfilterbase__h
00021 
00022 #include <kdecore_export.h>
00023 
00024 #include <QtCore/QObject>
00025 #include <QtCore/QString>
00026 
00027 class QIODevice;
00028 
00035 class KDECORE_EXPORT KFilterBase
00036 {
00037 public:
00038     KFilterBase();
00039     virtual ~KFilterBase();
00040 
00046     void setDevice( QIODevice * dev, bool autodelete = false );
00047     // Note that this isn't in the constructor, because of KLibFactory::create,
00048     // but it should be called before using the filterbase !
00049 
00054     QIODevice * device();
00056     virtual void init( int mode ) = 0;
00058     virtual int mode() const = 0;
00060     virtual void terminate();
00062     virtual void reset();
00064     virtual bool readHeader() = 0;
00066     virtual bool writeHeader( const QByteArray & filename ) = 0;
00068     virtual void setOutBuffer( char * data, uint maxlen ) = 0;
00070     virtual void setInBuffer( const char * data, uint size ) = 0;
00072     virtual bool inBufferEmpty() const;
00074     virtual int  inBufferAvailable() const = 0;
00076     virtual bool outBufferFull() const;
00078     virtual int  outBufferAvailable() const = 0;
00079 
00081     enum Result { Ok, End, Error };
00083     virtual Result uncompress() = 0;
00085     virtual Result compress( bool finish ) = 0;
00086 
00093     static KFilterBase * findFilterByFileName( const QString & fileName );
00094 
00101     static KFilterBase * findFilterByMimeType( const QString & mimeType );
00102 
00103 protected:
00104     QIODevice * m_dev;
00105     bool m_bAutoDel;
00106 protected:
00110     virtual void virtual_hook( int id, void* data );
00111 private:
00112     Q_DISABLE_COPY( KFilterBase )
00113     class Private;
00114     Private * const d;
00115 };
00116 
00117 #endif

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal