KIdleTime

poller.h
1 /*
2  SPDX-FileCopyrightText: 2021 David Edmundson <davidedmundson@kde.org>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #pragma once
7 
8 #include "kabstractidletimepoller_p.h"
9 
10 #include <QHash>
11 #include <memory>
12 
13 class IdleManagerKwin;
14 class IdleManagerExt;
15 
16 class IdleTimeout;
17 
18 class Poller : public KAbstractIdleTimePoller
19 {
20  Q_OBJECT
21  Q_PLUGIN_METADATA(IID KAbstractIdleTimePoller_iid FILE "wayland.json")
22  Q_INTERFACES(KAbstractIdleTimePoller)
23 
24 public:
25  explicit Poller(QObject *parent = nullptr);
26  ~Poller() override;
27 
28  bool isAvailable() override;
29  bool setUpPoller() override {
30  return true;
31  }
32  void unloadPoller() override {}
33 
34 public Q_SLOTS:
35  void addTimeout(int nextTimeout) override;
36  void removeTimeout(int nextTimeout) override;
37  QList<int> timeouts() const override;
38  int forcePollRequest() override;
39  void catchIdleEvent() override;
40  void stopCatchingIdleEvents() override;
41  void simulateUserActivity() override;
42 
43 private:
44  bool initWayland();
45  IdleTimeout* createTimeout(int timeout);
46 
47  QScopedPointer<IdleManagerKwin> m_idleManagerKwin;
48  QScopedPointer<IdleManagerExt> m_idleManagerExt;
50  QScopedPointer<IdleTimeout> m_catchResumeTimeout;
51 
52 };
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Thu Feb 15 2024 04:07:39 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.