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.0-only
5  */
6 
7 #ifndef MACPOLLER_H
8 #define MACPOLLER_H
9 
10 #include "abstractsystempoller.h"
11 
12 #include <Carbon/Carbon.h>
13 
14 class MacPoller: public AbstractSystemPoller
15 {
16  Q_OBJECT
17  Q_PLUGIN_METADATA(IID "org.kde.kidletime.AbstractSystemPoller" FILE "osx.json")
18  Q_INTERFACES(AbstractSystemPoller)
19 
20 public:
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 
30 public 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 
40 private Q_SLOTS:
41  int poll();
42 
43 private:
44  QList<int> m_timeouts;
45  EventLoopTimerRef m_timerRef;
46  int m_secondsIdle;
47  bool m_catch;
48 };
49 
50 #endif /* MACPOLLER_H */
Q_OBJECTQ_OBJECT
Q_INTERFACES(...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Jul 5 2020 22:49:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.