KWayland

pointergestures.h
1 /*
2  SPDX-FileCopyrightText: 2016 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 KWAYLAND_CLIENT_POINTERGESTURES_H
7 #define KWAYLAND_CLIENT_POINTERGESTURES_H
8 
9 #include <QObject>
10 #include <QPointer>
11 
12 #include <KWayland/Client/kwaylandclient_export.h>
13 
14 struct zwp_pointer_gestures_v1;
15 struct zwp_pointer_gesture_swipe_v1;
16 struct zwp_pointer_gesture_pinch_v1;
17 
18 class QSizeF;
19 
20 namespace KWayland
21 {
22 namespace Client
23 {
24 
25 class EventQueue;
26 class PointerPinchGesture;
27 class Pointer;
28 class Surface;
29 class PointerSwipeGesture;
30 
57 class KWAYLANDCLIENT_EXPORT PointerGestures : public QObject
58 {
59  Q_OBJECT
60 public:
67  explicit PointerGestures(QObject *parent = nullptr);
68  virtual ~PointerGestures();
69 
75  void setup(zwp_pointer_gestures_v1 *pointergestures);
79  bool isValid() const;
85  void release();
101  void destroy();
102 
106  void setEventQueue(EventQueue *queue);
110  EventQueue *eventQueue();
111 
115  PointerSwipeGesture *createSwipeGesture(Pointer *pointer, QObject *parent = nullptr);
116 
120  PointerPinchGesture *createPinchGesture(Pointer *pointer, QObject *parent = nullptr);
121 
122  operator zwp_pointer_gestures_v1*();
123  operator zwp_pointer_gestures_v1*() const;
124 
125 Q_SIGNALS:
132  void removed();
133 
134 private:
135  class Private;
137 };
138 
162 class KWAYLANDCLIENT_EXPORT PointerSwipeGesture : public QObject
163 {
164  Q_OBJECT
165 public:
166  virtual ~PointerSwipeGesture();
167 
173  void setup(zwp_pointer_gesture_swipe_v1 *pointerswipegesture);
177  bool isValid() const;
183  void release();
200  void destroy();
201 
206  quint32 fingerCount() const;
207 
212  QPointer<Surface> surface() const;
213 
214  operator zwp_pointer_gesture_swipe_v1*();
215  operator zwp_pointer_gesture_swipe_v1*() const;
216 
217 Q_SIGNALS:
226  void started(quint32 serial, quint32 time);
227 
236  void updated(const QSizeF &delta, quint32 time);
237 
247  void ended(quint32 serial, quint32 time);
248 
258  void cancelled(quint32 serial, quint32 time);
259 
260 private:
261  friend class PointerGestures;
262  explicit PointerSwipeGesture(QObject *parent = nullptr);
263  class Private;
265 };
266 
290 class KWAYLANDCLIENT_EXPORT PointerPinchGesture : public QObject
291 {
292  Q_OBJECT
293 public:
294  virtual ~PointerPinchGesture();
295 
301  void setup(zwp_pointer_gesture_pinch_v1 *pointerpinchgesture);
305  bool isValid() const;
311  void release();
328  void destroy();
329 
334  quint32 fingerCount() const;
335 
340  QPointer<Surface> surface() const;
341 
342  operator zwp_pointer_gesture_pinch_v1*();
343  operator zwp_pointer_gesture_pinch_v1*() const;
344 
345 Q_SIGNALS:
354  void started(quint32 serial, quint32 time);
355 
366  void updated(const QSizeF &delta, qreal scale, qreal rotation, quint32 time);
367 
377  void ended(quint32 serial, quint32 time);
378 
388  void cancelled(quint32 serial, quint32 time);
389 
390 private:
391  friend class PointerGestures;
392  explicit PointerPinchGesture(QObject *parent = nullptr);
393  class Private;
395 };
396 
397 
398 }
399 }
400 
401 #endif
Wrapper class for wl_event_queue interface.
Definition: event_queue.h:55
This class is a wrapper for the zwp_pointer_gesture_swipe_v1 protocol.
Wrapper for the zwp_pointer_gestures_v1 interface.
This class is a wrapper for the zwp_pointer_gesture_pinch_v1 protocol.
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 Aug 3 2020 22:49:41 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.