filemanager.h
00001 /********************************************************************** 00002 ** Copyright (C) 2000 Trolltech AS. All rights reserved. 00003 ** 00004 ** This file is part of Qtopia Environment. 00005 ** 00006 ** This file may be distributed and/or modified under the terms of the 00007 ** GNU General Public License version 2 as published by the Free Software 00008 ** Foundation and appearing in the file LICENSE.GPL included in the 00009 ** packaging of this file. 00010 ** 00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 ** 00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00015 ** 00016 ** Contact info@trolltech.com if any conditions of this licensing are 00017 ** not clear to you. 00018 ** 00019 **********************************************************************/ 00020 #ifndef FILEMANAGER_H 00021 #define FILEMANAGER_H 00022 00023 #include <qstring.h> 00024 #include <qstringlist.h> 00025 00026 class AppLnk; 00027 class DocLnk; 00028 class FileManagerPrivate; 00029 00030 class FileManager 00031 { 00032 public: 00033 FileManager(); 00034 ~FileManager(); 00035 00036 bool saveFile( const DocLnk&, const QByteArray &data ); 00037 bool saveFile( const DocLnk&, const QString &text ); 00038 bool loadFile( const DocLnk&, QByteArray &data ); 00039 bool loadFile( const DocLnk&, QString &text ); 00040 bool copyFile( const AppLnk &src, const AppLnk &dest ); 00041 bool copyFile( const QString & src, const QString & dest ); 00042 bool renameFile( const QString &, const QString &); 00043 00044 // The caller must delete the return values. 00045 QIODevice* openFile( const DocLnk& ); 00046 QIODevice* saveFile( const DocLnk& ); 00047 00048 bool exists( const DocLnk& ); 00049 00050 protected: 00051 bool ensurePathExists( const QString &fn ); 00052 00053 private: 00054 FileManagerPrivate *d; 00055 }; 00056 00057 00058 #endif
