KWayland

dpms_interface.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 WAYLAND_SERVER_DPMS_INTERFACE_H
7 #define WAYLAND_SERVER_DPMS_INTERFACE_H
8 
9 #include <QObject>
10 
11 #include "global.h"
12 #include <KWayland/Server/kwaylandserver_export.h>
13 
14 namespace KWayland
15 {
16 namespace Server
17 {
18 class Display;
19 
20 /**
21  * @brief Global for server side Display Power Management Signaling interface.
22  *
23  * A DpmsManagerInterface allows a client to query the DPMS state
24  * on a given OutputInterface and request changes to it.
25  * Server-side the interaction happens only via the OutputInterface,
26  * for clients the Dpms class provides the API.
27  * This global implements org_kde_kwin_dpms_manager.
28  *
29  * To create a DpmsManagerInterface use:
30  * @code
31  * auto manager = display->createDpmsManager();
32  * manager->create();
33  * @endcode
34  *
35  * To interact with Dpms use one needs to mark it as enabled and set the
36  * proper mode on the OutputInterface.
37  * @code
38  * // We have our OutputInterface called output.
39  * output->setDpmsSupported(true);
40  * output->setDpmsMode(OutputInterface::DpmsMode::On);
41  * @endcode
42  *
43  * To connect to Dpms change requests use:
44  * @code
45  * connect(output, &OutputInterface::dpmsModeRequested,
46  * [] (KWayland::Server::OutputInterface::DpmsMode requestedMode) { qDebug() << "Mode change requested"; });
47  * @endcode
48  *
49  * @see Display
50  * @see OutputInterface
51  * @since 5.5
52  **/
53 class KWAYLANDSERVER_EXPORT DpmsManagerInterface : public Global
54 {
55  Q_OBJECT
56 public:
57  virtual ~DpmsManagerInterface();
58 
59 private:
60  explicit DpmsManagerInterface(Display *display, QObject *parent = nullptr);
61  friend class Display;
62  class Private;
63 };
64 
65 }
66 }
67 
68 #endif
Global for server side Display Power Management Signaling interface.
Class holding the Wayland server display loop.
Definition: display.h:86
Base class for all Globals.
Definition: global.h:46
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Sep 23 2021 22:51:07 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.