libtaskmanager
taskmanager.h
Go to the documentation of this file.00001 /***************************************************************** 00002 00003 Copyright (c) 2000-2001 Matthias Elter <elter@kde.org> 00004 Copyright (c) 2001 Richard Moore <rich@kde.org> 00005 00006 Permission is hereby granted, free of charge, to any person obtaining a copy 00007 of this software and associated documentation files (the "Software"), to deal 00008 in the Software without restriction, including without limitation the rights 00009 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00010 copies of the Software, and to permit persons to whom the Software is 00011 furnished to do so, subject to the following conditions: 00012 00013 The above copyright notice and this permission notice shall be included in 00014 all copies or substantial portions of the Software. 00015 00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00017 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00018 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00019 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 00020 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00021 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00022 00023 ******************************************************************/ 00024 00025 #ifndef TASKMANAGER_H 00026 #define TASKMANAGER_H 00027 00028 // Own 00029 #include "startup.h" 00030 #include "task.h" 00031 00032 namespace TaskManager 00033 { 00034 00043 class KDE_EXPORT TaskManager : public QObject 00044 { 00045 Q_OBJECT 00046 Q_PROPERTY( int currentDesktop READ currentDesktop ) 00047 Q_PROPERTY( int numberOfDesktops READ numberOfDesktops ) 00048 00049 public: 00050 static TaskManager* self(); 00051 00052 TaskManager(); 00053 ~TaskManager(); 00054 00058 TaskPtr findTask(WId w); 00059 00063 TaskPtr findTask(int desktop, const QPoint& p); 00064 00068 TaskDict tasks() const; 00069 00073 StartupList startups() const; 00074 00078 QString desktopName(int n) const; 00079 00083 int numberOfDesktops() const; 00084 00088 int currentDesktop() const; 00089 00093 bool isOnTop(const Task*); 00094 00100 void trackGeometry(); 00101 00105 static bool isOnScreen( int screen, const WId wid ); 00106 00107 Q_SIGNALS: 00111 void taskAdded(TaskPtr); 00112 00116 void taskRemoved(TaskPtr); 00117 00121 void startupAdded(StartupPtr); 00122 00128 void startupRemoved(StartupPtr); 00129 00133 void desktopChanged(int desktop); 00134 00138 void windowChanged(TaskPtr); 00139 void windowChangedGeometry(TaskPtr); 00140 00141 protected Q_SLOTS: 00142 //* @internal 00143 void windowAdded(WId); 00144 //* @internal 00145 void windowRemoved(WId); 00146 //* @internal 00147 void windowChanged(WId, unsigned int); 00148 00149 //* @internal 00150 void activeWindowChanged(WId); 00151 //* @internal 00152 void currentDesktopChanged(int); 00153 //* @internal 00154 void killStartup( const KStartupInfoId& ); 00155 //* @internal 00156 void killStartup(StartupPtr); 00157 00158 //* @internal 00159 void gotNewStartup( const KStartupInfoId&, const KStartupInfoData& ); 00160 //* @internal 00161 void gotStartupChange( const KStartupInfoId&, const KStartupInfoData& ); 00162 00163 protected: 00164 void configure_startup(); 00165 void updateWindowPixmap(WId); 00166 00167 private: 00168 class Private; 00169 Private * const d; 00170 }; 00171 00172 } // TaskManager namespace 00173 00174 00175 #endif