KWaylandServer

keyboard_shortcuts_inhibit_v1_interface.h
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_interface.h"
10 #include "surface_interface.h"
11 #include <KWaylandServer/kwaylandserver_export.h>
12 #include <QObject>
13 
14 namespace KWaylandServer
15 {
16 /**
17  * This is an implementation of wayland-protocols/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml
18  *
19  * This class is just the means to get a @class KeyboardShortcutsInhibitorV1Interface, which is
20  * the class that will have all of the information we need.
21  */
22 
23 class KeyboardShortcutsInhibitManagerV1Interface;
24 class KeyboardShortcutsInhibitorV1InterfacePrivate;
25 class KeyboardShortcutsInhibitManagerV1InterfacePrivate;
26 
27 class KWAYLANDSERVER_EXPORT KeyboardShortcutsInhibitorV1Interface : public QObject
28 {
29  Q_OBJECT
30 
31 public:
33 
34  SurfaceInterface *surface() const;
35  SeatInterface *seat() const;
36  void setActive(bool active);
37  bool isActive() const;
38 
39 private:
40  friend class KeyboardShortcutsInhibitManagerV1InterfacePrivate;
42  SeatInterface *seat,
44  wl_resource *resource);
46 };
47 
48 /**
49  * The KeyboardShortcutsInhibitManagerV1Interface allows clients to inhibit global shortcuts.
50  *
51  * KeyboardShortcutsInhibitManagerV1Interface correponds to the wayland interface zwp_keyboard_shortcuts_inhibit_manager_v1.
52  */
53 class KWAYLANDSERVER_EXPORT KeyboardShortcutsInhibitManagerV1Interface : public QObject
54 {
55  Q_OBJECT
56 
57 public:
58  explicit KeyboardShortcutsInhibitManagerV1Interface(Display *d, QObject *parent = nullptr);
60 
61  /**
62  * return shortucts inhibitor associated with surface and seat, if no shortcut are associated, return nullptr
63  */
64  KeyboardShortcutsInhibitorV1Interface *findInhibitor(SurfaceInterface *surface, SeatInterface *seat) const;
65 
66 Q_SIGNALS:
67  /**
68  * This signal is emitted when a keyboard shortcuts inhibitor @a inhibitor is created.
69  */
70  void inhibitorCreated(KeyboardShortcutsInhibitorV1Interface *inhibitor);
71 
72 private:
73  friend class KeyboardShortcutsInhibitorV1InterfacePrivate;
74  void removeInhibitor(SurfaceInterface *const surface, SeatInterface *const seat);
76 };
77 
78 }
Represents a Seat on the Wayland Display.
This is an implementation of wayland-protocols/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts...
Class holding the Wayland server display loop.
Definition: display.h:47
The KeyboardShortcutsInhibitManagerV1Interface allows clients to inhibit global shortcuts.
Resource representing a wl_surface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 23:08:27 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.