File indexing completed on 2024-03-24 15:22:45

0001 // SPDX-FileCopyrightText: 2011 Friedrich W. H. Kossebau <kossebau@kde.org>
0002 // SPDX-License-Identifier: LGPL-2.1-or-later
0003 
0004 
0005 #ifndef MARBLE_PLASMARUNNER_H
0006 #define MARBLE_PLASMARUNNER_H
0007 
0008 // Plasma
0009 #include <KRunner/AbstractRunner>
0010 #include <krunner_version.h>
0011 
0012 
0013 namespace Marble
0014 {
0015 class GeoDataFolder;
0016 
0017 
0018 class PlasmaRunner : public Plasma::AbstractRunner
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023 #if KRUNNER_VERSION >= QT_VERSION_CHECK(5, 77, 0)
0024     PlasmaRunner(QObject *parent, const KPluginMetaData &pluginMetaData, const QVariantList &args);
0025 #else
0026     PlasmaRunner(QObject *parent, const QVariantList &args);
0027 #endif
0028 
0029 public: // Plasma::AbstractRunner API
0030     void match(Plasma::RunnerContext &context) override;
0031     void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) override;
0032 
0033 private:
0034     void collectMatches(QList<Plasma::QueryMatch> &matches,
0035                         const QString &query, const GeoDataFolder *folder);
0036 };
0037 
0038 }
0039 
0040 #endif
0041