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
11#ifndef Q_OS_ANDROID
12#include <ocs.h>
13#endif
14
15void ImageToolsPlugin::registerTypes(const char *uri)
16{
17#if defined(Q_OS_ANDROID)
18 QResource::registerResource(QStringLiteral("assets:/android_rcc_bundle.rcc"));
19#endif
20
21 Q_ASSERT(QLatin1String(uri) == QLatin1String("org.mauikit.imagetools"));
22
23 qmlRegisterType(componentUrl(QStringLiteral("ImageViewer.qml")), uri, 1, 0, "ImageViewer");
24
25#ifdef Q_OS_ANDROID
26 qmlRegisterType(componentUrl(QStringLiteral("android/ImageEditor.qml")), uri, 1, 0, "ImageEditor");
27#else
28 qmlRegisterType(componentUrl(QStringLiteral("linux/ImageEditor.qml")), uri, 1, 0, "ImageEditor");
29#endif
30
31 qmlRegisterType<PicInfoModel>(uri, 1, 3, "PicInfoModel");
32 qmlRegisterType(componentUrl(QStringLiteral("ImageInfoDialog.qml")), uri, 1, 3, "ImageInfoDialog");
33 qmlRegisterType(componentUrl(QStringLiteral("MetadataEditor.qml")), uri, 1, 3, "MetadataEditor");
34
35#ifndef Q_OS_ANDROID
36 qmlRegisterType<OCS>(uri, 1, 3, "OCR");
37 qmlRegisterType(componentUrl(QStringLiteral("image2text/OCRPage.qml")), uri, 1, 3, "OCRPage");
38#endif
39}
40
41QUrl ImageToolsPlugin::componentUrl(const QString &fileName) const
42{
43 return QUrl(resolveFileUrl(fileName));
44}
45
46#include "imagetools_plugin.moc"
47#include "moc_imagetools_plugin.cpp"
48
bool registerResource(const QString &rccFileName, const QString &mapRoot)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:10:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.