KWayland

keystate.h
1 /*
2  SPDX-FileCopyrightText: 2019 Aleix Pol Gonzalez <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #ifndef WAYLAND_KEYSTATE_H
7 #define WAYLAND_KEYSTATE_H
8 
9 #include <QObject>
10 
11 #include "KWayland/Client/kwaylandclient_export.h"
12 
13 struct org_kde_kwin_keystate;
14 
15 namespace KWayland
16 {
17 namespace Client
18 {
19 class EventQueue;
20 
21 class KWAYLANDCLIENT_EXPORT Keystate : public QObject
22 {
23  Q_OBJECT
24 public:
25  enum class Key {
26  CapsLock = 0,
27  NumLock = 1,
28  ScrollLock = 2,
29  };
30  Q_ENUM(Key)
31  enum State {
32  Unlocked = 0,
33  Latched = 1,
34  Locked = 2,
35  };
36  Q_ENUM(State)
37 
38  Keystate(QObject *parent);
39  ~Keystate() override;
40 
41  void setEventQueue(EventQueue *queue);
42 
43  void destroy();
44  void setup(org_kde_kwin_keystate *keystate);
45 
46  void fetchStates();
47 
48 Q_SIGNALS:
49  /**
50  * State of the @p key changed to @p state
51  */
52  void stateChanged(Key key, State state);
53 
54  /**
55  * The corresponding global for this interface on the Registry got removed.
56  **/
57  void removed();
58 
59 private:
60  class Private;
62 };
63 
64 }
65 }
66 
67 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Jan 30 2023 03:56:24 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.