]> Shamusworld >> Repos - architektonas/blob - src/base/fileio.h
In the middle of chasing down MDI not activating bug, renaming of Graphic to
[architektonas] / src / base / fileio.h
1 #ifndef __FILEIO_H__
2 #define __FILEIO_H__
3
4 #include <QtCore>
5 #include "enums.h"
6
7 #define FILEIO FileIO::instance()
8
9 class Drawing;
10 class FilterInterface;
11
12 /**
13  * API Class for importing files.
14  *
15  * @author James Hammons
16  * @author Andrew Mustun
17  */
18 class FileIO
19 {
20         protected:
21                 FileIO();
22
23         public:
24                 static FileIO * instance();
25                 void registerFilter(FilterInterface * f);
26                 QList<FilterInterface *> getFilterList();
27                 FilterInterface * getImportFilter(RS2::FormatType t);
28                 FilterInterface * getExportFilter(RS2::FormatType t);
29                 bool fileImport(Drawing & dwg, const QString & file,
30                         RS2::FormatType type = RS2::FormatUnknown);
31                 bool fileExport(Drawing & dwg, const QString & file,
32                         RS2::FormatType type = RS2::FormatUnknown);
33                 RS2::FormatType detectFormat(const QString & file);
34
35         protected:
36                 static FileIO * uniqueInstance;
37                 QList<FilterInterface *> filterList;
38 };
39
40 #endif  // __FILEIO_H__