Marble

RenderPluginModel.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2012 Bernhard Beschow <[email protected]>
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 
16 namespace Marble
17 {
18 
19 class DialogConfigurationInterface;
20 class RenderPlugin;
21 
22 /**
23  * @brief Provides common access to various kinds of plugins without having to know about their details.
24  */
25 class MARBLE_EXPORT RenderPluginModel : public QStandardItemModel
26 {
27  Q_OBJECT
28 
29 public:
30  /**
31  * This enum contains the data roles for the QStandardItems.
32  */
33  enum ItemDataRole {
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  QVector<PluginAuthor> pluginAuthors( const QModelIndex &index ) const;
60 
61  DialogConfigurationInterface *pluginDialogConfigurationInterface( const QModelIndex &index );
62 
63 public 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 
74 private:
75  class Private;
76  Private *const d;
77  friend class Private;
78 };
79 
80 }
81 
82 #endif // MARBLE_RENDERPLUGINMODEL_H
DisplayRole
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.
Description
Binds a QML item to a specific geodetic location in screen coordinates.
This interface allows a plugin to provide a QWidget-based configuration dialog which is accessible wi...
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:09 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.