KWin
Loading...
Searching...
No Matches
windowsrunnerinterface.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2009 Martin Gräßlin <kde@martin-graesslin.com>
6 SPDX-FileCopyrightText: 2020 Benjamin Port <benjamin.port@enioka.com>
7
8 SPDX-License-Identifier: GPL-2.0-or-later
9*/
10
11#pragma once
12
13#pragma once
14
15#include "dbusutils_p.h"
16#include "plugin.h"
17
18#include <QDBusArgument>
19#include <QDBusContext>
20#include <QDBusMessage>
21#include <QObject>
22#include <QString>
23
24namespace KWin
25{
26class VirtualDesktop;
27class Window;
28
29class WindowsRunner : public Plugin, protected QDBusContext
30{
31 Q_OBJECT
32 Q_CLASSINFO("D-Bus Interface", "org.kde.KWin.WindowsRunner")
33public:
34 explicit WindowsRunner();
35
37 {
38 return {};
39 }
40 RemoteMatches Match(const QString &searchTerm);
41 void Run(const QString &id, const QString &actionId);
42
43private:
44 enum WindowsRunnerAction {
45 // Windows related actions
46 ActivateAction,
47 CloseAction,
48 MinimizeAction,
49 MaximizeAction,
50 FullscreenAction,
51 ShadeAction,
52 KeepAboveAction,
53 KeepBelowAction,
54 // Desktop related actions
55 ActivateDesktopAction,
56 };
57
58 RemoteMatch desktopMatch(const VirtualDesktop *desktop, const WindowsRunnerAction action = ActivateDesktopAction, qreal relevance = 1.0) const;
59 RemoteMatch windowsMatch(const Window *window, const WindowsRunnerAction action = ActivateAction, qreal relevance = 1.0, qreal categoryRelevance = HighestCategoryRelevance) const;
60 bool actionSupported(const Window *window, const WindowsRunnerAction action) const;
61};
62}
RemoteMatches Match(const QString &searchTerm)
void Run(const QString &id, const QString &actionId)
QList< RemoteMatch > RemoteMatches
Definition dbusutils_p.h:32
const qreal HighestCategoryRelevance
Definition dbusutils_p.h:18
QList< RemoteAction > RemoteActions
Definition dbusutils_p.h:41