KWayland

dpms.h
1 /*
2  SPDX-FileCopyrightText: 2015 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_DPMS_H
7 #define KWAYLAND_CLIENT_DPMS_H
8 
9 #include <QObject>
10 
11 #include <KWayland/Client/kwaylandclient_export.h>
12 
13 struct org_kde_kwin_dpms;
14 struct org_kde_kwin_dpms_manager;
15 
16 namespace KWayland
17 {
18 namespace Client
19 {
20 
21 class EventQueue;
22 class Dpms;
23 class Output;
24 
49 class KWAYLANDCLIENT_EXPORT DpmsManager : public QObject
50 {
51  Q_OBJECT
52 public:
59  explicit DpmsManager(QObject *parent = nullptr);
60  virtual ~DpmsManager();
61 
65  bool isValid() const;
71  void setup(org_kde_kwin_dpms_manager *manager);
77  void release();
92  void destroy();
93 
97  void setEventQueue(EventQueue *queue);
101  EventQueue *eventQueue();
102 
103  Dpms *getDpms(Output *output, QObject *parent = nullptr);
104 
105  operator org_kde_kwin_dpms_manager*();
106  operator org_kde_kwin_dpms_manager*() const;
107 
108 Q_SIGNALS:
115  void removed();
116 
117 private:
118  class Private;
120 };
121 
131 class KWAYLANDCLIENT_EXPORT Dpms : public QObject
132 {
133  Q_OBJECT
134 public:
135  virtual ~Dpms();
136 
137  enum class Mode {
138  On,
139  Standby,
140  Suspend,
141  Off
142  };
143 
149  void setup(org_kde_kwin_dpms *dpms);
155  void release();
172  void destroy();
176  bool isValid() const;
177 
181  QPointer<Output> output() const;
182 
189  bool isSupported() const;
196  Mode mode() const;
197 
204  void requestMode(Mode mode);
205 
206  operator org_kde_kwin_dpms*();
207  operator org_kde_kwin_dpms*() const;
208 
209 Q_SIGNALS:
214  void supportedChanged();
219  void modeChanged();
220 
221 private:
222  friend class DpmsManager;
223  explicit Dpms(const QPointer<Output> &o, QObject *parent = nullptr);
224  class Private;
226 };
227 
228 }
229 }
230 
231 Q_DECLARE_METATYPE(KWayland::Client::Dpms::Mode)
232 
233 #endif
Wrapper class for wl_event_queue interface.
Definition: event_queue.h:55
Wrapper for the wl_output interface.
Definition: output.h:55
QCA_EXPORT bool isSupported(const char *features, const QString &provider=QString())
This class is a factory for Dpms instances.
Definition: dpms.h:49
Power management for monitors.
Definition: dpms.h:131
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 12 2020 22:50:22 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.