]> Shamusworld >> Repos - architektonas/blob - src/base/filterinterface.h
Removed unnecessary RS_ prefix from classes and whatnot.
[architektonas] / src / base / filterinterface.h
1 #ifndef __FILTERINTERFACE_H__
2 #define __FILTERINTERFACE_H__
3
4 #include <QtCore>
5 #include "drawing.h"
6
7 /**
8  * This is the interface that must be implemented for all
9  * format filter classes. The FileIO class
10  * uses the methods defined in here to interact with the format
11  * filter classes.
12  *
13  * @author Andrew Mustun
14  */
15 class FilterInterface
16 {
17         public:
18                 /**
19                 * Constructor.
20                 */
21                 FilterInterface();
22                 virtual ~FilterInterface();
23
24                 virtual bool canImport(RS2::FormatType t);
25                 virtual bool canExport(RS2::FormatType t);
26
27                 /**
28                 * The implementation of this method in a inherited format
29                 * class should read a file from disk and put the entities
30                 * into the current entity container.
31                 */
32                 virtual bool fileImport(Drawing & g, const QString & file, RS2::FormatType type) = 0;
33
34                 /**
35                 * The implementation of this method in a inherited format
36                 * class should write the entities in the current entity container
37                 * to a file on the disk.
38                 */
39                 virtual bool fileExport(Drawing & g, const QString & file, RS2::FormatType type) = 0;
40
41         protected:
42                 void addImportFormat(RS2::FormatType type);
43                 void addExportFormat(RS2::FormatType type);
44
45         protected:
46                 //! Pointer to the graphic we currently operate on.
47                 //Drawing* graphic;
48
49                 //! Vector of file extensions this filter can import.
50 //              Q3ValueList<RS2::FormatType> importFormats;
51                 QList<RS2::FormatType> importFormats;
52
53                 //! Vector of file extensions this filter can export.
54 //              Q3ValueList<RS2::FormatType> exportFormats;
55                 QList<RS2::FormatType> exportFormats;
56 };
57
58 #endif