Marble

PluginManager.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2006-2008 Torsten Rahn <tackat@kde.org>
4// SPDX-FileCopyrightText: 2009 Jens-Michael Hoffmann <jensmh@gmx.de>
5//
6
7#ifndef MARBLE_PLUGINMANAGER_H
8#define MARBLE_PLUGINMANAGER_H
9
10#include "marble_export.h"
11#include <QList>
12#include <QObject>
13
14namespace Marble
15{
16
17class RenderPlugin;
19class PluginManagerPrivate;
24
25/**
26 * @short The class that handles Marble's plugins.
27 *
28 * Ownership policy for plugins:
29 *
30 * On every invocation of createNetworkPlugins and
31 * createFloatItems the PluginManager creates new objects and transfers
32 * ownership to the calling site. In order to create
33 * the objects, the PluginManager internally has a list of the plugins
34 * which are owned by the PluginManager and destroyed by it.
35 *
36 */
37
38class MARBLE_EXPORT PluginManager : public QObject
39{
41
42public:
43 explicit PluginManager(QObject *parent = nullptr);
44
45 ~PluginManager() override;
46
47 /**
48 * @brief Returns all available RenderPlugins.
49 *
50 * Ownership of the items remains in PluginManager.
51 * In order to use the RenderPlugins, first create new instances using
52 * RenderPlugin::newInstance().
53 */
55
56 /**
57 * @brief Add a RenderPlugin manually to the list of known plugins. Normally you
58 * don't need to call this method since all plugins are loaded automatically.
59 * @param plugin The plugin to add. Ownership retains with the caller.
60 */
61 void addRenderPlugin(const RenderPlugin *plugin);
62
63 /**
64 * @brief Returns all available PositionProviderPlugins.
65 *
66 * Ownership of the items remains in PluginManager.
67 * In order to use the PositionProviderPlugins, first create new instances using
68 * PositionProviderPlugin::newInstance().
69 */
71
72 /**
73 * @brief Add a PositionProviderPlugin manually to the list of known plugins. Normally you
74 * don't need to call this method since all plugins are loaded automatically.
75 * @param plugin The plugin to add. Ownership retains with the caller.
76 */
78
79 /**
80 * Returns all search runner plugins.
81 * @note: Runner plugins are owned by the PluginManager, do not delete them.
82 */
84
85 /**
86 * @brief Add a SearchRunnerPlugin manually to the list of known plugins. Normally you
87 * don't need to call this method since all plugins are loaded automatically.
88 * @param plugin The plugin to add. Ownership retains with the caller.
89 */
90 void addSearchRunnerPlugin(const SearchRunnerPlugin *plugin);
91
92 /**
93 * Returns all reverse geocoding runner plugins.
94 * @note: The runner plugins are owned by the PluginManager, do not delete them.
95 */
97
98 /**
99 * @brief Add a ReverseGeocodingRunnerPlugin manually to the list of known plugins. Normally you
100 * don't need to call this method since all plugins are loaded automatically.
101 * @param plugin The plugin to add. Ownership retains with the caller.
102 */
104
105 /**
106 * Returns all routing runner plugins.
107 * @note: The runner plugins are owned by the PluginManager, do not delete them.
108 */
110
111 /**
112 * @brief Add a RoutingRunnerPlugin manually to the list of known plugins. Normally you
113 * don't need to call this method since all plugins are loaded automatically.
114 * @param plugin The plugin to add. Ownership retains with the caller.
115 */
117
118 /**
119 * Returns all parse runner plugins.
120 * @note: The runner plugins are owned by the PluginManager, do not delete them.
121 */
123
124 /**
125 * @brief Add a ParseRunnerPlugin manually to the list of known plugins. Normally you
126 * don't need to call this method since all plugins are loaded automatically.
127 * @param plugin The plugin to add. Ownership retains with the caller.
128 */
129 void addParseRunnerPlugin(const ParseRunnerPlugin *plugin);
130
131 /**
132 * @brief blacklistPlugin Prevent that a plugin is loaded from the given filename
133 * @param filename The name of the file (excluding prefix and file extension) to blacklist. E.g.
134 * to ignore "libWikipedia.so" on Linux and "Wikipedia.dll" on Windows, pass "Wikipedia"
135 */
136 static void blacklistPlugin(const QString &filename);
137
138 /**
139 * @brief whitelistPlugin Add a plugin to the whitelist of plugins. If the whitelist is not
140 * empty, only whitelisted plugins are loaded. If a plugin is both whitelisted and blacklisted,
141 * it will not be loaded
142 * @param filename The name of the file (excluding prefix and file extension) to whitelist. E.g.
143 * to ignore "libWikipedia.so" on Linux and "Wikipedia.dll" on Windows, pass "Wikipedia"
144 */
145 static void whitelistPlugin(const QString &filename);
146
148 void renderPluginsChanged();
149
150 void positionProviderPluginsChanged();
151
152 void searchRunnerPluginsChanged();
153
154 void reverseGeocodingRunnerPluginsChanged();
155
156 void routingRunnerPluginsChanged();
157
158 void parseRunnerPluginsChanged();
159
160private:
161 Q_DISABLE_COPY(PluginManager)
162
163#ifdef Q_OS_ANDROID
164 void installPluginsFromAssets() const;
165#endif
166
167 PluginManagerPrivate *const d;
168};
169
170}
171
172#endif
A plugin for Marble to execute a parsing task.
static void blacklistPlugin(const QString &filename)
blacklistPlugin Prevent that a plugin is loaded from the given filename
void addParseRunnerPlugin(const ParseRunnerPlugin *plugin)
Add a ParseRunnerPlugin manually to the list of known plugins.
QList< const ParseRunnerPlugin * > parsingRunnerPlugins() const
Returns all parse runner plugins.
QList< const ReverseGeocodingRunnerPlugin * > reverseGeocodingRunnerPlugins() const
Returns all reverse geocoding runner plugins.
void addRenderPlugin(const RenderPlugin *plugin)
Add a RenderPlugin manually to the list of known plugins.
static void whitelistPlugin(const QString &filename)
whitelistPlugin Add a plugin to the whitelist of plugins.
void addPositionProviderPlugin(const PositionProviderPlugin *plugin)
Add a PositionProviderPlugin manually to the list of known plugins.
void addReverseGeocodingRunnerPlugin(const ReverseGeocodingRunnerPlugin *plugin)
Add a ReverseGeocodingRunnerPlugin manually to the list of known plugins.
void addRoutingRunnerPlugin(RoutingRunnerPlugin *plugin)
Add a RoutingRunnerPlugin manually to the list of known plugins.
QList< const PositionProviderPlugin * > positionProviderPlugins() const
Returns all available PositionProviderPlugins.
void addSearchRunnerPlugin(const SearchRunnerPlugin *plugin)
Add a SearchRunnerPlugin manually to the list of known plugins.
QList< const SearchRunnerPlugin * > searchRunnerPlugins() const
Returns all search runner plugins.
QList< RoutingRunnerPlugin * > routingRunnerPlugins() const
Returns all routing runner plugins.
QList< const RenderPlugin * > renderPlugins() const
Returns all available RenderPlugins.
The abstract class that provides position information.
The abstract class that creates a renderable item.
A plugin for Marble to execute a reverse geocoding task.
A plugin for Marble to execute a routing task.
A plugin for Marble to execute a placemark search.
Binds a QML item to a specific geodetic location in screen coordinates.
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:52:10 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.