]> Shamusworld >> Repos - architektonas/blob - src/base/fileio.h
Fixed thumbnail rendering in LibraryWidget and DXF detection.
[architektonas] / src / base / fileio.h
1 #ifndef __FILEIO_H__
2 #define __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 James Hammons
16  * @author Andrew Mustun
17  */
18 class RS_FileIO
19 {
20         protected:
21                 RS_FileIO();
22
23         public:
24                 static RS_FileIO * instance();
25                 void registerFilter(RS_FilterInterface * f);
26                 QList<RS_FilterInterface *> getFilterList();
27                 RS_FilterInterface * getImportFilter(RS2::FormatType t);
28                 RS_FilterInterface * getExportFilter(RS2::FormatType t);
29                 bool fileImport(Drawing & graphic, const QString & file,
30                         RS2::FormatType type = RS2::FormatUnknown);
31                 bool fileExport(Drawing & graphic, const QString & file,
32                         RS2::FormatType type = RS2::FormatUnknown);
33                 RS2::FormatType detectFormat(const QString & file);
34
35         protected:
36                 static RS_FileIO * uniqueInstance;
37                 QList<RS_FilterInterface *> filterList;
38 };
39
40 #endif  // __FILEIO_H__