File indexing completed on 2024-05-19 04:48:09

0001 // SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
0002 //
0003 // SPDX-License-Identifier: LGPL-2.1-or-later
0004 
0005 #include <QQmlEngine>
0006 #include <QResource>
0007 
0008 #include "texteditor_plugin.h"
0009 #include "documenthandler.h"
0010 #include "colorschemesmodel.h"
0011 
0012 void TextEditorPlugin::registerTypes(const char *uri)
0013 {
0014 #if defined(Q_OS_ANDROID)
0015     QResource::registerResource(QStringLiteral("assets:/android_rcc_bundle.rcc"));
0016 #endif
0017 
0018     qmlRegisterType<DocumentHandler>(uri, 1, 0, "DocumentHandler");
0019     qmlRegisterType<ColorSchemesModel>(uri, 1, 0, "ColorSchemesModel");
0020     qmlRegisterType(componentUrl(QStringLiteral("TextEditor.qml")), uri, 1, 0, "TextEditor");
0021     qmlRegisterType(componentUrl(QStringLiteral("ColorSchemesPage.qml")), uri, 1, 0, "ColorSchemesPage");
0022 }
0023 
0024 QUrl TextEditorPlugin::componentUrl(const QString &fileName) const
0025 {
0026     return QUrl(resolveFileUrl(fileName));
0027 }