Marble

MarbleNavigator.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2005-2007 Torsten Rahn <[email protected]>
4 // SPDX-FileCopyrightText: 2007 Inge Wallin <[email protected]>
5 //
6 
7 //
8 // This widget is a control box for the Marble widget.
9 //
10 
11 #ifndef MARBLE_MARBLENAVIGATOR_H
12 #define MARBLE_MARBLENAVIGATOR_H
13 
14 
15 #include <QWidget>
16 
17 #include "marble_export.h"
18 
19 
20 /** @file
21  * This file contains the header for MarbleNavigator
22  *
23  * @author Torsten Rahn <[email protected]>
24  * @author Inge Wallin <[email protected]>
25  */
26 
27 namespace Marble
28 {
29 
30 class MarbleNavigatorPrivate;
31 
32 /**
33  * @short A widget class that contains simple controls for a
34  * MarbleWidget.
35  *
36  * This widget lets the user control an instance of MarbleWidget. The
37  * user can control panning and zooming as well as returning to a
38  * predefined view called the 'Home' position. You cannot change the
39  * Home position from the MarbleNavigator, though.
40  *
41  * @see MarbleWidget
42  */
43 
44 class MARBLE_EXPORT MarbleNavigator : public QWidget
45 {
46  Q_OBJECT
47 
48  public:
49  /**
50  * @brief Construct a new MarbleNavigator
51  * @param parent the parent widget
52  */
53  explicit MarbleNavigator(QWidget *parent = nullptr);
54  ~MarbleNavigator() override;
55 
56  /**
57  * @brief Return the minimum zoom level set in the widget.
58  * @return the minimum zoom level set in the widget.
59  */
60  int minimumZoom() const;
61 
62  Q_SIGNALS:
63  /**
64  * @brief Signal emitted when the Home button has been pressed.
65  */
66  void goHome();
67  /**
68  * @brief Signal emitted when the Zoom In button has been pressed.
69  */
70  void zoomIn();
71  /**
72  * @brief Signal emitted when the Zoom Out button has been pressed.
73  */
74  void zoomOut();
75  /**
76  * @brief Signal emitted when the zoom slider has been moved.
77  * @param zoom The new zoom value.
78  */
79  void zoomChanged(int zoom);
80 
81  /**
82  * @brief Signal emitted when the Move Left button has been pressed.
83  */
84  void moveLeft();
85  /**
86  * @brief Signal emitted when the Move Right button has been pressed.
87  */
88  void moveRight();
89  /**
90  * @brief Signal emitted when the Move Up button has been pressed.
91  */
92  void moveUp();
93  /**
94  * @brief Signal emitted when the Move Down button has been pressed.
95  */
96  void moveDown();
97  //void centerOn(const QModelIndex&);
98 
99  public Q_SLOTS:
100  /**
101  * @brief Sets the value of the slider.
102  * @param zoom The new zoom value.
103  *
104  * This slot should be called when the zoom value is changed from
105  * the widget itself, e.g. by using the scroll wheel. It sets the
106  * value of the slider, but nothing more. In particular it
107  * doesn't emit the zoomChanged signal.
108  */
109  void changeZoom(int zoom);
110 
111  protected:
112  /**
113  * @brief Reimplementation of the resizeEvent() of the widget.
114  *
115  * If the MarbleNavigator gets shrunk enough, the slider will be
116  * hidden, leaving only the Zoom Up and Zoom Down buttons.
117  */
118  void resizeEvent ( QResizeEvent * ) override;
119 
120  private:
121  Q_DISABLE_COPY( MarbleNavigator )
122  MarbleNavigatorPrivate * const d;
123 };
124 
125 }
126 
127 #endif
Binds a QML item to a specific geodetic location in screen coordinates.
A widget class that contains simple controls for a MarbleWidget.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Oct 4 2023 04:09:42 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.