Marble

MarbleDBusInterface.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2015 Dennis Nienhüser <[email protected]>
4 //
5 
6 #ifndef MARBLE_DBUSINTERFACE_H
7 #define MARBLE_DBUSINTERFACE_H
8 
9 #include "marble_export.h"
10 
11 namespace Marble
12 {
13  class MarbleWidget;
14 }
15 
16 #include <QDBusAbstractAdaptor>
17 #include <QScopedPointer>
18 #include <QStringList>
19 #include <QPointF>
20 
21 namespace Marble {
22 
23 class MARBLE_EXPORT MarbleDBusInterface : public QDBusAbstractAdaptor
24 {
25  Q_OBJECT
26  Q_CLASSINFO("D-Bus Interface", "org.kde.marble")
27 
28  Q_PROPERTY(QString mapTheme READ mapTheme WRITE setMapTheme NOTIFY mapThemeChanged)
29  Q_PROPERTY(QStringList mapThemes READ mapThemes)
30  Q_PROPERTY(int tileLevel READ tileLevel NOTIFY tileLevelChanged)
31  Q_PROPERTY(int zoom READ zoom WRITE setZoom NOTIFY zoomChanged)
32  Q_PROPERTY(QStringList properties READ properties)
33  Q_PROPERTY(QPointF center READ center WRITE setCenter NOTIFY centerChanged)
34 
35 public:
36  explicit MarbleDBusInterface(MarbleWidget* widget);
37  ~MarbleDBusInterface() override;
38 
39  QString mapTheme() const;
40  QStringList mapThemes() const;
41  int tileLevel() const;
42  int zoom() const;
43  QPointF center() const;
44 
45 public Q_SLOTS:
46  void setMapTheme( const QString & mapTheme );
47  void setZoom( int zoom );
48  QStringList properties() const;
49  void setCenter( const QPointF &center ) const;
50 
51 public Q_SLOTS:
52  Q_INVOKABLE void setPropertyEnabled( const QString &key, bool enabled );
53  Q_INVOKABLE bool isPropertyEnabled( const QString &key ) const;
54 
55 Q_SIGNALS:
56  void mapThemeChanged( const QString &mapTheme );
57  void tileLevelChanged( int tileLevel );
58  void zoomChanged( int zoom );
59  void centerChanged( const QPointF &center );
60 
61 private Q_SLOTS:
62  void handleVisibleLatLonAltBoxChange();
63 
64 private:
65  Q_DISABLE_COPY(MarbleDBusInterface)
66  class Private;
67  friend class Private;
68  QScopedPointer<Private> const d;
69 };
70 
71 }
72 
73 #endif
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:27 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.