2
* Copyright (c) 2010, 2011, 2012 Ivan Cukic <ivan.cukic(at)kde.org>
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.
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.
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.
19
#ifndef ACTIVITIES_CONTROLLER_H
20
#define ACTIVITIES_CONTROLLER_H
25
#include <QStringList>
30
#include "kactivities_export.h"
32
namespace KActivities {
34
class ControllerPrivate;
37
* This class provides methods for controlling and managing
40
* @see Consumer for info about activities
44
class KACTIVITIES_EXPORT Controller: public Consumer
48
Q_PROPERTY(QString currentActivity READ currentActivity WRITE setCurrentActivity)
51
explicit Controller(QObject * parent = 0 /*nullptr*/);
56
* Sets the name of the specified activity
57
* @param id id of the activity
58
* @param name name to be set
60
void setActivityName(const QString & id, const QString & name);
63
* Sets the icon of the specified activity
64
* @param id id of the activity
65
* @param icon icon to be set - freedesktop.org name or file path
67
void setActivityIcon(const QString & id, const QString & icon);
70
* Sets whether the activity should be encrypted
71
* @param id id of the activity
72
* @param encrypted should the activity be encrypted
75
void setActivityEncrypted(const QString & id, bool encrypted);
78
* Sets the current activity
79
* @param id id of the activity to make current
80
* @returns true if successful
82
bool setCurrentActivity(const QString & id);
86
* @param name name of the activity
87
* @returns id of the newly created activity
89
QString addActivity(const QString & name);
92
* Removes the specified activity
93
* @param id id of the activity to delete
95
void removeActivity(const QString & id);
99
* @param id id of the activity to stop
101
void stopActivity(const QString & id);
104
* Starts the activity
105
* @param id id of the activity to start
107
void startActivity(const QString & id);
110
ControllerPrivate * const d;
113
} // namespace KActivities
115
#endif // ACTIVITIES_CONTROLLER_H