delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / workspace / plasma / dataengines / tasks / tasksource.h
blob76b6088d96a15e81bb01e87e3f63e58fc49d35e5
1 /*
2 * Copyright 2008 Alain Boyer <alainboyer@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 TASKSOURCE_H
20 #define TASKSOURCE_H
22 // plasma
23 #include <Plasma/DataContainer>
25 // libtaskmanager
26 #include <taskmanager/taskmanager.h>
27 using TaskManager::StartupPtr;
28 using TaskManager::TaskPtr;
30 /**
31 * Task Source
33 * This custom DataContainer represents a task or startup task as a unique source.
34 * It holds a shared pointer to the task or startup task and is responsible for setting
35 * and updating the data exposed by the source.
37 class TaskSource : public Plasma::DataContainer
40 Q_OBJECT
42 public:
43 TaskSource(StartupPtr startup, QObject *parent);
44 TaskSource(TaskPtr task, QObject *parent);
45 ~TaskSource();
47 protected:
48 Plasma::Service *createService();
49 TaskPtr getTask();
50 bool isTask();
52 private slots:
53 void updateStartup(::TaskManager::TaskChanges startupChanges);
54 void updateTask(::TaskManager::TaskChanges taskChanges);
55 void updateDesktop(int desktop);
57 private:
58 friend class TasksEngine;
59 friend class TaskJob;
60 StartupPtr m_startup;
61 TaskPtr m_task;
62 bool m_isTask;
66 #endif // TASKSOURCE_H