1 | /* This file is part of the KDE libraries |
2 | * SPDX-FileCopyrightText: 2009 Dario Freddi <drf at kde.org> |
3 | * |
4 | * SPDX-License-Identifier: LGPL-2.1-or-later |
5 | */ |
6 | |
7 | #ifndef KABSTRACTIDLETIMEPOLLER_P_H |
8 | #define KABSTRACTIDLETIMEPOLLER_P_H |
9 | |
10 | #include <kidletime_export.h> |
11 | |
12 | #include <QObject> |
13 | |
14 | #define KAbstractIdleTimePoller_iid "org.kde.kidletime.KAbstractIdleTimePoller" |
15 | |
16 | class KIDLETIME_EXPORT KAbstractIdleTimePoller : public QObject |
17 | { |
18 | Q_OBJECT |
19 | |
20 | public: |
21 | KAbstractIdleTimePoller(QObject *parent = nullptr); |
22 | ~KAbstractIdleTimePoller() override; |
23 | |
24 | virtual bool isAvailable() = 0; |
25 | virtual bool setUpPoller() = 0; |
26 | virtual void unloadPoller() = 0; |
27 | |
28 | public Q_SLOTS: |
29 | virtual void addTimeout(int nextTimeout) = 0; |
30 | virtual void removeTimeout(int nextTimeout) = 0; |
31 | |
32 | // TODO KF6: Make it a public method |
33 | virtual QList<int> timeouts() const = 0; // clazy:exclude=const-signal-or-slot |
34 | |
35 | virtual int forcePollRequest() = 0; |
36 | virtual void catchIdleEvent() = 0; |
37 | virtual void stopCatchingIdleEvents() = 0; |
38 | virtual void simulateUserActivity() = 0; |
39 | |
40 | Q_SIGNALS: |
41 | void resumingFromIdle(); |
42 | void timeoutReached(int msec); |
43 | }; |
44 | |
45 | Q_DECLARE_INTERFACE(KAbstractIdleTimePoller, KAbstractIdleTimePoller_iid) |
46 | |
47 | #endif /* KABSTRACTIDLETIMEPOLLER_P_H */ |
48 | |