kwin/plugins/krunner-integration/windowsrunnerinterface.h
Vlad Zahorodnii 8f6edea521 Turn krunner integration into a plugin
krunner stuff doesn't really belong in kwin, it has nothing to do with
compositing or any other things that are the domain of compositors.
Given that, being as a plugin suits the krunner integration stuff best.
2020-11-25 09:34:25 +00:00

66 lines
1.8 KiB
C++

/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2009 Martin Gräßlin <kde@martin-graesslin.com>
SPDX-FileCopyrightText: 2020 Benjamin Port <benjamin.port@enioka.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef WINDOWSRUNNER_H
#define WINDOWSRUNNER_H
#pragma once
#include "plugin.h"
#include "dbusutils_p.h"
#include <KRunner/QueryMatch>
#include <QObject>
#include <QDBusContext>
#include <QDBusMessage>
#include <QString>
#include <QDBusArgument>
namespace KWin
{
class VirtualDesktop;
class AbstractClient;
class WindowsRunner : public Plugin, protected QDBusContext
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.KWin.WindowsRunner")
public:
explicit WindowsRunner(QObject *parent = nullptr);
~WindowsRunner() override;
RemoteActions Actions();
RemoteMatches Match(const QString &searchTerm);
void Run(const QString &id, const QString &actionId);
private:
enum WindowsRunnerAction {
// Windows related actions
ActivateAction,
CloseAction,
MinimizeAction,
MaximizeAction,
FullscreenAction,
ShadeAction,
KeepAboveAction,
KeepBelowAction,
// Desktop related actions
ActivateDesktopAction
};
void initialize();
RemoteMatch desktopMatch(const VirtualDesktop *desktop, const WindowsRunnerAction action = ActivateDesktopAction, qreal relevance = 1.0) const;
RemoteMatch windowsMatch(const AbstractClient *client, const WindowsRunnerAction action = ActivateAction, qreal relevance = 1.0, Plasma::QueryMatch::Type type = Plasma::QueryMatch::ExactMatch) const;
bool actionSupported(const AbstractClient *client, const WindowsRunnerAction action) const;
};
}
#endif // WINDOWSRUNNER_H