Marble

RoutingRunnerPlugin.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <[email protected]>
4 // SPDX-FileCopyrightText: 2011 Thibaut Gridel <[email protected]>
5 // SPDX-FileCopyrightText: 2012 Bernhard Beschow <[email protected]>
6 //
7 
8 #include "RoutingRunnerPlugin.h"
9 
10 #include <QIcon>
11 
12 namespace Marble
13 {
14 
15 class Q_DECL_HIDDEN RoutingRunnerPlugin::Private
16 {
17 public:
18  QStringList m_supportedCelestialBodies;
19 
20  bool m_canWorkOffline;
21 
22  QString m_statusMessage;
23 
24  Private();
25 };
26 
27 RoutingRunnerPlugin::Private::Private()
28  : m_canWorkOffline( true )
29 {
30  // nothing to do
31 }
32 
34  QObject( parent ),
35  d( new Private )
36 {
37 }
38 
40 {
41  delete d;
42 }
43 
45 {
46  return QIcon();
47 }
48 
49 bool RoutingRunnerPlugin::supportsCelestialBody( const QString &celestialBodyId ) const
50 {
51  if ( d->m_supportedCelestialBodies.isEmpty() ) {
52  return true;
53  }
54 
55  return d->m_supportedCelestialBodies.contains( celestialBodyId );
56 }
57 
58 void RoutingRunnerPlugin::setSupportedCelestialBodies( const QStringList &celestialBodies )
59 {
60  d->m_supportedCelestialBodies = celestialBodies;
61 }
62 
63 void RoutingRunnerPlugin::setCanWorkOffline( bool canWorkOffline )
64 {
65  d->m_canWorkOffline = canWorkOffline;
66 }
67 
69 {
70  return d->m_canWorkOffline;
71 }
72 
74 {
75  return true;
76 }
77 
78 RoutingRunnerPlugin::ConfigWidget *RoutingRunnerPlugin::configWidget()
79 {
80  return nullptr;
81 }
82 
83 bool RoutingRunnerPlugin::supportsTemplate( RoutingProfilesModel::ProfileTemplate ) const
84 {
85  return false;
86 }
87 
88 QHash< QString, QVariant > RoutingRunnerPlugin::templateSettings( RoutingProfilesModel::ProfileTemplate ) const
89 {
91 }
92 
94 {
95  return d->m_statusMessage;
96 }
97 
98 void RoutingRunnerPlugin::setStatusMessage( const QString &message )
99 {
100  d->m_statusMessage = message;
101 }
102 
103 }
104 
105 #include "moc_RoutingRunnerPlugin.cpp"
Binds a QML item to a specific geodetic location in screen coordinates.
virtual QHash< QString, QVariant > templateSettings(RoutingProfilesModel::ProfileTemplate profileTemplate) const
Settings for the given routing profile template.
bool canWorkOffline() const
True if the plugin can execute its tasks without network access.
bool supportsCelestialBody(const QString &celestialBodyId) const
True if the plugin supports its tasks on the given planet.
virtual bool canWork() const
Returns.
RoutingRunnerPlugin(QObject *parent=nullptr)
Constructor with optional parent object.
QIcon icon() const override
Returns an icon for the plugin.
virtual bool supportsTemplate(RoutingProfilesModel::ProfileTemplate profileTemplate) const
True if the plugin supports the given routing profile template.
QString statusMessage() const
A status message showing whether the plugin will be able to deliver results.
virtual ConfigWidget * configWidget()
Method for getting a pointer to the configuration widget of the plugin.
~RoutingRunnerPlugin() override
Destructor.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Dec 6 2021 23:10:43 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.