delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / workspace / plasma / dataengines / tasks / tasksengine.h
blobfcb3201b0abdd10abeef4710e1dd2f03c71cfad0
1 /*
2 * Copyright 2007 Robert Knight <robertknight@gmail.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License version 2 as
6 * published by the Free Software Foundation
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details
13 * You should have received a copy of the GNU Library General Public
14 * License along with this program; if not, write to the
15 * Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef TASKSENGINE_H
20 #define TASKSENGINE_H
22 // plasma
23 #include <Plasma/DataEngine>
24 #include <Plasma/Service>
26 // libtaskmanager
27 #include <taskmanager/taskmanager.h>
28 using TaskManager::StartupPtr;
29 using TaskManager::TaskPtr;
31 /**
32 * Tasks Data Engine
34 * This engine provides information regarding tasks (windows that are currently open)
35 * as well as startup tasks (windows that are about to open).
36 * Each task and startup is represented by a unique source. Sources are added and removed
37 * as windows are opened and closed. You cannot request a customized source.
39 * A service is also provided for each task. It exposes some operations that can be
40 * performed on the windows (ex: maximize, minimize, activate).
42 * The data and operations are provided and handled by the taskmanager library.
43 * It should be noted that only a subset of data and operations are exposed.
45 class TasksEngine : public Plasma::DataEngine
48 Q_OBJECT
50 public:
51 TasksEngine(QObject *parent, const QVariantList &args);
52 ~TasksEngine();
53 Plasma::Service *serviceForSource(const QString &name);
55 protected:
56 static const QString getStartupName(StartupPtr startup);
57 static const QString getTaskName(TaskPtr task);
58 virtual void init();
60 private slots:
61 void startupAdded(StartupPtr startup);
62 void startupRemoved(StartupPtr startup);
63 void taskAdded(TaskPtr task);
64 void taskRemoved(TaskPtr task);
66 private:
67 friend class TaskSource;
68 void addStartup(StartupPtr startup);
69 void addTask(TaskPtr task);
72 #endif // TASKSENGINE_H