]> Shamusworld >> Repos - architektonas/blob - src/base/rs_fileio.h
Fixed Library Browser...
[architektonas] / src / base / rs_fileio.h
1 #ifndef RS_FILEIO_H
2 #define RS_FILEIO_H
3
4 #include <QtCore>
5 #include "rs.h"
6
7 #define RS_FILEIO RS_FileIO::instance()
8
9 class Drawing;
10 class RS_FilterInterface;
11
12 /**
13  * API Class for importing files.
14  *
15  * @author Andrew Mustun
16  */
17 class RS_FileIO
18 {
19         protected:
20                 RS_FileIO();
21
22         public:
23                 static RS_FileIO * instance();
24                 void registerFilter(RS_FilterInterface * f);
25                 QList<RS_FilterInterface *> getFilterList();
26                 RS_FilterInterface * getImportFilter(RS2::FormatType t);
27                 RS_FilterInterface * getExportFilter(RS2::FormatType t);
28                 bool fileImport(Drawing & graphic, const QString & file,
29                         RS2::FormatType type = RS2::FormatUnknown);
30                 bool fileExport(Drawing & graphic, const QString & file,
31                         RS2::FormatType type = RS2::FormatUnknown);
32                 RS2::FormatType detectFormat(const QString & file);
33
34         protected:
35                 static RS_FileIO * uniqueInstance;
36                 QList<RS_FilterInterface *> filterList;
37 };
38
39 #endif