Marble

RoutingRunnerPlugin.h
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2010 Dennis Nienhüser <[email protected]>
9 // Copyright 2011 Thibaut Gridel <[email protected]>
10 // Copyright 2012 Bernhard Beschow <[email protected]>
11 //
12 
13 #ifndef MARBLE_ROUTINGRUNNERPLUGIN_H
14 #define MARBLE_ROUTINGRUNNERPLUGIN_H
15 
16 #include <QObject>
17 #include "PluginInterface.h"
18 
19 #include <QHash>
20 #include <QWidget>
21 
22 #include "routing/RoutingProfilesModel.h"
23 
24 namespace Marble
25 {
26 
27 class MarbleAbstractRunner;
28 class RoutingRunner;
29 
33 class MARBLE_EXPORT RoutingRunnerPlugin : public QObject, public PluginInterface
34 {
35  Q_OBJECT
36 
37 public:
39  explicit RoutingRunnerPlugin( QObject* parent = nullptr );
40 
42  ~RoutingRunnerPlugin() override;
43 
49  virtual QString guiString() const = 0;
50 
54  virtual RoutingRunner *newRunner() const = 0;
55 
57  bool supportsCelestialBody( const QString &celestialBodyId ) const;
58 
60  bool canWorkOffline() const;
61 
68  virtual bool canWork() const;
69 
70  // Overridden methods with default implementations
71 
72  QIcon icon() const override;
73 
75  QString statusMessage() const;
76 
77  class ConfigWidget : public QWidget
78  {
79  public:
80  virtual void loadSettings( const QHash<QString, QVariant> &settings ) = 0;
81  virtual QHash<QString, QVariant> settings() const = 0;
82  };
88  virtual ConfigWidget *configWidget();
89 
91  virtual bool supportsTemplate( RoutingProfilesModel::ProfileTemplate profileTemplate ) const;
92 
94  virtual QHash<QString, QVariant> templateSettings( RoutingProfilesModel::ProfileTemplate profileTemplate ) const;
95 
96 protected:
97  void setStatusMessage( const QString &message );
98 
99  void setSupportedCelestialBodies( const QStringList &celestialBodies );
100 
101  void setCanWorkOffline( bool canWorkOffline );
102 
103 private:
104  class Private;
105  Private *const d;
106 };
107 
108 }
109 
110 Q_DECLARE_INTERFACE( Marble::RoutingRunnerPlugin, "org.kde.Marble.RunnerRunnerPlugin/1.01" )
111 
112 #endif // MARBLE_ROUTINGRUNNERPLUGIN_H
Binds a QML item to a specific geodetic location in screen coordinates.
This class specifies interface of a Marble plugin.
A plugin for Marble to execute a routing task.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Oct 22 2020 23:24:19 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.