• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

  • tdeio
  • tdeio
kfilterbase.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 David Faure <faure@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef __kfilterbase__h
20 #define __kfilterbase__h
21 
22 #include <tqobject.h>
23 #include <tqstring.h>
24 
25 #include <tdelibs_export.h>
26 
27 #ifdef TQ_WS_WIN
28 #undef ERROR //avoid conflicts
29 #endif
30 
31 class TQIODevice;
32 
38 class TDEIO_EXPORT KFilterBase : public TQObject // needs to inherit TQObject for KLibFactory::create
39 {
40  TQ_OBJECT
41 public:
42  KFilterBase();
43  virtual ~KFilterBase();
44 
50  void setDevice( TQIODevice * dev, bool autodelete = false );
51  // Note that this isn't in the constructor, because of KLibFactory::create,
52  // but it should be called before using the filterbase !
53 
58  TQIODevice * device() { return m_dev; }
60  virtual void init( int mode ) = 0;
62  virtual int mode() const = 0;
64  virtual void terminate() {}
66  virtual void reset() {}
68  virtual bool readHeader() = 0;
70  virtual bool writeHeader( const TQCString & filename ) = 0;
72  virtual void setOutBuffer( char * data, uint maxlen ) = 0;
74  virtual void setInBuffer( const char * data, uint size ) = 0;
76  virtual bool inBufferEmpty() const { return inBufferAvailable() == 0; }
78  virtual int inBufferAvailable() const = 0;
80  virtual bool outBufferFull() const { return outBufferAvailable() == 0; }
82  virtual int outBufferAvailable() const = 0;
83 
85  enum Result { OK, END, ERROR };
87  virtual Result uncompress() = 0;
89  virtual Result compress( bool finish ) = 0;
90 
97  static KFilterBase * findFilterByFileName( const TQString & fileName );
98 
105  static KFilterBase * findFilterByMimeType( const TQString & mimeType );
106 
107 protected:
108  TQIODevice * m_dev;
109  bool m_bAutoDel;
110 protected:
111  virtual void virtual_hook( int id, void* data );
112 private:
113  class KFilterBasePrivate;
114 };
115 
116 #endif
KFilterBase
This is the base class for compression filters such as gzip and bzip2.
Definition: kfilterbase.h:39
KFilterBase::device
TQIODevice * device()
Returns the device on which the filter will work.
Definition: kfilterbase.h:58

tdeio/tdeio

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

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.9.1
This website is maintained by Timothy Pearson.