Plasma-workspace

activityinfo.h
1/*
2 SPDX-FileCopyrightText: 2016 Eike Hein <hein@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#pragma once
8
9#include <QObject>
10
11#include <memory>
12
13#include "taskmanager_export.h"
14
15namespace TaskManager
16{
17/**
18 * @short Provides basic activity information.
19 *
20 * This class provides basic information about the activities defined in
21 * the system.
22 *
23 * @NOTE: This is a placeholder, to be moved into KActivities (which it
24 * wraps) or the Task Manager applet backend.
25 *
26 * @see KActivities
27 *
28 * @author Eike Hein <hein@kde.org>
29 **/
30
31class TASKMANAGER_EXPORT ActivityInfo : public QObject
32{
33 Q_OBJECT
34
35 Q_PROPERTY(QString currentActivity READ currentActivity NOTIFY currentActivityChanged)
36 Q_PROPERTY(int numberOfRunningActivities READ numberOfRunningActivities NOTIFY numberOfRunningActivitiesChanged)
37
38public:
39 explicit ActivityInfo(QObject *parent = nullptr);
40 ~ActivityInfo() override;
41
42 /**
43 * The currently active virtual desktop.
44 *
45 * @returns the number of the currently active virtual desktop.
46 **/
47 QString currentActivity() const;
48
49 /**
50 * The number of currently-running activities defined in the session.
51 *
52 * @returns the number of activities defined in the session.
53 **/
54 int numberOfRunningActivities() const;
55
56 /**
57 * The list of currently-running activities defined in the session.
58 *
59 * @returns the list of currently-running activities defined in the session.
60 **/
61 Q_INVOKABLE QStringList runningActivities() const;
62
63 /**
64 * The name of the activity of the given id.
65 *
66 * @param id An activity id string.
67 * @returns the name of the activity of the given id.
68 **/
69 Q_INVOKABLE QString activityName(const QString &id);
70
71 /**
72 * The icon of the activity of the given id.
73 *
74 * @param id An activity id string.
75 * @returns the name or file path of the activity of the given id.
76 **/
77 Q_INVOKABLE QString activityIcon(const QString &id);
78
79Q_SIGNALS:
80 void currentActivityChanged() const;
81 void numberOfRunningActivitiesChanged() const;
82
83 /**
84 * The names of the running activities have changed.
85 * @since 5.40.0
86 **/
88
89private:
90 class Private;
91 std::unique_ptr<Private> d;
92};
93
94}
Provides basic activity information.
void namesOfRunningActivitiesChanged() const
The names of the running activities have changed.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:42 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.