File indexing completed on 2024-04-14 03:47:41
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2010 Bastian Holst <bastianholst@gmx.de> 0004 // 0005 0006 #ifndef MARBLE_CURRENTLOCATIONWIDGET_H 0007 #define MARBLE_CURRENTLOCATIONWIDGET_H 0008 0009 // Marble 0010 #include "marble_export.h" 0011 #include "AutoNavigation.h" 0012 0013 // Qt 0014 #include <QWidget> 0015 0016 namespace Marble 0017 { 0018 0019 class CurrentLocationWidgetPrivate; 0020 0021 class GeoDataCoordinates; 0022 class MarbleWidget; 0023 class PositionProviderPlugin; 0024 0025 class MARBLE_EXPORT CurrentLocationWidget : public QWidget 0026 { 0027 Q_OBJECT 0028 0029 public: 0030 explicit CurrentLocationWidget( QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags() ); 0031 ~CurrentLocationWidget() override; 0032 0033 /** 0034 * @brief Set a MarbleWidget associated to this widget. 0035 * @param widget the MarbleWidget to be set. 0036 */ 0037 void setMarbleWidget( MarbleWidget *widget ); 0038 0039 AutoNavigation::CenterMode recenterMode() const; 0040 0041 bool autoZoom() const; 0042 0043 bool trackVisible() const; 0044 0045 QString lastOpenPath() const; 0046 0047 QString lastSavePath() const; 0048 0049 public Q_SLOTS: 0050 /// Slot that decides whether recentering should be done 0051 void setRecenterMode( int recenterMode ); 0052 0053 /// Slot for Auto Zooming while navigating 0054 void setAutoZoom( bool activate ); 0055 0056 void setTrackVisible( bool visible ); 0057 0058 void setLastOpenPath( const QString &path ); 0059 0060 void setLastSavePath( const QString &path ); 0061 0062 private: 0063 Q_DISABLE_COPY( CurrentLocationWidget ) 0064 0065 CurrentLocationWidgetPrivate * const d; 0066 0067 Q_PRIVATE_SLOT( d, void receiveGpsCoordinates( const GeoDataCoordinates &in, qreal speed ) ) 0068 Q_PRIVATE_SLOT( d, void adjustPositionTrackingStatus( PositionProviderStatus status ) ) 0069 Q_PRIVATE_SLOT( d, void changePositionProvider( const QString &provider ) ) 0070 Q_PRIVATE_SLOT( d, void centerOnCurrentLocation() ) 0071 0072 Q_PRIVATE_SLOT( d, void trackPlacemark() ) 0073 0074 /** 0075 * @brief Slot for setting re-center combobox if re-centering is enabled other than from CurrentLocationWidget 0076 * @see RoutingPlugin 0077 */ 0078 Q_PRIVATE_SLOT( d, void updateRecenterComboBox( AutoNavigation::CenterMode centerMode ) ) 0079 0080 /** 0081 * @brief Slot for toggling auto zoom checkbox if auto zooming is enabled other than from CurrentLocationWidget 0082 * @see RoutingPlugin 0083 */ 0084 Q_PRIVATE_SLOT( d, void updateAutoZoomCheckBox( bool autoZoom ) ) 0085 0086 Q_PRIVATE_SLOT( d, void updateActivePositionProvider( PositionProviderPlugin* ) ) 0087 0088 Q_PRIVATE_SLOT( d, void updateGuidanceMode() ) 0089 0090 Q_PRIVATE_SLOT( d, void saveTrack() ) 0091 Q_PRIVATE_SLOT( d, void openTrack() ) 0092 Q_PRIVATE_SLOT( d, void clearTrack() ) 0093 }; 0094 0095 } 0096 0097 #endif