QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RFileImporterRegistry.h
Go to the documentation of this file.
1 #ifndef RFILEIMPORTERREGISTRY_H
2 #define RFILEIMPORTERREGISTRY_H
3 
4 class RFileImporter;
5 class RDocument;
6 class RMessageHandler;
7 class RProgressHandler;
8 
9 #include <QString>
10 #include <QList>
11 #include <QMetaType>
12 #include <QStringList>
13 
14 
25 public:
26  typedef RFileImporter* (*FactoryFunction)(RDocument& document,
27  RMessageHandler* messageHandler, RProgressHandler* progressHandler);
28  typedef bool (*CheckFunction)(const QString&, const QString&);
29 
33  static void registerFileImporter(
36  const QStringList& filters
37  );
38 
39  static void registerFileImporterScript(
40  const QString& scriptFile,
41  const QStringList& filters
42  );
43 
45  const QString& fileName,
46  const QString& nameFilter,
47  RDocument& document,
48  RMessageHandler* messageHandler = NULL,
49  RProgressHandler* progressHandler = NULL
50  );
51 
56  static QStringList getFilterStrings() {
57  return filterStrings;
58  }
59 
60 private:
61  static QList<FactoryFunction> factoryFunctions;
62  static QList<CheckFunction> checkFunctions;
63 
64  static QList<QString> scriptImporters;
65 
66  static QStringList filterStrings;
67 };
68 
70 
71 #endif