/* SPDX-FileCopyrightText: 2021 David Edmundson SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ #pragma once #include "kabstractidletimepoller_p.h" #include #include class IdleManagerKwin; class IdleManagerExt; class IdleTimeout; class Poller : public KAbstractIdleTimePoller { Q_OBJECT Q_PLUGIN_METADATA(IID KAbstractIdleTimePoller_iid FILE "wayland.json") Q_INTERFACES(KAbstractIdleTimePoller) public: explicit Poller(QObject *parent = nullptr); ~Poller() override; bool isAvailable() override; bool setUpPoller() override { return true; } void unloadPoller() override {} public Q_SLOTS: void addTimeout(int nextTimeout) override; void removeTimeout(int nextTimeout) override; QList timeouts() const override; int forcePollRequest() override; void catchIdleEvent() override; void stopCatchingIdleEvents() override; void simulateUserActivity() override; private: bool initWayland(); IdleTimeout* createTimeout(int timeout); QScopedPointer m_idleManagerKwin; QScopedPointer m_idleManagerExt; QHash> m_timeouts; QScopedPointer m_catchResumeTimeout; };