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 #include <fixx11h.h> 00014 #endif // HAVE_LIBXSS 00015 00016 // Seconds per minutes - useful for speeding debugging up! 00017 const int secsPerMinute = 60; 00018 00019 // Minutes between each idle overrun test. 00020 const int testInterval= secsPerMinute * 1000; 00021 00026 class IdleTimeDetector :public QObject 00027 { 00028 Q_OBJECT 00029 00030 public: 00035 IdleTimeDetector(int maxIdle); 00036 00042 bool isIdleDetectionPossible(); 00043 00044 signals: 00051 void extractTime(int minutes); 00052 00056 void stopAllTimers(); 00057 00058 public slots: 00063 void setMaxIdle(int maxIdle); 00064 00068 void startIdleDetection(); 00069 00073 void stopIdleDetection(); 00074 00080 void toggleOverAllIdleDetection(bool); 00081 00082 00083 protected: 00084 #ifdef HAVE_LIBXSS 00085 void informOverrun(int idle); 00086 #endif // HAVE_LIBXSS 00087 00088 protected slots: 00089 void check(); 00090 00091 private: 00092 #ifdef HAVE_LIBXSS 00093 XScreenSaverInfo *_mit_info; 00094 #endif 00095 bool _idleDetectionPossible; 00096 bool _overAllIdleDetect; // Based on preferences. 00097 int _maxIdle; 00098 QTimer *_timer; 00099 }; 00100 00101 #endif // KARM_IDLE_TIME_DETECTOR_H
KDE Logo
This file is part of the documentation for karm Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Oct 1 15:19:01 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003