summaryrefslogtreecommitdiffstats
path: root/kdesktop/xautolock.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit4aed2c8219774f5d797760606b8489a92ddc5163 (patch)
tree3f8c130f7d269626bf6a9447407ef6c35954426a /kdesktop/xautolock.h
downloadtdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz
tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdesktop/xautolock.h')
-rw-r--r--kdesktop/xautolock.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/kdesktop/xautolock.h b/kdesktop/xautolock.h
new file mode 100644
index 000000000..aa618f252
--- /dev/null
+++ b/kdesktop/xautolock.h
@@ -0,0 +1,77 @@
+//===========================================================================
+//
+// This file is part of the KDE project
+//
+// Copyright (c) 1999 Martin R. Jones <mjones@kde.org>
+//
+
+#ifndef __XAUTOLOCK_H__
+#define __XAUTOLOCK_H__
+
+#include <qwidget.h>
+
+#include <X11/Xlib.h>
+
+//===========================================================================
+//
+// Detect user inactivity.
+// Named XAutoLock after the program that it is based on.
+//
+class XAutoLock : public QWidget
+{
+ Q_OBJECT
+public:
+ XAutoLock();
+ ~XAutoLock();
+
+ //-----------------------------------------------------------------------
+ //
+ // The time in seconds of continuous inactivity.
+ //
+ void setTimeout(int t);
+
+ void setDPMS(bool s);
+
+ //-----------------------------------------------------------------------
+ //
+ // Start watching Activity
+ //
+ void start();
+
+ //-----------------------------------------------------------------------
+ //
+ // Stop watching Activity
+ //
+ void stop();
+
+ //-----------------------------------------------------------------------
+ //
+ // Should be called only from a slot connected to the timeout() signal. Will
+ // result in the timeout() signal being emitted again with a delay (i.e. postponed).
+ //
+ void postpone();
+
+ // internal
+ void resetTrigger();
+ // internal
+ void setTrigger( time_t );
+ // internal
+ bool ignoreWindow( WId );
+
+signals:
+ void timeout();
+
+protected:
+ virtual void timerEvent(QTimerEvent *ev);
+ virtual bool x11Event( XEvent* );
+
+protected:
+ int mTimerId;
+ int mTimeout;
+ time_t mTrigger;
+ bool mActive;
+ time_t mLastTimeout;
+ bool mDPMS;
+};
+
+#endif