2021-12-22 23:29:00 +00:00
|
|
|
/*
|
|
|
|
|
* SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
2021-12-25 00:18:38 +00:00
|
|
|
#include "mobileshellplugin.h"
|
|
|
|
|
|
2021-12-22 23:29:00 +00:00
|
|
|
#include <QQmlContext>
|
|
|
|
|
#include <QQuickItem>
|
|
|
|
|
|
2022-04-10 17:28:32 +00:00
|
|
|
#include "components/direction.h"
|
|
|
|
|
|
2021-12-22 23:29:00 +00:00
|
|
|
#include "notifications/notificationfilemenu.h"
|
|
|
|
|
#include "notifications/notificationthumbnailer.h"
|
2022-03-13 20:27:14 +00:00
|
|
|
|
2021-12-22 23:29:00 +00:00
|
|
|
#include "shellutil.h"
|
2022-03-13 20:27:14 +00:00
|
|
|
|
2022-03-05 18:52:03 +00:00
|
|
|
QUrl resolvePath(std::string str)
|
|
|
|
|
{
|
|
|
|
|
return QUrl("qrc:/org/kde/plasma/private/mobileshell/qml/" + QString::fromStdString(str));
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-22 23:29:00 +00:00
|
|
|
void MobileShellPlugin::registerTypes(const char *uri)
|
|
|
|
|
{
|
|
|
|
|
Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.plasma.private.mobileshell"));
|
|
|
|
|
|
|
|
|
|
qmlRegisterSingletonType<ShellUtil>(uri, 1, 0, "ShellUtil", [](QQmlEngine *, QJSEngine *) -> QObject * {
|
|
|
|
|
return ShellUtil::instance();
|
|
|
|
|
});
|
|
|
|
|
|
2022-04-10 17:28:32 +00:00
|
|
|
// components
|
|
|
|
|
qmlRegisterType<Direction>(uri, 1, 0, "Direction");
|
2021-12-25 00:18:38 +00:00
|
|
|
|
2021-12-22 23:29:00 +00:00
|
|
|
// notifications
|
|
|
|
|
qmlRegisterType<NotificationThumbnailer>(uri, 1, 0, "NotificationThumbnailer");
|
|
|
|
|
qmlRegisterType<NotificationFileMenu>(uri, 1, 0, "NotificationFileMenu");
|
2022-03-05 18:52:03 +00:00
|
|
|
|
|
|
|
|
// qml modules
|
|
|
|
|
|
|
|
|
|
// /actiondrawer
|
|
|
|
|
qmlRegisterType(resolvePath("actiondrawer/ActionDrawer.qml"), uri, 1, 0, "ActionDrawer");
|
|
|
|
|
qmlRegisterType(resolvePath("actiondrawer/ActionDrawerOpenSurface.qml"), uri, 1, 0, "ActionDrawerOpenSurface");
|
2022-04-07 18:11:08 +00:00
|
|
|
qmlRegisterType(resolvePath("actiondrawer/ActionDrawerWindow.qml"), uri, 1, 0, "ActionDrawerWindow");
|
2022-03-05 18:52:03 +00:00
|
|
|
|
|
|
|
|
// /components
|
2023-03-15 06:29:46 +00:00
|
|
|
qmlRegisterSingletonType(resolvePath("components/AppLaunch.qml"), uri, 1, 0, "AppLaunch");
|
2022-03-05 18:52:03 +00:00
|
|
|
qmlRegisterType(resolvePath("components/BaseItem.qml"), uri, 1, 0, "BaseItem");
|
2023-03-19 05:06:48 +00:00
|
|
|
qmlRegisterSingletonType(resolvePath("components/Constants.qml"), uri, 1, 0, "Constants");
|
2022-06-21 22:38:21 +00:00
|
|
|
qmlRegisterType(resolvePath("components/ExtendedAbstractButton.qml"), uri, 1, 0, "ExtendedAbstractButton");
|
2022-07-08 22:34:04 +00:00
|
|
|
qmlRegisterType(resolvePath("components/Flickable.qml"), uri, 1, 0, "Flickable");
|
|
|
|
|
qmlRegisterType(resolvePath("components/GridView.qml"), uri, 1, 0, "GridView");
|
2022-11-11 16:56:40 +00:00
|
|
|
qmlRegisterType(resolvePath("components/HapticsEffectLoader.qml"), uri, 1, 0, "HapticsEffectLoader");
|
2022-07-08 22:34:04 +00:00
|
|
|
qmlRegisterType(resolvePath("components/ListView.qml"), uri, 1, 0, "ListView");
|
2023-03-08 11:48:14 +00:00
|
|
|
qmlRegisterType(resolvePath("components/PopupMenu.qml"), uri, 1, 0, "PopupMenu");
|
2022-03-05 18:52:03 +00:00
|
|
|
qmlRegisterType(resolvePath("components/StartupFeedback.qml"), uri, 1, 0, "StartupFeedback");
|
|
|
|
|
qmlRegisterType(resolvePath("components/VelocityCalculator.qml"), uri, 1, 0, "VelocityCalculator");
|
|
|
|
|
|
|
|
|
|
// /dataproviders
|
2023-03-16 07:21:01 +00:00
|
|
|
qmlRegisterType(resolvePath("dataproviders/AudioInfo.qml"), uri, 1, 0, "AudioInfo");
|
2022-11-11 16:21:12 +00:00
|
|
|
qmlRegisterType(resolvePath("dataproviders/BatteryInfo.qml"), uri, 1, 0, "BatteryInfo");
|
|
|
|
|
qmlRegisterType(resolvePath("dataproviders/BluetoothInfo.qml"), uri, 1, 0, "BluetoothInfo");
|
|
|
|
|
qmlRegisterType(resolvePath("dataproviders/SignalStrengthInfo.qml"), uri, 1, 0, "SignalStrengthInfo");
|
2022-03-05 18:52:03 +00:00
|
|
|
|
2022-04-06 02:06:05 +00:00
|
|
|
// /homescreen
|
|
|
|
|
qmlRegisterType(resolvePath("homescreen/HomeScreen.qml"), uri, 1, 0, "HomeScreen");
|
|
|
|
|
|
2022-03-05 18:52:03 +00:00
|
|
|
// /navigationpanel
|
|
|
|
|
qmlRegisterType(resolvePath("navigationpanel/NavigationPanel.qml"), uri, 1, 0, "NavigationPanel");
|
|
|
|
|
qmlRegisterType(resolvePath("navigationpanel/NavigationPanelAction.qml"), uri, 1, 0, "NavigationPanelAction");
|
|
|
|
|
|
|
|
|
|
// /statusbar
|
|
|
|
|
qmlRegisterType(resolvePath("statusbar/StatusBar.qml"), uri, 1, 0, "StatusBar");
|
|
|
|
|
|
2023-03-16 07:21:01 +00:00
|
|
|
// /volumeosd
|
|
|
|
|
qmlRegisterType(resolvePath("volumeosd/VolumeOSD.qml"), uri, 1, 0, "VolumeOSD");
|
2023-03-20 04:10:14 +00:00
|
|
|
qmlRegisterType(resolvePath("volumeosd/VolumeOSDProvider.qml"), uri, 1, 0, "VolumeOSDProvider");
|
|
|
|
|
qmlRegisterSingletonType(resolvePath("volumeosd/VolumeOSDProviderLoader.qml"), uri, 1, 0, "VolumeOSDProviderLoader");
|
2023-03-16 07:21:01 +00:00
|
|
|
|
2022-03-05 18:52:03 +00:00
|
|
|
// /widgets
|
|
|
|
|
qmlRegisterType(resolvePath("widgets/krunner/KRunnerWidget.qml"), uri, 1, 0, "KRunnerWidget");
|
|
|
|
|
qmlRegisterType(resolvePath("widgets/mediacontrols/MediaControlsWidget.qml"), uri, 1, 0, "MediaControlsWidget");
|
|
|
|
|
qmlRegisterType(resolvePath("widgets/notifications/NotificationsWidget.qml"), uri, 1, 0, "NotificationsWidget");
|
|
|
|
|
qmlRegisterType(resolvePath("widgets/notifications/NotificationsModelType.qml"), uri, 1, 0, "NotificationsModelType");
|
2021-12-22 23:29:00 +00:00
|
|
|
}
|