Marble

SearchRunnerPlugin.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 "SearchRunnerPlugin.h"
9
10#include <QIcon>
11
12namespace Marble
13{
14
15class Q_DECL_HIDDEN SearchRunnerPlugin::Private
16{
17public:
18 QStringList m_supportedCelestialBodies;
19
20 bool m_canWorkOffline;
21
22 Private();
23};
24
25SearchRunnerPlugin::Private::Private()
26 : m_canWorkOffline(true)
27{
28 // nothing to do
29}
30
31SearchRunnerPlugin::SearchRunnerPlugin(QObject *parent)
32 : QObject(parent)
33 , d(new Private)
34{
35}
36
41
43{
44 return {};
45}
46
47bool SearchRunnerPlugin::supportsCelestialBody(const QString &celestialBodyId) const
48{
49 if (d->m_supportedCelestialBodies.isEmpty()) {
50 return true;
51 }
52
53 return d->m_supportedCelestialBodies.contains(celestialBodyId);
54}
55
56void SearchRunnerPlugin::setSupportedCelestialBodies(const QStringList &celestialBodies)
57{
58 d->m_supportedCelestialBodies = celestialBodies;
59}
60
61void SearchRunnerPlugin::setCanWorkOffline(bool canWorkOffline)
62{
63 d->m_canWorkOffline = canWorkOffline;
64}
65
67{
68 return d->m_canWorkOffline;
69}
70
72{
73 return true;
74}
75
76}
77
78#include "moc_SearchRunnerPlugin.cpp"
virtual bool canWork() const
Returns.
bool supportsCelestialBody(const QString &celestialBodyId) const
True if the plugin supports its tasks on the given planet.
bool canWorkOffline() const
True if the plugin can execute its tasks without network access.
~SearchRunnerPlugin() override
Destructor.
QIcon icon() const override
Returns an icon for the plugin.
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 Sat Dec 21 2024 17:04:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.