File indexing completed on 2024-12-29 05:06:05

0001 // SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
0002 // SPDX-License-Identifier: GPL-2.0-or-later
0003 
0004 #include "halcyonplugin.h"
0005 #include "application.h"
0006 #include "applicationfolder.h"
0007 #include "applicationlistmodel.h"
0008 #include "pinnedmodel.h"
0009 #include "windowlistener.h"
0010 
0011 void HalcyonPlugin::registerTypes(const char *uri)
0012 {
0013     Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.private.mobile.homescreen.halcyon"));
0014 
0015     WindowListener::instance(); // ensure it is created
0016 
0017     qmlRegisterSingletonType<ApplicationListModel>(uri, 1, 0, "ApplicationListModel", [](QQmlEngine *, QJSEngine *) -> QObject * {
0018         return ApplicationListModel::self();
0019     });
0020 
0021     qmlRegisterSingletonType<PinnedModel>(uri, 1, 0, "PinnedModel", [](QQmlEngine *, QJSEngine *) -> QObject * {
0022         return PinnedModel::self();
0023     });
0024 
0025     qmlRegisterType<Application>(uri, 1, 0, "Application");
0026     qmlRegisterType<ApplicationFolder>(uri, 1, 0, "ApplicationFolder");
0027 }