Debian Codegraph @

avogadro/qtplugins/pluginfactory.h

raw
1 /******************************************************************************
2 This source file is part of the Avogadro project.
3 This source code is released under the 3-Clause BSD License, (see "LICENSE").
4 ******************************************************************************/
5
6 #ifndef AVOGADRO_QTPLUGINS_PLUGINFACTORY_H
7 #define AVOGADRO_QTPLUGINS_PLUGINFACTORY_H
8
9 #include <QtCore/QObject>
10 #include <QtCore/QString>
11
12 namespace Avogadro::QtPlugins {
13
14 /**
15 * @class PluginFactory pluginfactory.h <avogadro/qtplugins/pluginfactory.h>
16 * @brief The base class for plugin factories in Avogadro.
17 */
18 template <typename T>
19 class PluginFactory
20 {
21 public:
22 virtual ~PluginFactory() {}
23
24 virtual T* createInstance(QObject* parent = nullptr) = 0;
25 virtual QString identifier() const = 0;
26 virtual QString description() const = 0;
27 };
28
29 } // namespace Avogadro::QtPlugins
30
31 #endif /* AVOGADRO_QTPLUGINS_PLUGINFACTORY_H */