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