Blokkal
an Extendable KDE Blogging Client
SourceForge.net Logo

blokkalfileengine.h

00001 /***************************************************************************
00002  *   Copyright (C) 2007 by Martin Mueller                           *
00003  *   orvio@orvio.de                                                        *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef BLOKKAL_FILEENGINE_H
00021 #define BLOKKAL_FILEENGINE_H
00022 
00023 #include <QtCore/QAbstractFileEngine>
00024 #include <QtCore/QAbstractFileEngineHandler>
00025 
00026 #include "blokkal_export.h"
00027 
00028 namespace Blokkal {
00035 class BLOKKAL_EXPORT FileEngineHandler : public QAbstractFileEngineHandler {
00036 public:
00040         virtual QAbstractFileEngine * create( const QString & fileName ) const;
00041 };
00042 
00058 class BLOKKAL_EXPORT FileEngine : public QAbstractFileEngine {
00059 public:
00060         virtual ~FileEngine( void );
00061 
00062         virtual bool caseSensitive( void ) const;
00063         virtual bool close( void );
00064         virtual bool copy( const QString & newName );
00065         virtual QStringList entryList( QDir::Filters filters, const QStringList & filterNames ) const;
00066         virtual FileFlags fileFlags( FileFlags type = FileInfoAll ) const;
00067         virtual QString fileName( FileName file = DefaultName ) const;
00068         virtual QDateTime fileTime( FileTime time ) const;
00069         virtual bool isRelativePath( void ) const;
00070         virtual bool isSequential( void ) const;
00071         virtual bool mkdir( const QString & dirName, bool createParentDirectories ) const;
00072         virtual bool open( QIODevice::OpenMode mode );
00073         virtual QString owner( FileOwner owner ) const;
00074         virtual unsigned int ownerId( FileOwner owner ) const;
00075         virtual qint64 pos( void ) const;
00076         virtual qint64 read( char * data, qint64 maxlen );
00077         virtual qint64 readLine( char * data, qint64 maxlen );
00078         virtual bool remove( void );
00079         virtual bool rename( const QString & newName );
00080         virtual bool rmdir( const QString & dirName, bool recurseParentDirectories ) const;
00081         virtual bool seek( qint64 offset );
00082         virtual void setFileName( const QString & file );
00083         virtual bool setPermissions( uint perms );
00084         virtual bool setSize( qint64 size );
00085         virtual qint64 size( void ) const;
00086         virtual qint64 write( const char * data, qint64 len );
00087 
00088 
00089 private:
00090         FileEngine( void );
00091         friend class FileEngineHandler;
00092         
00093         class Private;
00094         Private * const d;
00095 };
00096 
00097 }
00098 
00099 #endif