plasma-workspace/runners/windowedwidgets/windowedwidgetsrunner.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
1.1 KiB
C
Raw Permalink Normal View History

2021-11-09 21:04:31 +08:00
/*
2022-10-31 20:30:06 +08:00
SPDX-FileCopyrightText: 2006 Aaron Seigo <aseigo@kde.org>
SPDX-FileCopyrightText: 2010 Marco Martin <notmart@gmail.com>
2021-11-09 21:04:31 +08:00
2022-10-31 20:30:06 +08:00
SPDX-License-Identifier: LGPL-2.0-only
*/
2021-11-09 21:04:31 +08:00
2022-10-31 20:30:06 +08:00
#pragma once
2021-11-09 21:04:31 +08:00
#include <KService>
2022-10-31 20:30:06 +08:00
#include <QMutex>
2021-11-09 21:04:31 +08:00
#include <krunner/abstractrunner.h>
/**
* This class looks for matches in the set of .desktop files installed by
* applications. This way the user can type exactly what they see in the
2022-10-31 20:30:06 +08:00
* applications menu and have it start the appropriate app. Essentially anything
2021-11-09 21:04:31 +08:00
* that KService knows about, this runner can launch
*/
class WindowedWidgetsRunner : public Plasma::AbstractRunner
{
Q_OBJECT
public:
2022-10-31 20:30:06 +08:00
WindowedWidgetsRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args);
2021-11-09 21:04:31 +08:00
~WindowedWidgetsRunner() override;
void match(Plasma::RunnerContext &context) override;
void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &action) override;
protected Q_SLOTS:
2022-10-31 20:30:06 +08:00
QMimeData *mimeDataForMatch(const Plasma::QueryMatch &match) override;
2021-11-09 21:04:31 +08:00
2022-10-31 20:30:06 +08:00
private:
void loadMetadataList();
QList<KPluginMetaData> m_applets;
QMutex m_mutex;
2021-11-09 21:04:31 +08:00
};