~ubuntu-branches/ubuntu/precise/kactivities/precise-proposed

« back to all changes in this revision

Viewing changes to lib/controller.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-13 11:53:27 UTC
  • Revision ID: package-import@ubuntu.com-20111213115327-vqhdel92qx65us8y
Tags: upstream-4.7.90
ImportĀ upstreamĀ versionĀ 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2010 Ivan Cukic <ivan.cukic(at)kde.org>
 
3
 *
 
4
 * This library is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU Library General Public
 
6
 * License version 2 as published by the Free Software Foundation.
 
7
 *
 
8
 * This library 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 GNU
 
11
 * Library General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Library General Public License
 
14
 * along with this library; see the file COPYING.LIB.  If not, write to
 
15
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
16
 * Boston, MA 02110-1301, USA.
 
17
 */
 
18
 
 
19
#include "controller.h"
 
20
#include "consumer_p.h"
 
21
#include "manager_p.h"
 
22
 
 
23
#include <QObject>
 
24
 
 
25
#include <kdebug.h>
 
26
 
 
27
namespace KActivities {
 
28
 
 
29
class ControllerPrivate: public QObject {
 
30
public:
 
31
    ControllerPrivate(Controller * parent)
 
32
        : q(parent)
 
33
    {
 
34
    }
 
35
 
 
36
private:
 
37
    Controller * const q;
 
38
};
 
39
 
 
40
Controller::Controller(QObject * parent)
 
41
    : Consumer(parent), d(new ControllerPrivate(this))
 
42
{
 
43
}
 
44
 
 
45
Controller::~Controller()
 
46
{
 
47
    delete d;
 
48
}
 
49
 
 
50
void Controller::setActivityName(const QString & id, const QString & name)
 
51
{
 
52
    Manager::self()->SetActivityName(id, name);
 
53
}
 
54
 
 
55
void Controller::setActivityIcon(const QString & id, const QString & icon)
 
56
{
 
57
    Manager::self()->SetActivityIcon(id, icon);
 
58
}
 
59
 
 
60
bool Controller::setCurrentActivity(const QString & id)
 
61
{
 
62
    return Manager::self()->SetCurrentActivity(id);
 
63
}
 
64
 
 
65
QString Controller::addActivity(const QString & name)
 
66
{
 
67
    return Manager::self()->AddActivity(name);
 
68
}
 
69
 
 
70
void Controller::removeActivity(const QString & id)
 
71
{
 
72
    Manager::self()->RemoveActivity(id);
 
73
}
 
74
 
 
75
void Controller::stopActivity(const QString & id)
 
76
{
 
77
    Manager::self()->StopActivity(id);
 
78
}
 
79
 
 
80
void Controller::startActivity(const QString & id)
 
81
{
 
82
    Manager::self()->StartActivity(id);
 
83
}
 
84
 
 
85
} // namespace KActivities
 
86
 
 
87
#include "controller.moc"