karm Library API Documentation

idletimedetector.h

00001 #ifndef KARM_IDLE_TIME_DETECTOR_H
00002 #define KARM_IDLE_TIME_DETECTOR_H
00003 
00004 #include <qobject.h>
00005 #include "config.h"     // HAVE_LIBXSS
00006 
00007 class QTimer;
00008 
00009 #ifdef HAVE_LIBXSS
00010  #include <X11/Xlib.h>
00011  #include <X11/Xutil.h>
00012  #include <X11/extensions/scrnsaver.h>
00013 #endif // HAVE_LIBXSS
00014 
00015 // Seconds per minutes - useful for speeding debugging up!
00016 const int secsPerMinute = 60;
00017 
00018 // Minutes between each idle overrun test.
00019 const int testInterval= secsPerMinute * 1000;
00020 
00025 class IdleTimeDetector :public QObject
00026 {
00027 Q_OBJECT
00028 
00029 public:
00034   IdleTimeDetector(int maxIdle);
00035 
00041   bool isIdleDetectionPossible();
00042 
00043 signals:
00050   void extractTime(int minutes);
00051   
00055   void stopAllTimers();
00056 
00057 public slots:  
00062   void setMaxIdle(int maxIdle);
00063 
00067   void startIdleDetection();
00068   
00072   void stopIdleDetection();
00073 
00079   void toggleOverAllIdleDetection(bool);
00080   
00081   
00082 protected:
00083 #ifdef HAVE_LIBXSS
00084   void informOverrun(int idle);
00085 #endif // HAVE_LIBXSS
00086 
00087 protected slots:
00088   void check();
00089   
00090 private:
00091 #ifdef HAVE_LIBXSS
00092   XScreenSaverInfo *_mit_info;
00093 #endif
00094   bool _idleDetectionPossible;
00095   bool _overAllIdleDetect; // Based on preferences.
00096   int _maxIdle;
00097   QTimer *_timer;
00098 };
00099 
00100 #endif // KARM_IDLE_TIME_DETECTOR_H
KDE Logo
This file is part of the documentation for karm Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:37:52 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003