file.h
author insilmaril
Mon Oct 22 09:50:08 2007 +0000 (2007-10-22)
changeset 608 6cdc2e7b1937
parent 568 b44cc0d3ed4a
child 831 25a950c2eb98
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 makeTmpDir (bool &ok, QString prefix);
    20 bool isInTmpDir (QString fn);
    21 QString makeUniqueDir (bool &ok, QString);
    22 void removeDir(QDir);
    23 void copyDir (QDir src,QDir dst);
    24 void makeSubDirs (const QString &);
    25 ErrorCode zipDir (const QDir &,const QString&);
    26 ErrorCode unzipDir (const QDir &,const QString&);
    27 bool loadStringFromDisk (const QString &, QString &);
    28 bool saveStringToDisk (const QString &, const QString &s);
    29 
    30 /////////////////////////////////////////////////////////////////////////////
    31 #include <QLabel>
    32 #include <q3filedialog.h>
    33 #include <QPixmap>
    34 
    35 class ImagePreview : public QLabel, public Q3FilePreview
    36 {
    37 public:
    38     ImagePreview( QWidget * );
    39     void previewUrl( const Q3Url & );
    40 protected:
    41 	Q3FileDialog *fdia;
    42 };
    43 
    44 
    45 //////////////////////////////////////////////////////////
    46 // Helper function to select image format while in SaveDialogs
    47 
    48 class ImageIO
    49 {
    50 public:
    51 	ImageIO ();
    52 	QStringList getFilters();
    53 	QString getType ( QString );
    54 
    55 private:	
    56 	QStringList imageFilters;
    57 	QStringList imageTypes;
    58 };
    59 
    60 #endif