MauiKit Image Tools

imagetools_plugin.cpp
1// SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#include <QQmlEngine>
6#include <QResource>
7
8#include "picinfomodel.h"
9#include "imagetools_plugin.h"
10#ifndef Q_OS_ANDROID
11#include <ocs.h>
12#endif
13
14void ImageToolsPlugin::registerTypes(const char *uri)
15{
16#if defined(Q_OS_ANDROID)
17 QResource::registerResource(QStringLiteral("assets:/android_rcc_bundle.rcc"));
18#endif
19
20 Q_ASSERT(QLatin1String(uri) == QLatin1String("org.mauikit.imagetools"));
21
22 qmlRegisterType(componentUrl(QStringLiteral("ImageViewer.qml")), uri, 1, 0, "ImageViewer");
23
24#ifdef Q_OS_ANDROID
25 qmlRegisterType(componentUrl(QStringLiteral("android/ImageEditor.qml")), uri, 1, 0, "ImageEditor");
26#else
27 qmlRegisterType(componentUrl(QStringLiteral("linux/ImageEditor.qml")), uri, 1, 0, "ImageEditor");
28#endif
29
30 qmlRegisterType<PicInfoModel>(uri, 1, 3, "PicInfoModel");
31 qmlRegisterType(componentUrl(QStringLiteral("ImageInfoDialog.qml")), uri, 1, 3, "ImageInfoDialog");
32 qmlRegisterType(componentUrl(QStringLiteral("MetadataEditor.qml")), uri, 1, 3, "MetadataEditor");
33
34#ifndef Q_OS_ANDROID
35 qmlRegisterType<OCS>(uri, 1, 3, "OCR");
36 qmlRegisterType(componentUrl(QStringLiteral("image2text/OCRPage.qml")), uri, 1, 3, "OCRPage");
37#endif
38}
39
40QUrl ImageToolsPlugin::componentUrl(const QString &fileName) const
41{
42 return QUrl(resolveFileUrl(fileName));
43}
44
45#include "imagetools_plugin.moc"
46#include "moc_imagetools_plugin.cpp"
47
bool registerResource(const QString &rccFileName, const QString &mapRoot)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 11 2025 11:57:09 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.