KReport

KReportPluginManagerPrivate.h
1/* This file is part of the KDE project
2 Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
3 Copyright (C) 2015 Jarosław Staniek <staniek@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KREPORTPLUGINMANAGERP_H
22#define KREPORTPLUGINMANAGERP_H
23
24#include <QMap>
25#include <QPluginLoader>
26
27#if 0 // needed by lupdate to avoid "Qualifying with unknown namespace/class"
29#endif
30
31class QJsonObject;
35
36//! @internal A single entry for a built-in or dynamic item plugin
38{
39public:
40 //! Used for dynamic plugins.
42
43 //! Used for static plugins.
45
47
48 KReportPluginInterface* plugin();
49
50 void setBuiltIn(bool set);
51
52 void setStatic(bool set);
53
54 const KReportPluginMetaData *metaData() const;
55
56 void setMetaData(const QJsonObject &metaData);
57
58 void setMetaData(QPluginLoader *loader);
59
60private:
61 void setMetaData(KReportPluginMetaData *metaData);
62
63 QPluginLoader *m_loader;
64
65 KReportPluginInterface *m_interface;
66
67 //! Plugin info, owned.
68 KReportPluginMetaData *m_metaData;
69};
70
71//! @internal
72class Q_DECL_HIDDEN KReportPluginManager::Private
73{
74public:
75 explicit Private(KReportPluginManager *qq);
76 ~Private();
77
79 QMap<QString, KReportPluginEntry*> *pluginsByLegacyName();
80
81 //! Add a built-in element plugins
82 template<class PluginClass>
83 void addBuiltInPlugin(const QJsonObject &json);
84
85private:
86 KReportPluginManager * const q;
87 QObject *m_parent;
88 bool m_findPlugins;
89 void findPlugins();
90 void addEntry(KReportPluginEntry *entry);
91
92 //! A map of name -> plugin instances
94 //! A map of legacy name -> plugin instances
95 QMap<QString, KReportPluginEntry*> m_pluginsByLegacyName;
96};
97
98#endif
KReportPluginEntry()
Used for dynamic plugins.
An interface for plugins delivering KReport elements.
void addBuiltInPlugin(const QJsonObject &json)
Add a built-in element plugins.
Manager class for finding and loading available plugins.
Information about a KReport plugin.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:16:24 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.