• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

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 #include <QtCore/QHash>
00029 #include <QtCore/QSet>
00030 #include <QtCore/QVector>
00031 
00032 #include <KDE/KSharedPtr>
00033 #include <KDE/KWindowSystem>
00034 
00035 class QUuid;
00036 
00037 namespace TaskManager
00038 {
00039 typedef QSet<WId> WindowList;
00040 
00041 class Task;
00042 typedef KSharedPtr<Task> TaskPtr;
00043 typedef QVector<TaskPtr> TaskList;
00044 typedef QHash<WId, TaskPtr> TaskDict;
00045 
00046 class Startup;
00047 typedef KSharedPtr<Startup> StartupPtr;
00048 typedef QVector<StartupPtr> StartupList;
00049 
00050 enum TaskChange { TaskUnchanged = 0,
00051                   NameChanged = 1,
00052                   StateChanged = 2,
00053                   DesktopChanged = 32,
00054                   GeometryChanged = 64,
00055                   WindowTypeChanged = 128,
00056                   ActionsChanged = 256,
00057                   TransientsChanged = 512,
00058                   IconChanged = 1024,
00059                   ColorChanged = 2048,
00060                   EverythingChanged = 0xffff
00061                 };
00062 Q_DECLARE_FLAGS(TaskChanges, TaskChange)
00063 } // namespace TaskManager
00064 
00065 // Own
00066 #include <taskmanager/startup.h>
00067 #include <taskmanager/task.h>
00068 #include <taskmanager/taskmanager_export.h>
00069 
00070 namespace TaskManager
00071 {
00072 
00081 class TASKMANAGER_EXPORT TaskManager : public QObject
00082 {
00083     Q_OBJECT
00084     Q_PROPERTY( int currentDesktop READ currentDesktop )
00085     Q_PROPERTY( int numberOfDesktops READ numberOfDesktops )
00086 
00087 public:
00088     static TaskManager* self();
00089 
00090     TaskManager();
00091     ~TaskManager();
00092 
00096     TaskPtr findTask(WId w);
00097 
00101     TaskPtr findTask(int desktop, const QPoint& p);
00102 
00106     TaskDict tasks() const;
00107 
00111     StartupList startups() const;
00112 
00116     QString desktopName(int n) const;
00117 
00121     int numberOfDesktops() const;
00122 
00126     int currentDesktop() const;
00127 
00131     bool isOnTop(const Task*) const;
00132 
00138     void setTrackGeometry(bool track, const QUuid &token);
00139 
00143     bool trackGeometry() const;
00144 
00148     static bool isOnScreen(int screen, const WId wid);
00149 
00150 Q_SIGNALS:
00154     void taskAdded(TaskPtr);
00155 
00159     void taskRemoved(TaskPtr);
00160 
00164     void startupAdded(StartupPtr);
00165 
00171     void startupRemoved(StartupPtr);
00172 
00176     void desktopChanged(int desktop);
00177 
00181     void windowChanged(TaskPtr task, ::TaskManager::TaskChanges change);
00182 
00183 protected Q_SLOTS:
00184     //* @internal
00185     void windowAdded(WId);
00186     //* @internal
00187     void windowRemoved(WId);
00188     //* @internal
00189     void windowChanged(WId, unsigned int);
00190 
00191     //* @internal
00192     void activeWindowChanged(WId);
00193     //* @internal
00194     void currentDesktopChanged(int);
00195     //* @internal
00196     void killStartup( const KStartupInfoId& );
00197     //* @internal
00198     void killStartup(StartupPtr);
00199 
00200     //* @internal
00201     void gotNewStartup( const KStartupInfoId&, const KStartupInfoData& );
00202     //* @internal
00203     void gotStartupChange( const KStartupInfoId&, const KStartupInfoData& );
00204 
00205     //* @internal
00206     void taskChanged(::TaskManager::TaskChanges changes);
00207 
00208 protected:
00209     void configureStartup();
00210 
00211 private:
00212     class Private;
00213     Private * const d;
00214 };
00215 
00216 } // TaskManager namespace
00217 
00218 Q_DECLARE_OPERATORS_FOR_FLAGS(TaskManager::TaskChanges)
00219 
00220 #endif

libtaskmanager

Skip menu "libtaskmanager"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal