~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to plasma/generic/dataengines/tasks/tasksource.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2008 Alain Boyer <alainboyer@gmail.com>
 
3
 *
 
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
 
7
 *
 
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
 
12
 *
 
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.
 
17
 */
 
18
 
 
19
#ifndef TASKSOURCE_H
 
20
#define TASKSOURCE_H
 
21
 
 
22
// plasma
 
23
#include <Plasma/DataContainer>
 
24
 
 
25
// libtaskmanager
 
26
#include <taskmanager/taskmanager.h>
 
27
using TaskManager::StartupPtr;
 
28
using TaskManager::TaskPtr;
 
29
 
 
30
/**
 
31
 * Task Source
 
32
 *
 
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.
 
36
 */
 
37
class TaskSource : public Plasma::DataContainer
 
38
{
 
39
 
 
40
    Q_OBJECT
 
41
 
 
42
    public:
 
43
        TaskSource(StartupPtr startup, QObject *parent);
 
44
        TaskSource(TaskPtr task, QObject *parent);
 
45
        ~TaskSource();
 
46
 
 
47
    protected:
 
48
        Plasma::Service *createService();
 
49
        TaskPtr getTask();
 
50
        bool isTask() const;
 
51
 
 
52
    private slots:
 
53
        void updateStartup(::TaskManager::TaskChanges startupChanges);
 
54
        void updateTask(::TaskManager::TaskChanges taskChanges);
 
55
        void updateDesktop(int desktop);
 
56
        void updateActivity();
 
57
 
 
58
    private:
 
59
        friend class TasksEngine;
 
60
        friend class TaskJob;
 
61
        StartupPtr m_startup;
 
62
        TaskPtr m_task;
 
63
        bool m_isTask;
 
64
 
 
65
};
 
66
 
 
67
#endif // TASKSOURCE_H