Krita Source Code Documentation
Loading...
Searching...
No Matches
KoPluginLoader.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2016 Boudewijn Rempt (boud@valdyas.org)
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#ifndef KO_PLUGIN_LOADER_H
8#define KO_PLUGIN_LOADER_H
9
10#include <QObject>
11#include <QStringList>
12
13#include "kritaplugin_export.h"
14
15class KPluginFactory;
16
17#ifndef Q_MOC_RUN
52#endif
53class KRITAPLUGIN_EXPORT KoPluginLoader : public QObject
54{
55
56 Q_OBJECT
57
58public:
65 PluginsConfig() : group(nullptr), blacklist(nullptr) {}
73 const char * group {nullptr };
75 const char * blacklist {nullptr};
76
77 inline bool isValid() const {
78 return group && blacklist;
79 }
80 };
81
82 ~KoPluginLoader() override;
83
88 static KoPluginLoader * instance();
89
103 void load(const QString & serviceType, const PluginsConfig &config = PluginsConfig(), QObject* owner = 0, bool cache = true);
104
130 KPluginFactory* loadSinglePlugin(const std::vector<std::pair<QString, QString>> &predicates, const QString & serviceType);
131
132 /*
133 * A conveniency override for \ref loadSinglePlugin() that accepts only one predicate
134 */
135 KPluginFactory* loadSinglePlugin(const std::pair<QString, QString> &predicates, const QString & serviceType);
136
137 /*
138 * A conveniency override for \ref loadSinglePlugin() that checks of Id of the plugin
139 */
140 KPluginFactory* loadSinglePlugin(const QString &id, const QString & serviceType);
141
142public:
144 // TODO: turn KoPluginLoader into namespace and do not expose object at all
146private:
149
150private:
151 class Private;
152 Private * const d;
153};
154
155#endif // KO_PLUGIN_LOADER_H
PythonPluginManager * instance
Private *const d
KoPluginLoader(const KoPluginLoader &)
KoPluginLoader operator=(const KoPluginLoader &)