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

KDE's Doxygen guidelines are available online.