KWayland

idleinhibit.h
1 /*
2  SPDX-FileCopyrightText: 2017 Martin Flöser <[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_IDLEINHIBIT_H
7 #define KWAYLAND_CLIENT_IDLEINHIBIT_H
8 
9 #include <QObject>
10 
11 #include <KWayland/Client/kwaylandclient_export.h>
12 
13 struct zwp_idle_inhibit_manager_v1;
14 struct zwp_idle_inhibitor_v1;
15 
16 namespace KWayland
17 {
18 namespace Client
19 {
20 
21 class EventQueue;
22 class Surface;
23 class IdleInhibitor;
24 
49 class KWAYLANDCLIENT_EXPORT IdleInhibitManager : public QObject
50 {
51  Q_OBJECT
52 public:
59  explicit IdleInhibitManager(QObject *parent = nullptr);
60  virtual ~IdleInhibitManager();
61 
67  void setup(zwp_idle_inhibit_manager_v1 *idleinhibitmanager);
71  bool isValid() const;
77  void release();
94  void destroy();
95 
99  void setEventQueue(EventQueue *queue);
103  EventQueue *eventQueue();
104 
112  IdleInhibitor *createInhibitor(Surface *surface, QObject *parent = nullptr);
113 
114  operator zwp_idle_inhibit_manager_v1*();
115  operator zwp_idle_inhibit_manager_v1*() const;
116 
117 Q_SIGNALS:
124  void removed();
125 
126 private:
127  class Private;
129 };
130 
149 class KWAYLANDCLIENT_EXPORT IdleInhibitor : public QObject
150 {
151  Q_OBJECT
152 public:
153  virtual ~IdleInhibitor();
154 
160  void setup(zwp_idle_inhibitor_v1 *idleinhibitor);
164  bool isValid() const;
170  void release();
187  void destroy();
188 
189  operator zwp_idle_inhibitor_v1*();
190  operator zwp_idle_inhibitor_v1*() const;
191 
192 private:
193  friend class IdleInhibitManager;
194  explicit IdleInhibitor(QObject *parent = nullptr);
195  class Private;
197 };
198 
199 
200 }
201 }
202 
203 #endif
Wrapper class for wl_event_queue interface.
Definition: event_queue.h:55
Wrapper for the wl_surface interface.
Definition: surface.h:44
An IdleInhibitor prevents the Output that the associated Surface is visible on from being set to a st...
Definition: idleinhibit.h:149
Wrapper for the zwp_idle_inhibit_manager_v1 interface.
Definition: idleinhibit.h:49
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 14 2020 22:49:57 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.