file.h
author insilmaril
Mon Oct 22 09:50:03 2007 +0000 (2007-10-22)
changeset 606 84c73902f727
parent 522 ec0f18c8c0fa
child 607 53c66cb9f5bd
permissions -rw-r--r--
Various patches: Better windows support, branch sorting, Freedesktop support
     1 #ifndef FILE_H
     2 #define FILE_H
     3 
     4 #include <QDir>
     5 
     6 enum LoadMode {NewMap,ImportAdd,ImportReplace};
     7 enum SaveMode {PartOfMap,CompleteMap,UndoCommand};
     8 enum FileType {VymMap, FreemindMap};
     9 enum ErrorCode {success,aborted,nozip};
    10 
    11 
    12 /////////////////////////////////////////////////////////////////////////////
    13 QString maskPath (QString );
    14 QString convertToRel (const QString &,const QString &);
    15 
    16 QString browseDirectory (QWidget *parent=NULL, const QString &caption="");
    17 bool reallyWriteDirectory(const QString &dir);
    18 
    19 QString makeUniqueDir (bool &,QString);
    20 void removeDir(QDir);
    21 void copyDir (QDir src,QDir dst);
    22 void makeSubDirs (const QString &);
    23 ErrorCode zipDir (const QDir &,const QString&);
    24 ErrorCode unzipDir (const QDir &,const QString&);
    25 bool loadStringFromDisk (const QString &, QString &);
    26 bool saveStringToDisk (const QString &, const QString &s);
    27 
    28 /////////////////////////////////////////////////////////////////////////////
    29 #include <QLabel>
    30 #include <q3filedialog.h>
    31 #include <QPixmap>
    32 
    33 class ImagePreview : public QLabel, public Q3FilePreview
    34 {
    35 public:
    36     ImagePreview( QWidget * );
    37     void previewUrl( const Q3Url & );
    38 protected:
    39 	Q3FileDialog *fdia;
    40 };
    41 
    42 
    43 //////////////////////////////////////////////////////////
    44 // Helper function to select image format while in SaveDialogs
    45 
    46 class ImageIO
    47 {
    48 public:
    49 	ImageIO ();
    50 	QStringList getFilters();
    51 	QString getType ( QString );
    52 
    53 private:	
    54 	QStringList imageFilters;
    55 	QStringList imageTypes;
    56 };
    57 
    58 #endif