Marble

PopupLayer.h
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2012 Mohammed Nafees <[email protected]>
9 // Copyright 2012 Dennis Nienhüser <[email protected]>
10 // Copyright 2012 Illya Kovalevskyy <[email protected]>
11 //
12 
13 #ifndef POPUPLAYER_H
14 #define POPUPLAYER_H
15 
16 #include "LayerInterface.h"
17 
18 #include <QObject>
19 #include <QUrl>
20 
21 class QSizeF;
22 
23 namespace Marble
24 {
25 
26 class GeoDataCoordinates;
27 class MarbleWidget;
28 
36 class MARBLE_EXPORT PopupLayer : public QObject, public LayerInterface
37 {
38  Q_OBJECT
39 public:
40  explicit PopupLayer( MarbleWidget *widget, QObject* parent = nullptr );
41  ~PopupLayer() override;
42 
43  QStringList renderPosition() const override;
44  bool render( GeoPainter *painter, ViewportParams *viewport,
45  const QString &, GeoSceneLayer * ) override;
46  bool eventFilter( QObject *, QEvent * ) override;
47  qreal zValue() const override;
48 
49  RenderState renderState() const override;
50 
51  QString runtimeTrace() const override { return QStringLiteral("PopupLayer"); }
52 
61  bool visible() const;
62 
71  void setVisible( bool visible );
72 
79  void popup();
80 
95  void setCoordinates( const GeoDataCoordinates &coordinates, Qt::Alignment alignment );
96 
104  void setUrl( const QUrl &url );
105 
113  void setSize( const QSizeF &size );
114 
122  void setContent( const QString &html, const QUrl & baseUrl = QUrl() );
123 
131  void setBackgroundColor( const QColor &color );
132 
140  void setTextColor( const QColor &color );
141 
142 Q_SIGNALS:
143  void repaintNeeded();
144 
145 private Q_SLOTS:
146  void hidePopupItem();
147 
148 private:
149  class Private;
150  Private *const d;
151 };
152 
153 }
154 
155 #endif
A 3d point representation.
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:93
Binds a QML item to a specific geodetic location in screen coordinates.
The PopupLayer class.
Definition: PopupLayer.h:36
typedef Alignment
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:102
Layer of a GeoScene document.
Definition: GeoSceneLayer.h:43
A public class that controls what is visible in the viewport of a Marble map.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Oct 24 2020 23:25:25 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.