/usr/include/taskmanager/taskmanager.h is in kde-workspace-dev 4:4.11.8-0ubuntu6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | /*****************************************************************
Copyright (c) 2000-2001 Matthias Elter <elter@kde.org>
Copyright (c) 2001 Richard Moore <rich@kde.org>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************/
#ifndef TASKMANAGER_H
#define TASKMANAGER_H
#include <QHash>
#include <QSet>
#include <QVector>
#include <KSharedPtr>
#include <KWindowSystem>
struct QUuid;
namespace TaskManager
{
typedef QSet<WId> WindowList;
class Task;
class Startup;
enum TaskChange { TaskUnchanged = 0,
NameChanged = 1,
StateChanged = 2,
DesktopChanged = 32,
GeometryChanged = 64,
WindowTypeChanged = 128,
ActionsChanged = 256,
TransientsChanged = 512,
IconChanged = 1024,
ActivitiesChanged = 4096,
AttentionChanged = 8192,
ClassChanged = 0x4000,
EverythingChanged = 0xffff
};
Q_DECLARE_FLAGS(TaskChanges, TaskChange)
} // namespace TaskManager
// Own
#include <taskmanager/startup.h>
#include <taskmanager/task.h>
#include <taskmanager/taskmanager_export.h>
namespace TaskManager
{
/**
* A generic API for task managers. This class provides an easy way to
* build NET compliant task managers. It provides support for startup
* notification, virtual desktops and the full range of WM properties.
*
* @see Task
* @see Startup
*/
class TASKMANAGER_EXPORT TaskManager : public QObject
{
Q_OBJECT
Q_PROPERTY(int currentDesktop READ currentDesktop)
Q_PROPERTY(int numberOfDesktops READ numberOfDesktops)
Q_PROPERTY(QString currentActivity READ currentActivity NOTIFY activityChanged)
public:
static TaskManager* self();
TaskManager();
~TaskManager();
/**
* Returns the task for a given WId, or 0 if there is no such task.
*/
Task *findTask(WId w);
/**
* Returns the task for a given location, or 0 if there is no such task.
*/
Task *findTask(int desktop, const QPoint& p);
/**
* Returns a list of all current tasks.
*/
QHash<WId, Task *> tasks() const;
/**
* Returns a list of all current startups.
*/
QList<Startup *> startups() const;
/**
* Returns the name of the nth desktop.
*/
QString desktopName(int n) const;
/**
* Returns the number of virtual desktops.
*/
int numberOfDesktops() const;
/**
* Returns the number of the current desktop.
*/
int currentDesktop() const;
/**
* Returns the number of the current desktop.
*/
QString currentActivity() const;
/**
* Returns true if the specified task is on top.
*/
bool isOnTop(const Task*) const;
/**
* Tells the task manager whether or not we care about geometry
* updates. This generates a lot of activity so should only be used
* when necessary.
*/
void setTrackGeometry(bool track, const QUuid &token);
/**
* @return true if geometry tracking is on
*/
bool trackGeometry() const;
/**
* Returns whether the Window with WId wid is on the screen screen
*/
static bool isOnScreen(int screen, const WId wid);
Q_SIGNALS:
/**
* Emitted when a new task has started.
*/
void taskAdded(::TaskManager::Task *task);
/**
* Emitted when a task has terminated.
*/
void taskRemoved(::TaskManager::Task *task);
/**
* Emitted when a new task is expected.
*/
void startupAdded(::TaskManager::Startup *startup);
/**
* Emitted when a startup item should be removed. This could be because
* the task has started, because it is known to have died, or simply
* as a result of a timeout.
*/
void startupRemoved(::TaskManager::Startup *startup);
/**
* Emitted when the current desktop changes.
*/
void desktopChanged(int desktop);
/**
* Emitted when the current activity changes.
*/
void activityChanged(const QString &activity);
/**
* Emitted when a window changes desktop.
*/
void windowChanged(::TaskManager::Task *task, ::TaskManager::TaskChanges change);
protected Q_SLOTS:
//* @internal
void windowAdded(WId);
//* @internal
void windowRemoved(WId);
//* @internal
void windowChanged(WId, const unsigned long*);
//* @internal
void activeWindowChanged(WId);
//* @internal
void currentDesktopChanged(int);
//* @internal
void killStartup(const KStartupInfoId&);
//* @internal
void gotNewStartup(const KStartupInfoId&, const KStartupInfoData&);
//* @internal
void gotStartupChange(const KStartupInfoId&, const KStartupInfoData&);
//* @internal
void taskChanged(::TaskManager::TaskChanges changes);
protected Q_SLOTS:
void configureStartup();
private:
class Private;
Private * const d;
Q_PRIVATE_SLOT(d, void onAppExitCleanup())
};
} // TaskManager namespace
Q_DECLARE_OPERATORS_FOR_FLAGS(TaskManager::TaskChanges)
#endif
|