KVIrc 5.2.6
Developer APIs
Idle.h
Go to the documentation of this file.
1#ifndef _IDLE_H_
2#define _IDLE_H_
3/*
4 * Idle.h - detect desktop idle time
5 * Copyright (C) 2003 Justin Karneges
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 *
21 */
22
23#include "kvi_settings.h"
24
25#include <QObject>
26#include <QCursor>
27#include <QDateTime>
28#include <QTimer>
29
30class IdlePlatform;
31
32class Idle : public QObject
33{
34 Q_OBJECT
35public:
36 Idle();
37 ~Idle();
38
39 bool isActive() const;
40 bool usingPlatform() const;
41 void start();
42 void stop();
43 int secondsIdle();
44
45signals:
46 void secondsIdle(int);
47
48private slots:
49 void doCheck();
50
51private:
52 class Private;
54};
55
57{
58public:
61
62 bool init() const;
63 int secondsIdle() const;
64
65private:
66 class Private;
67 Private * d;
68};
69
71{
72public:
74
76 QDateTime idleSince;
77
78 bool active;
80 QDateTime startTime;
81 QTimer checkTimer;
82};
83
84#endif
Definition Idle.h:57
Private * d
Definition Idle.h:67
bool init() const
Definition Idle_x11.cpp:28
~IdlePlatform()
Definition Idle_x11.cpp:27
int secondsIdle() const
Definition Idle_x11.cpp:29
IdlePlatform()
Definition Idle_x11.cpp:26
Definition Idle.h:71
QDateTime startTime
Definition Idle.h:80
Private()
Definition Idle.h:73
QTimer checkTimer
Definition Idle.h:81
int idleTime
Definition Idle.h:79
QPoint lastMousePos
Definition Idle.h:75
QDateTime idleSince
Definition Idle.h:76
bool active
Definition Idle.h:78
Definition Idle.h:33
void start()
Definition Idle.cpp:75
bool usingPlatform() const
Definition Idle.cpp:70
~Idle()
Definition Idle.cpp:51
void secondsIdle(int)
bool isActive() const
Definition Idle.cpp:65
void doCheck()
Definition Idle.cpp:135
Private * d
Definition Idle.h:53
Idle()
Definition Idle.cpp:30
int secondsIdle()
Definition Idle.cpp:95
void stop()
Definition Idle.cpp:90
This file contains compile time settings.