Plasma-workspace

taskmanagerplugin.cpp
1/*
2 SPDX-FileCopyrightText: 2015-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#include "taskmanagerplugin.h"
8
9#include "abstracttasksmodel.h"
10#include "activityinfo.h"
11#include "tasksmodel.h"
12#include "virtualdesktopinfo.h"
13
14#ifdef WITH_KPIPEWIRE
15#include <pipewiresourceitem.h>
16#endif
17#include "screencasting.h"
18#include "screencastingrequest.h"
19
20namespace TaskManager
21{
22void TaskManagerPlugin::registerTypes(const char *uri)
23{
24 Q_ASSERT(uri == QByteArrayLiteral("org.kde.taskmanager"));
25
26 // Expose the AbstractTasksModel::AdditionalRoles enum to Qt Quick
27 // for use with the TasksModel::data invokable. TasksModel inherits
28 // the data roles from its source model, despite not inheriting from
29 // AbstractTasksModel to avoid multiple inheritance from QObject-
30 // derived classes.
31 qmlRegisterUncreatableType<AbstractTasksModel>(uri, 0, 1, "AbstractTasksModel", "");
32
33 qmlRegisterType<TasksModel>(uri, 0, 1, "TasksModel");
34 qmlRegisterType<ActivityInfo>(uri, 0, 1, "ActivityInfo");
35 qmlRegisterType<VirtualDesktopInfo>(uri, 0, 1, "VirtualDesktopInfo");
36#ifdef WITH_KPIPEWIRE
37 qmlRegisterType<PipeWireSourceItem>(uri, 0, 1, "PipeWireSourceItem");
38#endif
39 qmlRegisterType<ScreencastingRequest>(uri, 0, 1, "ScreencastingRequest");
40 qmlRegisterUncreatableType<Screencasting>(uri, 0, 1, "Screencasting", "Use ScreencastingItem");
41
42 const QString reason = QStringLiteral("error: only enums");
43 qmlRegisterUncreatableMetaObject(RegionFilterMode::staticMetaObject, uri, 0, 1, "RegionFilterMode", reason);
44}
45
46}
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.