Main Page   Class Hierarchy   Compound List   File List   Compound Members  

channelioformat.h

00001 // -*- c++ -*-
00002 
00003 /*
00004  *
00005  * Copyright (C) 2002 Richard Moore <rich@kde.org>
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public License
00018  * along with this library; see the file COPYING.LIB.  If not, write to
00019  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020  * Boston, MA 02111-1307, USA.
00021  */
00022 
00023 #ifndef CHANNELIOFORMAT_H
00024 #define CHANNELIOFORMAT_H
00025 
00026 #include <qcstring.h>
00027 #include <qptrlist.h>
00028 #include <qstring.h>
00029 
00030 #include <pluginfactory.h>
00031 
00032 class QIODevice;
00033 class KSaveFile;
00034 class ChannelStore;
00035 class QtVision;
00036 
00037 class ChannelIOFormatPrivate;
00038 class ChannelFileMetaInfoPrivate;
00039 
00040 class ChannelFileMetaInfo {
00041         public:
00042                 const QString& name() const { return _name; }
00043                 const QString& norm() const { return _norm; }
00044                 void setName(QString x) { _name = x; }
00045                 void setNorm(QString x) { _norm = x; }
00046 
00047         private:
00048                 QString _name, _norm;
00049                 ChannelFileMetaInfoPrivate *d;
00050 };
00051 
00052 
00058 class ChannelIOFormat
00059 {
00060     friend class PluginFactory;
00061 public:
00065     enum Flags {
00066         FormatRead = 0x1,
00067         FormatWrite = 0x2,
00068         FormatReadWrite = FormatRead | FormatWrite
00069     };
00070 
00071     ChannelIOFormat( const char *name, int flags = FormatReadWrite );
00072     virtual ~ChannelIOFormat() {}
00073 
00077     const char *name() const { return fmtName.data(); }
00078 
00084     bool canRead( const char *fmt=0 ) const;
00085 
00090     bool canWrite( const char *fmt=0 ) const;
00091 
00101     virtual bool handlesFile( const QString& filename, int rflags) const;
00102 
00107     bool load( ChannelStore *store, const QString &filename, const char *fmt);
00108 
00113     bool save( ChannelStore *store, const QString &filename, const char *fmt);
00114 
00119     virtual bool load( ChannelStore *store, QIODevice *file, const char *fmt );
00120 
00125     virtual bool save( ChannelStore *store, QIODevice *file, const char *fmt );
00126 
00130     ChannelFileMetaInfo getMetaInfo( const QString &filename, const char *fmt );
00131     virtual ChannelFileMetaInfo getMetaInfo( QIODevice *file, const char *fmt );
00132 
00133 protected:
00134     PluginDesc _description;
00135     ChannelFileMetaInfo metaInfo;
00136     QtVision *_qtv;
00137 
00138 private:
00139     QCString fmtName;
00140     int flags;
00141     ChannelIOFormatPrivate *d;
00142 };
00143 
00144 typedef QPtrList<ChannelIOFormat> ChannelIOFormatList;
00145 
00146 
00147 #endif // CHANNELIOFORMAT_H

Generated at Thu Jan 30 02:56:02 2003 for QtVision by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001