Marble

FloatItemsLayer.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2012-2016 Bernhard Beschow <[email protected]>
4 //
5 
6 #ifndef MARBLE_FLOATITEMSLAYER_H
7 #define MARBLE_FLOATITEMSLAYER_H
8 
9 #include <QObject>
10 #include "LayerInterface.h"
11 
12 #include <QList>
13 #include <QRegion>
14 
15 namespace Marble
16 {
17 
18 class AbstractFloatItem;
19 class RenderPlugin;
20 
21 /**
22  * @brief Layer for handling the rendering of screen-positioned, 2D float items.
23  */
24 class FloatItemsLayer : public QObject, public LayerInterface
25 {
26  Q_OBJECT
27 
28  public:
29  explicit FloatItemsLayer(QObject *parent = nullptr);
30 
31  QStringList renderPosition() const override;
32 
33  bool render(GeoPainter *painter, ViewportParams *viewport,
34  const QString &renderPos = "NONE", GeoSceneLayer *layer = nullptr) override;
35 
36  void addFloatItem(AbstractFloatItem *floatItem);
37 
38  /**
39  * @brief Returns a list of all FloatItems of the layer
40  * @return the list of the floatItems
41  */
43 
44  QString runtimeTrace() const override;
45 
46  Q_SIGNALS:
47  /**
48  * @brief Signal that a render item has been initialized
49  */
50  void renderPluginInitialized(RenderPlugin *renderPlugin);
51 
52  /**
53  * This signal is emitted when the repaint of the view was requested by a plugin.
54  * If available with the @p dirtyRegion which is the region the view will change in.
55  * If dirtyRegion.isEmpty() returns true, the whole viewport has to be repainted.
56  */
57  void repaintNeeded(const QRegion &dirtyRegion = QRegion());
58 
59  void visibilityChanged(const QString &nameId, bool visible);
60 
61  void pluginSettingsChanged();
62 
63  private Q_SLOTS:
64  void updateVisibility(bool visible, const QString &nameId);
65 
66  private:
67  QList<AbstractFloatItem *> m_floatItems;
68 };
69 
70 }
71 
72 #endif
Q_OBJECTQ_OBJECT
The abstract class that creates a renderable item.
Definition: RenderPlugin.h:38
Q_SLOTSQ_SLOTS
QList< AbstractFloatItem * > floatItems() const
Returns a list of all FloatItems of the layer.
The abstract class for float item plugins.
Layer of a GeoScene document.
Definition: GeoSceneLayer.h:28
A public class that controls what is visible in the viewport of a Marble map.
Binds a QML item to a specific geodetic location in screen coordinates.
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:88
Q_SIGNALSQ_SIGNALS
Layer for handling the rendering of screen-positioned, 2D float items.
void renderPluginInitialized(RenderPlugin *renderPlugin)
Signal that a render item has been initialized.
void repaintNeeded(const QRegion &dirtyRegion=QRegion())
This signal is emitted when the repaint of the view was requested by a plugin.
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.