~ubuntu-branches/ubuntu/saucy/kactivities/saucy-proposed

« back to all changes in this revision

Viewing changes to src/lib/core/controller.h

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman, Jonathan Riddell, Scott Kitterman
  • Date: 2012-11-20 13:47:27 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20121120134727-vqzk04slqjoay3de
Tags: 4:4.9.80-0ubuntu1
[ Jonathan Riddell ]
* New upstream beta release

[ Scott Kitterman ]
* Add new libkactivities-models1 library package (debian/control, .install,
  and .symbols)
* Add nepomuk-core-dev to build-depends
* Wildcard libkactivities6.install so that soversion changes don't cause
  build failures
* Update libkactivities6.symbols
* Update libkactivities-dev.install for new files for libkactivies-models
* Add new files to libkactivities-bin.install, including Activities kcm

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2010, 2011, 2012 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
#ifndef ACTIVITIES_CONTROLLER_H
 
20
#define ACTIVITIES_CONTROLLER_H
 
21
 
 
22
#include <QObject>
 
23
#include <QWidget>
 
24
#include <QString>
 
25
#include <QStringList>
 
26
 
 
27
#include "consumer.h"
 
28
 
 
29
#include <kurl.h>
 
30
#include "kactivities_export.h"
 
31
 
 
32
namespace KActivities {
 
33
 
 
34
class ControllerPrivate;
 
35
 
 
36
/**
 
37
 * This class provides methods for controlling and managing
 
38
 * the activities.
 
39
 *
 
40
 * @see Consumer for info about activities
 
41
 *
 
42
 * @since 4.5
 
43
 */
 
44
class KACTIVITIES_EXPORT Controller: public Consumer
 
45
{
 
46
    Q_OBJECT
 
47
 
 
48
    Q_PROPERTY(QString currentActivity READ currentActivity WRITE setCurrentActivity)
 
49
 
 
50
public:
 
51
    explicit Controller(QObject * parent = 0 /*nullptr*/);
 
52
 
 
53
    ~Controller();
 
54
 
 
55
    /**
 
56
     * Sets the name of the specified activity
 
57
     * @param id id of the activity
 
58
     * @param name name to be set
 
59
     */
 
60
    void setActivityName(const QString & id, const QString & name);
 
61
 
 
62
    /**
 
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
 
66
     */
 
67
    void setActivityIcon(const QString & id, const QString & icon);
 
68
 
 
69
    /**
 
70
     * Sets whether the activity should be encrypted
 
71
     * @param id id of the activity
 
72
     * @param encrypted should the activity be encrypted
 
73
     */
 
74
    KDE_DEPRECATED
 
75
    void setActivityEncrypted(const QString & id, bool encrypted);
 
76
 
 
77
    /**
 
78
     * Sets the current activity
 
79
     * @param id id of the activity to make current
 
80
     * @returns true if successful
 
81
     */
 
82
    bool setCurrentActivity(const QString & id);
 
83
 
 
84
    /**
 
85
     * Adds a new activity
 
86
     * @param name name of the activity
 
87
     * @returns id of the newly created activity
 
88
     */
 
89
    QString addActivity(const QString & name);
 
90
 
 
91
    /**
 
92
     * Removes the specified activity
 
93
     * @param id id of the activity to delete
 
94
     */
 
95
    void removeActivity(const QString & id);
 
96
 
 
97
    /**
 
98
     * Stops the activity
 
99
     * @param id id of the activity to stop
 
100
     */
 
101
    void stopActivity(const QString & id);
 
102
 
 
103
    /**
 
104
     * Starts the activity
 
105
     * @param id id of the activity to start
 
106
     */
 
107
    void startActivity(const QString & id);
 
108
 
 
109
private:
 
110
    ControllerPrivate * const d;
 
111
};
 
112
 
 
113
} // namespace KActivities
 
114
 
 
115
#endif // ACTIVITIES_CONTROLLER_H
 
116