KWayland

seat.h
1 /*
2  SPDX-FileCopyrightText: 2014 Martin Gräßlin <[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_SEAT_H
7 #define WAYLAND_SEAT_H
8 
9 #include <QObject>
10 
11 #include <KWayland/Client/kwaylandclient_export.h>
12 
13 struct wl_seat;
14 struct wl_touch;
15 
16 namespace KWayland
17 {
18 namespace Client
19 {
20 
21 class EventQueue;
22 class Keyboard;
23 class Pointer;
24 class Touch;
25 
52 class KWAYLANDCLIENT_EXPORT Seat : public QObject
53 {
54  Q_OBJECT
58  Q_PROPERTY(bool keyboard READ hasKeyboard NOTIFY hasKeyboardChanged)
62  Q_PROPERTY(bool pointer READ hasPointer NOTIFY hasPointerChanged)
66  Q_PROPERTY(bool touch READ hasTouch NOTIFY hasTouchChanged)
72  Q_PROPERTY(QString name READ name NOTIFY nameChanged)
73 public:
74  explicit Seat(QObject *parent = nullptr);
75  virtual ~Seat();
76 
80  bool isValid() const;
86  void setup(wl_seat *seat);
95  void release();
113  void destroy();
114 
118  void setEventQueue(EventQueue *queue);
122  EventQueue *eventQueue();
123 
124  bool hasKeyboard() const;
125  bool hasPointer() const;
126  bool hasTouch() const;
127  QString name() const;
128  operator wl_seat*();
129  operator wl_seat*() const;
130 
139  Keyboard *createKeyboard(QObject *parent = nullptr);
148  Pointer *createPointer(QObject *parent = nullptr);
157  Touch *createTouch(QObject *parent = nullptr);
158 
159 Q_SIGNALS:
160  void hasKeyboardChanged(bool);
161  void hasPointerChanged(bool);
162  void hasTouchChanged(bool);
163  void nameChanged(const QString &name);
164 
168  void interfaceAboutToBeReleased();
172  void interfaceAboutToBeDestroyed();
173 
182  void removed();
183 
184 private:
185  class Private;
186  QScopedPointer<Private> d;
187 };
188 
189 }
190 }
191 
192 #endif
Wrapper class for wl_event_queue interface.
Definition: event_queue.h:55
Wrapper for the wl_touch interface.
Definition: touch.h:88
Wrapper for the wl_seat interface.
Definition: seat.h:52
Wrapper for the wl_keyboard interface.
Definition: keyboard.h:31
Wrapper for the wl_pointer interface.
Definition: pointer.h:32
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Sep 21 2020 22:50:48 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.