Marble

RenderPluginModel.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
4//
5
6#ifndef MARBLE_RENDERPLUGINMODEL_H
7#define MARBLE_RENDERPLUGINMODEL_H
8
9#include "marble_export.h"
10#include <QStandardItemModel>
11
12#include <QList>
13
14#include "PluginInterface.h"
15
16namespace Marble
17{
18
19class DialogConfigurationInterface;
20class RenderPlugin;
21
22/**
23 * @brief Provides common access to various kinds of plugins without having to know about their details.
24 */
25class MARBLE_EXPORT RenderPluginModel : public QStandardItemModel
26{
27 Q_OBJECT
28
29public:
30 /**
31 * This enum contains the data roles for the QStandardItems.
32 */
34 Name = Qt::DisplayRole, // QString
35 Icon = Qt::DecorationRole, // QIcon
36 Description = Qt::ToolTipRole, // QString
37 NameId = Qt::UserRole + 2, // QString
38 ConfigurationDialogAvailable, // bool
39 BackendTypes, // QStringList
40 Version, // QString
41 AboutDataText, // QString
42 CopyrightYears // QString
43 };
44
45 explicit RenderPluginModel(QObject *parent = nullptr);
46
47 ~RenderPluginModel() override;
48
49 /**
50 * @brief Set the RenderPlugins the model should manage.
51 *
52 * The given plugins must not be deleted as long as the model has a hold on them,
53 * i.e. until the model is deleted or a different set of plugins is assigned.
54 *
55 * @param renderPlugins the RenderPlugins to be managed
56 */
57 void setRenderPlugins(const QList<RenderPlugin *> &renderPlugins);
58
59 QList<PluginAuthor> pluginAuthors(const QModelIndex &index) const;
60
61 DialogConfigurationInterface *pluginDialogConfigurationInterface(const QModelIndex &index);
62
63public Q_SLOTS:
64 /**
65 * Retrieve the current plugin state for the user interface.
66 */
67 void retrievePluginState();
68
69 /**
70 * Apply the plugin state from the user interface.
71 */
72 void applyPluginState();
73
74private:
75 class Private;
76 Private *const d;
77 friend class Private;
78};
79
80}
81
82#endif // MARBLE_RENDERPLUGINMODEL_H
This interface allows a plugin to provide a QWidget-based configuration dialog which is accessible wi...
Provides common access to various kinds of plugins without having to know about their details.
ItemDataRole
This enum contains the data roles for the QStandardItems.
Binds a QML item to a specific geodetic location in screen coordinates.
DisplayRole
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.