Marble

AutoNavigation.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2010 Siddharth Srivastava <akssps011@gmail.com>
4//
5
6#ifndef MARBLE_AUTONAVIGATION_H
7#define MARBLE_AUTONAVIGATION_H
8
9#include "MarbleGlobal.h"
10#include "marble_export.h"
11
12#include <QObject>
13
14namespace Marble
15{
16
17class GeoDataCoordinates;
18class MarbleModel;
19class ViewportParams;
20
21class MARBLE_EXPORT AutoNavigation : public QObject
22{
23 Q_OBJECT
24
25public:
26 /**
27 * @brief Constructor
28 * @param widget the marble widget. It cannot be null.
29 * @param parent optional parent object
30 */
31 explicit AutoNavigation(MarbleModel *model, const ViewportParams *viewport, QObject *parent = nullptr);
32
33 /** Destructor */
34 ~AutoNavigation() override;
35
36 /**
37 * An enum type
38 * Represents which recentering method is selected
39 */
40 enum CenterMode {
41 DontRecenter = 0,
42 AlwaysRecenter = 1, /**< Enum Value AlwaysRecenter. Recenter always to the map center */
43 RecenterOnBorder = 2 /**< Enum Value RecenterOnBorder. Recenter when reaching map border */
44 };
45
46 /**
47 * @brief For Auto Centering adjustment of map in Navigation Mode
48 * @param recenterMode toggles among the recenteing method chosen
49 * @see CenterMode
50 */
51 void setRecenter(CenterMode recenterMode);
52
53 /**
54 * @brief For Auto Zooming adjustment of map in Navigation Mode
55 * @param activate true to enable auto zooming
56 */
57 void setAutoZoom(bool activate);
58
59 AutoNavigation::CenterMode recenterMode() const;
60
61 bool autoZoom() const;
62
63public Q_SLOTS:
64
65 /**
66 * @brief For adjusting the gps location (recentering) or map(autozooming)
67 * @param position current gps location
68 * @param speed of the gps device
69 */
70 void adjust(const GeoDataCoordinates &position, qreal speed);
71
72 /**
73 * Temporarily inhibits auto-centering and auto-zooming
74 */
75 void inhibitAutoAdjustments();
76
77Q_SIGNALS:
78 /**
79 * signal emitted when auto center is turned on (Always re-center, re-center when required ) or off(Disabled)
80 * @param recenterMode the mode for re-centering selected
81 */
82 void recenterModeChanged(AutoNavigation::CenterMode mode);
83
84 /**
85 * signal emitted when auto zoom is toggled
86 */
87 void autoZoomToggled(bool enabled);
88
89 void zoomIn(FlyToMode);
90
91 void zoomOut(FlyToMode);
92
93 void centerOn(const GeoDataCoordinates &position, bool animated);
94
95private:
96 class Private;
97 Private *const d;
98};
99} // namespace marble
100
101#endif // MARBLE_AUTONAVIGATION_H
const QList< QKeySequence > & zoomIn()
const QList< QKeySequence > & zoomOut()
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.