File indexing completed on 2024-05-05 17:45:02

0001 /*
0002     SPDX-FileCopyrightText: 2006 Aaron Seigo <aseigo@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006 
0007 #pragma once
0008 
0009 #include <KRunner/AbstractRunner>
0010 #include <KService>
0011 
0012 /**
0013  * This class looks for matches in the set of .desktop files installed by
0014  * applications. This way the user can type exactly what they see in the
0015  * applications menu and have it start the appropriate app. Essentially anything
0016  * that KService knows about, this runner can launch
0017  */
0018 
0019 class ServiceRunner : public Plasma::AbstractRunner
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     ServiceRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args);
0025     ~ServiceRunner() override;
0026 
0027     void match(Plasma::RunnerContext &context) override;
0028     void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) override;
0029 
0030 protected:
0031     void setupMatch(const KService::Ptr &service, Plasma::QueryMatch &action);
0032 };