Marble

PositionSource.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2011 Dennis Nienhüser <nienhueser@kde.org>
4//
5
6#ifndef MARBLE_DECLARATIVE_POSITIONSOURCE_H
7#define MARBLE_DECLARATIVE_POSITIONSOURCE_H
8
9#include "Coordinate.h"
10
11#include <QObject>
12
13namespace Marble {
14
15class MarbleQuickItem;
16
17class PositionSource : public QObject
18{
20
21 Q_PROPERTY( MarbleQuickItem* map READ map WRITE setMap NOTIFY mapChanged )
22 Q_PROPERTY( bool active READ active WRITE setActive NOTIFY activeChanged )
23 Q_PROPERTY( QString source READ source WRITE setSource NOTIFY sourceChanged )
24 Q_PROPERTY( bool hasPosition READ hasPosition NOTIFY hasPositionChanged )
25 Q_PROPERTY( Coordinate* position READ position NOTIFY positionChanged )
26 Q_PROPERTY( qreal speed READ speed NOTIFY speedChanged )
27
28public:
29 explicit PositionSource( QObject* parent = nullptr);
30
31 bool active() const;
32
33 void setActive( bool active );
34
35 QString source() const;
36
37 void setSource( const QString &source );
38
39 bool hasPosition() const;
40
41 Coordinate* position();
42
43 MarbleQuickItem *map();
44
45 void setMap( MarbleQuickItem *map );
46
47 qreal speed() const;
48
50 void mapChanged();
51
52 void activeChanged();
53
54 void sourceChanged();
55
56 void hasPositionChanged();
57
58 void positionChanged();
59
60 void speedChanged();
61
62private Q_SLOTS:
63 void updatePosition();
64
65private:
66 void start();
67
68 bool m_active;
69
70 QString m_source;
71
72 bool m_hasPosition;
73
74 Coordinate m_position;
75
76 QPointer<MarbleQuickItem> m_marbleQuickItem;
77
78 qreal m_speed;
79};
80
81}
82
83#endif
Represents a coordinate with the properties of a name and coordinates.
Definition Coordinate.h:19
Binds a QML item to a specific geodetic location in screen coordinates.
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
T qobject_cast(QObject *object)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 14 2024 11:54:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.