Debian Codegraph @

src/wayland/keyboard_shortcuts_inhibit_v1.h

raw symbols SCIP
1 /*
2 SPDX-FileCopyrightText: 2020 Benjamin Port <[email protected]>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6
7 #pragma once
8
9 #include "seat.h"
10 #include "surface.h"
11
12 #include <QObject>
13
14 namespace KWin
15 {
16
17 /**
18 * This is an implementation of wayland-protocols/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml
19 *
20 * This class is just the means to get a @class KeyboardShortcutsInhibitorV1Interface, which is
21 * the class that will have all of the information we need.
22 */
23
24 class KeyboardShortcutsInhibitManagerV1Interface;
25 class KeyboardShortcutsInhibitorV1InterfacePrivate;
26 class KeyboardShortcutsInhibitManagerV1InterfacePrivate;
27
28 class KWIN_EXPORT KeyboardShortcutsInhibitorV1Interface : public QObject
29 {
30 Q_OBJECT
31
32 public:
33 ~KeyboardShortcutsInhibitorV1Interface() override;
34
35 SurfaceInterface *surface() const;
36 SeatInterface *seat() const;
37 void setActive(bool active);
38 bool isActive() const;
39
40 private:
41 friend class KeyboardShortcutsInhibitManagerV1InterfacePrivate;
42 explicit KeyboardShortcutsInhibitorV1Interface(SurfaceInterface *surface,
43 SeatInterface *seat,
44 KeyboardShortcutsInhibitManagerV1Interface *manager,
45 wl_resource *resource);
46 std::unique_ptr<KeyboardShortcutsInhibitorV1InterfacePrivate> d;
47 };
48
49 /**
50 * The KeyboardShortcutsInhibitManagerV1Interface allows clients to inhibit global shortcuts.
51 *
52 * KeyboardShortcutsInhibitManagerV1Interface corresponds to the wayland interface zwp_keyboard_shortcuts_inhibit_manager_v1.
53 */
54 class KWIN_EXPORT KeyboardShortcutsInhibitManagerV1Interface : public QObject
55 {
56 Q_OBJECT
57
58 public:
59 explicit KeyboardShortcutsInhibitManagerV1Interface(Display *d, QObject *parent = nullptr);
60 ~KeyboardShortcutsInhibitManagerV1Interface() override;
61
62 /**
63 * return shortucts inhibitor associated with surface and seat, if no shortcut are associated, return nullptr
64 */
65 KeyboardShortcutsInhibitorV1Interface *findInhibitor(SurfaceInterface *surface, SeatInterface *seat) const;
66
67 Q_SIGNALS:
68 /**
69 * This signal is emitted when a keyboard shortcuts inhibitor @a inhibitor is created.
70 */
71 void inhibitorCreated(KeyboardShortcutsInhibitorV1Interface *inhibitor);
72
73 private:
74 friend class KeyboardShortcutsInhibitorV1InterfacePrivate;
75 void removeInhibitor(SurfaceInterface *const surface, SeatInterface *const seat);
76 std::unique_ptr<KeyboardShortcutsInhibitManagerV1InterfacePrivate> d;
77 };
78
79 }