File indexing completed on 2024-05-05 03:50:50
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2010 Siddharth Srivastava <akssps011@gmail.com> 0004 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org> 0005 // 0006 0007 #ifndef MARBLE_ROUTINGPLUGIN_H 0008 #define MARBLE_ROUTINGPLUGIN_H 0009 0010 #include "AbstractFloatItem.h" 0011 #include "DialogConfigurationInterface.h" 0012 0013 namespace Marble 0014 { 0015 class RoutingPluginPrivate; 0016 class PositionProviderPlugin; 0017 0018 class RoutingPlugin : public AbstractFloatItem, public DialogConfigurationInterface 0019 { 0020 Q_OBJECT 0021 Q_PLUGIN_METADATA(IID "org.kde.marble.RoutingPlugin") 0022 0023 Q_INTERFACES( Marble::RenderPluginInterface ) 0024 Q_INTERFACES( Marble::DialogConfigurationInterface ) 0025 0026 MARBLE_PLUGIN( RoutingPlugin ) 0027 0028 public: 0029 RoutingPlugin(); 0030 0031 explicit RoutingPlugin( const MarbleModel *marbleModel ); 0032 0033 ~RoutingPlugin() override; 0034 0035 QStringList backendTypes() const override; 0036 0037 void initialize() override; 0038 0039 bool isInitialized() const override; 0040 0041 QString name() const override; 0042 0043 QString guiString() const override; 0044 0045 QString nameId() const override; 0046 0047 QString version() const override; 0048 0049 QString description() const override; 0050 0051 QString copyrightYears() const override; 0052 0053 QVector<PluginAuthor> pluginAuthors() const override; 0054 0055 QIcon icon() const override; 0056 0057 bool eventFilter( QObject *object, QEvent *event ) override; 0058 0059 QHash<QString,QVariant> settings() const override; 0060 0061 void setSettings( const QHash<QString,QVariant> &settings ) override; 0062 0063 QDialog *configDialog() override; 0064 0065 private Q_SLOTS: 0066 /** Write settings */ 0067 void writeSettings(); 0068 0069 private: 0070 /** Disable zoom buttons if needed */ 0071 Q_PRIVATE_SLOT( d, void updateZoomButtons() ) 0072 0073 /** Disable zoom buttons if needed */ 0074 Q_PRIVATE_SLOT( d, void updateZoomButtons( int ) ) 0075 0076 /** Switch source/destination of the route and recalculate it */ 0077 Q_PRIVATE_SLOT( d, void reverseRoute() ) 0078 0079 /** Toggles guidance mode */ 0080 Q_PRIVATE_SLOT( d, void toggleGuidanceMode( bool enabled ) ) 0081 0082 /** sets time and distance remaining to reach the destination */ 0083 Q_PRIVATE_SLOT( d, void updateDestinationInformation() ) 0084 0085 /** Update the checked state of the position tracking button */ 0086 Q_PRIVATE_SLOT( d, void updateGpsButton( PositionProviderPlugin *activePlugin ) ) 0087 0088 /** Activate or deactivate position tracking */ 0089 Q_PRIVATE_SLOT( d, void togglePositionTracking( bool enabled ) ) 0090 0091 Q_PRIVATE_SLOT( d, void updateGuidanceModeButton() ) 0092 0093 /** Read settings */ 0094 Q_PRIVATE_SLOT( d, void readSettings() ) 0095 0096 friend class RoutingPluginPrivate; 0097 RoutingPluginPrivate* const d; 0098 }; 0099 0100 } 0101 0102 #endif // MARBLE_ROUTINGPLUGIN_H 0103