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