Marble

SearchRunnerPlugin.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 "SearchRunnerPlugin.h"
9 
10 #include <QIcon>
11 
12 namespace Marble
13 {
14 
15 class Q_DECL_HIDDEN SearchRunnerPlugin::Private
16 {
17 public:
18  QStringList m_supportedCelestialBodies;
19 
20  bool m_canWorkOffline;
21 
22  Private();
23 };
24 
25 SearchRunnerPlugin::Private::Private()
26  : m_canWorkOffline( true )
27 {
28  // nothing to do
29 }
30 
32  QObject( parent ),
33  d( new Private )
34 {
35 }
36 
38 {
39  delete d;
40 }
41 
43 {
44  return QIcon();
45 }
46 
47 bool 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 
56 void SearchRunnerPlugin::setSupportedCelestialBodies( const QStringList &celestialBodies )
57 {
58  d->m_supportedCelestialBodies = celestialBodies;
59 }
60 
61 void 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"
Binds a QML item to a specific geodetic location in screen coordinates.
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.
SearchRunnerPlugin(QObject *parent=nullptr)
Constructor with optional parent object.
QObject * parent() const const
virtual bool canWork() const
Returns.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Nov 29 2021 23:11:05 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.