Marble

RoutingRunnerPlugin.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org>
4// SPDX-FileCopyrightText: 2011 Thibaut Gridel <tgridel@free.fr>
5// SPDX-FileCopyrightText: 2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
6//
7
8#include "RoutingRunnerPlugin.h"
9
10#include <QIcon>
11
12namespace Marble
13{
14
15class Q_DECL_HIDDEN RoutingRunnerPlugin::Private
16{
17public:
18 QStringList m_supportedCelestialBodies;
19
20 bool m_canWorkOffline;
21
22 QString m_statusMessage;
23
24 Private();
25};
26
27RoutingRunnerPlugin::Private::Private()
28 : m_canWorkOffline(true)
29{
30 // nothing to do
31}
32
33RoutingRunnerPlugin::RoutingRunnerPlugin(QObject *parent)
34 : QObject(parent)
35 , d(new Private)
36{
37}
38
43
45{
46 return {};
47}
48
49bool 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
58void RoutingRunnerPlugin::setSupportedCelestialBodies(const QStringList &celestialBodies)
59{
60 d->m_supportedCelestialBodies = celestialBodies;
61}
62
63void 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
78RoutingRunnerPlugin::ConfigWidget *RoutingRunnerPlugin::configWidget()
79{
80 return nullptr;
81}
82
83bool RoutingRunnerPlugin::supportsTemplate(RoutingProfilesModel::ProfileTemplate) const
84{
85 return false;
86}
87
88QHash<QString, QVariant> RoutingRunnerPlugin::templateSettings(RoutingProfilesModel::ProfileTemplate) const
89{
90 return {};
91}
92
94{
95 return d->m_statusMessage;
96}
97
98void RoutingRunnerPlugin::setStatusMessage(const QString &message)
99{
100 d->m_statusMessage = message;
101}
102
103}
104
105#include "moc_RoutingRunnerPlugin.cpp"
virtual QHash< QString, QVariant > templateSettings(RoutingProfilesModel::ProfileTemplate profileTemplate) const
Settings for the given routing profile template.
QString statusMessage() const
A status message showing whether the plugin will be able to deliver results.
QIcon icon() const override
Returns an icon for the plugin.
virtual ConfigWidget * configWidget()
Method for getting a pointer to the configuration widget of the plugin.
bool supportsCelestialBody(const QString &celestialBodyId) const
True if the plugin supports its tasks on the given planet.
virtual bool supportsTemplate(RoutingProfilesModel::ProfileTemplate profileTemplate) const
True if the plugin supports the given routing profile template.
~RoutingRunnerPlugin() override
Destructor.
virtual bool canWork() const
Returns.
bool canWorkOffline() const
True if the plugin can execute its tasks without network access.
Binds a QML item to a specific geodetic location in screen coordinates.
bool isEmpty() const const
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:52:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.