1 //===========================================================================
3 // This file is part of the KDE project
5 // Copyright 1999 Martin R. Jones <mjones@kde.org>
8 #ifndef __XAUTOLOCK_H__
9 #define __XAUTOLOCK_H__
11 #include <config-xautolock.h>
16 #ifdef HAVE_XSCREENSAVER
17 # include <X11/extensions/scrnsaver.h>
21 //===========================================================================
23 // Detect user inactivity.
24 // Named XAutoLock after the program that it is based on.
26 class XAutoLock
: public QWidget
33 //-----------------------------------------------------------------------
35 // The time in seconds of continuous inactivity.
36 // Need to call start() again afterwards.
38 void setTimeout(int t
);
42 //-----------------------------------------------------------------------
44 // Start watching Activity
48 //-----------------------------------------------------------------------
50 // Stop watching Activity
54 //-----------------------------------------------------------------------
56 // Should be called only from a slot connected to the timeout() signal. Will
57 // result in the timeout() signal being emitted again with a delay (i.e. postponed).
64 void setTrigger( int );
66 bool ignoreWindow( WId
);
74 virtual void timerEvent(QTimerEvent
*ev
);
75 virtual bool x11Event( XEvent
* );
85 #ifdef HAVE_XSCREENSAVER
86 XScreenSaverInfo
*mMitInfo
;