karm

desktoptracker.h
00001 #ifndef KARM_DESKTOP_TRACKER_H
00002 #define KARM_DESKTOP_TRACKER_H
00003 
00004 #include <vector>
00005 
00006 #include <kwinmodule.h>
00007 
00008 #include "desktoplist.h"
00009 
00010 class Task;
00011 class TQTimer;
00012 
00013 typedef std::vector<Task *> TaskVector;
00014 const int maxDesktops = 20;
00015 
00021 class DesktopTracker: public TQObject
00022 {
00023   Q_OBJECT
00024   TQ_OBJECT
00025 
00026   public:
00027     DesktopTracker();
00028     void printTrackers();
00029     TQString startTracking();
00030     void registerForDesktops( Task* task, DesktopList dl );
00031     int desktopCount() const { return _desktopCount; };
00032 
00033   private: // member variables
00034     KWinModule kWinModule;
00035 
00036     // define vectors for at most 16 virtual desktops
00037     // E.g.: desktopTrackerStop[3] contains a vector with
00038     // all tasks to be notified, when switching to/from desk 3.
00039     TaskVector desktopTracker[maxDesktops];
00040     int _previousDesktop;
00041     int _desktopCount;
00042     int _desktop;
00043     TQTimer *_timer;
00044 
00045   signals:
00046     void reachedtActiveDesktop( Task* task );
00047     void leftActiveDesktop( Task* task );
00048 
00049   public slots:
00050     void handleDesktopChange( int desktop );
00051 
00052   private slots:
00053     void changeTimers();
00054 };
00055 
00056 #endif // KARM_DESKTOP_TRACKER_H