File indexing completed on 2024-12-08 03:39:45

0001 /* This file is part of the KDE libraries
0002  * SPDX-FileCopyrightText: 2009 Dario Freddi <drf at kde.org>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-or-later
0005  */
0006 
0007 #ifndef KABSTRACTIDLETIMEPOLLER_P_H
0008 #define KABSTRACTIDLETIMEPOLLER_P_H
0009 
0010 #include <kidletime_export.h>
0011 
0012 #include <QObject>
0013 
0014 #define KAbstractIdleTimePoller_iid "org.kde.kidletime.KAbstractIdleTimePoller"
0015 
0016 class KIDLETIME_EXPORT KAbstractIdleTimePoller : public QObject
0017 {
0018     Q_OBJECT
0019 
0020 public:
0021     KAbstractIdleTimePoller(QObject *parent = nullptr);
0022     ~KAbstractIdleTimePoller() override;
0023 
0024     virtual bool isAvailable() = 0;
0025     virtual bool setUpPoller() = 0;
0026     virtual void unloadPoller() = 0;
0027 
0028 public Q_SLOTS:
0029     virtual void addTimeout(int nextTimeout) = 0;
0030     virtual void removeTimeout(int nextTimeout) = 0;
0031 
0032     // TODO KF6: Make it a public method
0033     virtual QList<int> timeouts() const = 0; // clazy:exclude=const-signal-or-slot
0034 
0035     virtual int forcePollRequest() = 0;
0036     virtual void catchIdleEvent() = 0;
0037     virtual void stopCatchingIdleEvents() = 0;
0038     virtual void simulateUserActivity() = 0;
0039 
0040 Q_SIGNALS:
0041     void resumingFromIdle();
0042     void timeoutReached(int msec);
0043 };
0044 
0045 Q_DECLARE_INTERFACE(KAbstractIdleTimePoller, KAbstractIdleTimePoller_iid)
0046 
0047 #endif /* KABSTRACTIDLETIMEPOLLER_P_H */