taskmanagerplugin.cpp 2.08 KB
Newer Older
Eike Hein's avatar
Eike Hein committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/********************************************************************
Copyright 2015-2016  Eike Hein <hein.org>

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) version 3, or any
later version accepted by the membership of KDE e.V. (or its
successor approved by the membership of KDE e.V.), which shall
act as a proxy defined in Section 6 of version 3 of the license.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library.  If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/

#include "taskmanagerplugin.h"

23
#include "abstracttasksmodel.h"
Eike Hein's avatar
Eike Hein committed
24
25
26
#include "tasksmodel.h"
#include "activityinfo.h"
#include "virtualdesktopinfo.h"
27
28
#include "PipeWireSourceItem.h"
#include "screencastingitem.h"
Eike Hein's avatar
Eike Hein committed
29

30
#include <QQmlEngine>
Eike Hein's avatar
Eike Hein committed
31
32
33
34
35
36
37
38

namespace TaskManager
{

void TaskManagerPlugin::registerTypes(const char *uri)
{
    Q_ASSERT(uri == QLatin1String("org.kde.taskmanager"));

39
40
41
42
43
44
45
    // Expose the AbstractTasksModel::AdditionalRoles enum to Qt Quick
    // for use with the TasksModel::data invokable. TasksModel inherits
    // the data roles from its source model, despite not inheriting from
    // AbstractTasksModel to avoid multiple inheritance from QObject-
    // derived classes.
    qmlRegisterUncreatableType<AbstractTasksModel>(uri, 0, 1, "AbstractTasksModel", "");

Eike Hein's avatar
Eike Hein committed
46
47
48
    qmlRegisterType<TasksModel>(uri, 0, 1, "TasksModel");
    qmlRegisterType<ActivityInfo>(uri, 0, 1, "ActivityInfo");
    qmlRegisterType<VirtualDesktopInfo>(uri, 0, 1, "VirtualDesktopInfo");
49
50
    qmlRegisterType<PipeWireSourceItem>(uri, 0, 1, "PipeWireSourceItem");
    qmlRegisterType<ScreencastingItem>(uri, 0, 1, "ScreencastingItem");
Eike Hein's avatar
Eike Hein committed
51
52
53
}

}