Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
IdleNotifier.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include <phosphorwayland_export.h>
7
8#include <QObject>
9
10#include <chrono>
11#include <memory>
12
13namespace PhosphorWayland {
14
15class PHOSPHORWAYLAND_EXPORT IdleNotifier : public QObject
16{
17 Q_OBJECT
18 Q_PROPERTY(bool idle READ isIdle NOTIFY idleChanged)
19
20public:
21 explicit IdleNotifier(QObject* parent = nullptr);
22 ~IdleNotifier() override;
23
24 void setTimeout(std::chrono::milliseconds timeout);
25 std::chrono::milliseconds timeout() const;
26
27 bool isIdle() const;
28
29 static bool isSupported();
30
31Q_SIGNALS:
34 void idled();
35 void resumed();
36
37private:
38 class Private;
39 std::unique_ptr<Private> d;
40};
41
42} // namespace PhosphorWayland
Definition IdleNotifier.h:16
void setTimeout(std::chrono::milliseconds timeout)
std::chrono::milliseconds timeout() const
IdleNotifier(QObject *parent=nullptr)
Definition CompositorLost.h:11