Marble

MarbleLegendBrowser.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2006-2007 Torsten Rahn <tackat@kde.org>
4// SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
5// SPDX-FileCopyrightText: 2013 Yazeed Zoabi <yazeedz.zoabi@gmail.com>
6//
7
8//
9// The Legend Browser displays the legend
10//
11
12#ifndef MARBLE_MARBLELEGENDBROWSER_H
13#define MARBLE_MARBLELEGENDBROWSER_H
14
15#ifdef MARBLE_NO_WEBKITWIDGETS
16#include "NullMarbleWebView.h"
17#else
18#include "MarbleWebView.h"
19#endif
20
21#include "marble_export.h"
22
23class QEvent;
24class QUrl;
25class QString;
26
27namespace Marble
28{
29
30class MarbleModel;
31class MarbleLegendBrowserPrivate;
32
33class MARBLE_EXPORT MarbleLegendBrowser : public MarbleWebView
34{
35 Q_OBJECT
36
37 public:
38 explicit MarbleLegendBrowser( QWidget* parent );
39 ~MarbleLegendBrowser() override;
40
41 void setMarbleModel( MarbleModel *marbleModel );
42 QSize sizeHint() const override;
43
44 Q_SIGNALS:
45 void toggledShowProperty( const QString&, bool );
46 void tourLinkClicked( const QString &url );
47
48 public Q_SLOTS:
49 void setCheckedProperty( const QString& name, bool checked );
50 void setRadioCheckedProperty( const QString& value,const QString& name, bool checked );
51
52 private Q_SLOTS:
53 void initTheme();
54 void loadLegend();
55 void openLinkExternally( const QUrl &url );
56
57 protected:
58 bool event( QEvent * event ) override;
59 static QString readHtml(const QUrl &name);
60 QString generateSectionsHtml();
61 static void translateHtml(QString &html);
62
63 private:
64 void injectWebChannel( QString &html );
65 void reverseSupportCheckboxes( QString &html );
66 private:
67 Q_DISABLE_COPY( MarbleLegendBrowser )
68 MarbleLegendBrowserPrivate * const d;
69};
70
71class MarbleJsWrapper : public QObject
72{
74public:
75 explicit MarbleJsWrapper( MarbleLegendBrowser* parent ) : m_parent(parent) {}
76
77public Q_SLOTS:
78 void setCheckedProperty( const QString& name, bool checked )
79 {
80 m_parent->setCheckedProperty(name, checked);
81 }
82 void setRadioCheckedProperty( const QString& value,const QString& name, bool checked )
83 {
84 m_parent->setRadioCheckedProperty(value, name, checked);
85 }
86private:
87 MarbleLegendBrowser * m_parent;
88};
89
90}
91
92#endif
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
Binds a QML item to a specific geodetic location in screen coordinates.
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 14 2024 11:54:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.