KActivities::Controller Class

class KActivities::Controller

Methods for controlling and managing the activities. More...

Header: #include <PlasmaActivities/Controller>
CMake: find_package(Plasma REQUIRED COMPONENTS Activities)
target_link_libraries(mytarget PRIVATE Plasma::Activities)
Inherits: KActivities::Consumer

Properties

Public Functions

Controller(QObject *parent = nullptr)
QFuture<QString> addActivity(const QString &name)
QFuture<void> nextActivity()
QFuture<void> previousActivity()
QFuture<void> removeActivity(const QString &id)
QFuture<void> setActivityDescription(const QString &id, const QString &description)
QFuture<void> setActivityIcon(const QString &id, const QString &icon)
QFuture<void> setActivityName(const QString &id, const QString &name)
QFuture<bool> setCurrentActivity(const QString &id)

Detailed Description

Note: The QFuture objects returned by these methods are not thread-based, you can not call synchronous methods like waitForFinished, cancel, pause on them. You need either to register watchers to check when those have finished, or to check whether they are ready from time to time manually.

Property Documentation

currentActivity : QString

Access functions:

QString currentActivity() const
QFuture<bool> setCurrentActivity(const QString &id)

Notifier signal:

void currentActivityChanged(const QString &id)

Member Function Documentation

[explicit] Controller::Controller(QObject *parent = nullptr)

QFuture<QString> Controller::addActivity(const QString &name)

Adds a new activity

name name of the activity

Returns the id of the newly created activity

QFuture<void> Controller::nextActivity()

Switches to the next activity

QFuture<void> Controller::previousActivity()

Switches to the previous activity

QFuture<void> Controller::removeActivity(const QString &id)

Removes the specified activity

id id of the activity to delete

QFuture<void> Controller::setActivityDescription(const QString &id, const QString &description)

Sets the description of the specified activity

id id of the activity

description description to be set

QFuture<void> Controller::setActivityIcon(const QString &id, const QString &icon)

Sets the icon of the specified activity

id id of the activity

icon icon to be set - freedesktop.org name or file path

QFuture<void> Controller::setActivityName(const QString &id, const QString &name)

Sets the name of the specified activity

id id of the activity

name name to be set

QFuture<bool> Controller::setCurrentActivity(const QString &id)

Sets the current activity

id id of the activity to make current

Returns true if successful

Note: Setter function for property currentActivity.