File indexing completed on 2024-04-21 03:49:55

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org>
0004 // SPDX-FileCopyrightText: 2011 Thibaut Gridel <tgridel@free.fr>
0005 // SPDX-FileCopyrightText: 2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
0006 //
0007 
0008 #include "SearchRunnerPlugin.h"
0009 
0010 #include <QIcon>
0011 
0012 namespace Marble
0013 {
0014 
0015 class Q_DECL_HIDDEN SearchRunnerPlugin::Private
0016 {
0017 public:
0018     QStringList m_supportedCelestialBodies;
0019 
0020     bool m_canWorkOffline;
0021 
0022     Private();
0023 };
0024 
0025 SearchRunnerPlugin::Private::Private()
0026     : m_canWorkOffline( true )
0027 {
0028     // nothing to do
0029 }
0030 
0031 SearchRunnerPlugin::SearchRunnerPlugin( QObject* parent ) :
0032     QObject( parent ),
0033     d( new Private )
0034 {
0035 }
0036 
0037 SearchRunnerPlugin::~SearchRunnerPlugin()
0038 {
0039     delete d;
0040 }
0041 
0042 QIcon SearchRunnerPlugin::icon() const
0043 {
0044     return QIcon();
0045 }
0046 
0047 bool SearchRunnerPlugin::supportsCelestialBody( const QString &celestialBodyId ) const
0048 {
0049     if ( d->m_supportedCelestialBodies.isEmpty() ) {
0050         return true;
0051     }
0052 
0053     return d->m_supportedCelestialBodies.contains( celestialBodyId );
0054 }
0055 
0056 void SearchRunnerPlugin::setSupportedCelestialBodies( const QStringList &celestialBodies )
0057 {
0058     d->m_supportedCelestialBodies = celestialBodies;
0059 }
0060 
0061 void SearchRunnerPlugin::setCanWorkOffline( bool canWorkOffline )
0062 {
0063     d->m_canWorkOffline = canWorkOffline;
0064 }
0065 
0066 bool SearchRunnerPlugin::canWorkOffline() const
0067 {
0068     return d->m_canWorkOffline;
0069 }
0070 
0071 bool SearchRunnerPlugin::canWork() const
0072 {
0073     return true;
0074 }
0075 
0076 }
0077 
0078 #include "moc_SearchRunnerPlugin.cpp"