KIdleTime

macpoller.h
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 MACPOLLER_H
8#define MACPOLLER_H
9
10#include "kabstractidletimepoller_p.h"
11
12#include <Carbon/Carbon.h>
13
14class MacPoller : public KAbstractIdleTimePoller
15{
16 Q_OBJECT
17 Q_PLUGIN_METADATA(IID KAbstractIdleTimePoller_iid FILE "osx.json")
18 Q_INTERFACES(KAbstractIdleTimePoller)
19
20public:
21 MacPoller(QObject *parent = 0);
22 virtual ~MacPoller();
23
24 bool isAvailable();
25 bool setUpPoller();
26 void unloadPoller();
27
28 static pascal void IdleTimerAction(EventLoopTimerRef, EventLoopIdleTimerMessage inState, void *inUserData);
29
30public Q_SLOTS:
31 void addTimeout(int nextTimeout);
32 void removeTimeout(int nextTimeout);
33 QList<int> timeouts() const;
34 int forcePollRequest();
35 void catchIdleEvent();
36 void stopCatchingIdleEvents();
37 void simulateUserActivity();
38 void triggerResume();
39
40private Q_SLOTS:
41 int poll();
42
43private:
44 QList<int> m_timeouts;
45 EventLoopTimerRef m_timerRef;
46 int m_secondsIdle;
47 bool m_catch;
48};
49
50#endif /* MACPOLLER_H */
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:10:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.