QCAD
Open Source 2D CAD
RPluginLoader.h
Go to the documentation of this file.
1 
20 #ifndef RPLUGINLOADER_H
21 #define RPLUGINLOADER_H
22 
23 #include "core_global.h"
24 
25 #include <QList>
26 #include <QMetaType>
27 #include <QScriptEngine>
28 
29 #include "RPluginInterface.h"
30 #include "RPluginInfo.h"
31 
39 public:
40  static QString getPluginSuffix();
41  static QStringList getPluginFiles();
42  static void loadPlugins(bool init);
43  static void unloadPlugins();
44  static void loadPlugin(QObject* plugin, bool init, const QString& fileName = QString(), const QString& errorString = QString());
45  static void unloadPlugin(const QString& fileName, bool remove = false);
46  static void unloadPlugin(const QObject* plugin, bool remove = false);
47 
48  static void postInitPlugins(RPluginInterface::InitStatus status);
49 
53  static void postInitPlugin(QObject* plugin, RPluginInterface::InitStatus status);
54 
58  static void initScriptExtensions(QScriptEngine& engine);
59 
63  static void initScriptExtensions(QObject* plugin, QScriptEngine& engine);
64 
65  static int countPlugins() {
66  return pluginsInfo.count();
67  }
68 
69  static RPluginInfo getPluginInfo(int i);
70  static RPluginInfo getPluginInfo(const QString& id);
71 
72  static QString getPluginsPath();
73  static bool hasPlugin(const QString& id);
74 
75 private:
76  static QList<RPluginInfo> pluginsInfo;
77  static QStringList pluginFiles;
78 };
79 
81 
82 #endif
static QList< RPluginInfo > pluginsInfo
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RPluginLoader.h:76
static QStringList pluginFiles
Definition: RPluginLoader.h:77
Information about a plugin.
Definition: RPluginInfo.h:42
#define QCADCORE_EXPORT
Definition: core_global.h:10
void hasPlugin(void name)
Definition: library.js:124
Q_DECLARE_METATYPE(RMath *)
InitStatus
Definition: RPluginInterface.h:41
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RPluginLoader.h:38
void init(void basePath)
Definition: AddBlockInit.js:2
static int countPlugins()
Definition: RPluginLoader.h:65