KIdleTime

kidletime.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 KIDLETIME_H
8 #define KIDLETIME_H
9 
10 #include <QObject>
11 #include <QHash>
12 #include <kidletime_export.h>
13 class KIdleTimePrivate;
14 
29 class KIDLETIME_EXPORT KIdleTime : public QObject
30 {
31  Q_OBJECT
32  Q_DECLARE_PRIVATE(KIdleTime)
34 
35 public:
41  static KIdleTime *instance();
42 
46  virtual ~KIdleTime();
47 
53  int idleTime() const;
54 
63  QHash<int, int> idleTimeouts() const;
64 
72  void simulateUserActivity();
73 
74 public Q_SLOTS:
91  int addIdleTimeout(int msec);
92 
100  void removeIdleTimeout(int identifier);
101 
109  void removeAllIdleTimeouts();
110 
128  void catchNextResumeEvent();
129 
139  void stopCatchingResumeEvent();
140 
141 Q_SIGNALS:
148  void resumingFromIdle();
149 
162  void timeoutReached(int identifier);
163 
173  void timeoutReached(int identifier, int msec);
174 
175 private:
176  KIdleTime();
177 
178  KIdleTimePrivate *const d_ptr;
179 
180  Q_PRIVATE_SLOT(d_func(), void _k_resumingFromIdle())
181  Q_PRIVATE_SLOT(d_func(), void _k_timeoutReached(int))
182 
183 };
184 
185 #endif /* KIDLETIME_H */
KIdleTime is a singleton reporting information on idle time.
Definition: kidletime.h:29
Q_DISABLE_COPY(Class)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jun 5 2020 22:50:27 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.