ktimetracker
desktoptracker.h
Go to the documentation of this file.00001 /* 00002 * Copyright (C) 2003 by Tomas Pospisek <tpo@sourcepole.ch> 00003 * 2007 the ktimetracker developers 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program; if not, write to the 00017 * Free Software Foundation, Inc. 00018 * 51 Franklin Street, Fifth Floor 00019 * Boston, MA 02110-1301 USA. 00020 * 00021 */ 00022 00023 #ifndef KARM_DESKTOP_TRACKER_H 00024 #define KARM_DESKTOP_TRACKER_H 00025 00026 #include <QObject> 00027 #include <QVector> 00028 00029 #include "desktoplist.h" 00030 00031 class Task; 00032 class QTimer; 00033 00034 typedef QVector<Task *> TaskVector; 00035 const int maxDesktops = 20; 00036 00042 class DesktopTracker : public QObject 00043 { 00044 Q_OBJECT 00045 00046 public: 00047 DesktopTracker(); 00054 QString startTracking(); 00055 void registerForDesktops( Task* task, DesktopList dl ); 00056 int desktopCount() const { return mDesktopCount; } 00057 00058 private: // member variables 00059 00060 // define vectors for at most 16 virtual desktops 00061 // E.g.: desktopTrackerStop[3] contains a vector with 00062 // all tasks to be notified, when switching to/from desk 3. 00063 TaskVector mDesktopTracker[maxDesktops]; 00064 int mPreviousDesktop; 00065 int mDesktopCount; 00066 int mDesktop; 00067 QTimer *mTimer; 00068 00069 Q_SIGNALS: 00070 void reachedActiveDesktop( Task* task ); 00071 void leftActiveDesktop( Task* task ); 00072 00073 public Q_SLOTS: 00074 void handleDesktopChange( int desktop ); 00075 00076 private Q_SLOTS: 00077 void changeTimers(); 00078 }; 00079 00080 #endif // KARM_DESKTOP_TRACKER_H
KDE 4.2 API Reference