File indexing completed on 2024-05-19 15:09:24

0001 /*
0002     SPDX-FileCopyrightText: 2009 Alan Alpert <alan.alpert@nokia.com>
0003     SPDX-FileCopyrightText: 2010 Ménard Alexis <menard@kde.org>
0004     SPDX-FileCopyrightText: 2010 Marco Martin <mart@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #include "kquickcontrolsaddonsplugin.h"
0010 #include "config-kquickcontrolsaddons.h"
0011 
0012 #include "clipboard.h"
0013 #include "columnproxymodel.h"
0014 #include "eventgenerator.h"
0015 #include "fallbacktaphandler.h"
0016 #include "icondialog.h"
0017 #include "kcmshell.h"
0018 #include "mimedatabase.h"
0019 #include "mouseeventlistener.h"
0020 #include "qiconitem.h"
0021 #include "qimageitem.h"
0022 #include "qpixmapitem.h"
0023 
0024 #if HAVE_EPOXY
0025 #include "plotter.h"
0026 #endif
0027 
0028 #include "../../kdeclarative/kdeclarative_export.h"
0029 
0030 static QObject *kcmshell_singleton_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
0031 {
0032     Q_UNUSED(engine);
0033     Q_UNUSED(scriptEngine);
0034 
0035     return new KCMShell();
0036 }
0037 
0038 void KQuickControlsAddonsPlugin::registerTypes(const char *uri)
0039 {
0040     Q_ASSERT(QString::fromLatin1(uri) == QLatin1String("org.kde.kquickcontrolsaddons"));
0041 
0042     qmlRegisterType<QPixmapItem>(uri, 2, 0, "QPixmapItem");
0043     qmlRegisterType<QImageItem>(uri, 2, 0, "QImageItem");
0044 #if KDECLARATIVE_BUILD_DEPRECATED_SINCE(5, 101)
0045     qmlRegisterType<QIconItem>(uri, 2, 0, "QIconItem");
0046 #endif
0047     qmlRegisterType<MouseEventListener>(uri, 2, 0, "MouseEventListener");
0048     qmlRegisterAnonymousType<KDeclarativeMouseEvent>(uri, 1);
0049     qmlRegisterAnonymousType<KDeclarativeWheelEvent>(uri, 1);
0050     qmlRegisterType<ColumnProxyModel>(uri, 2, 0, "ColumnProxyModel");
0051     qmlRegisterType<Clipboard>(uri, 2, 0, "Clipboard");
0052     qmlRegisterType<MimeDatabase>(uri, 2, 0, "MimeDatabase");
0053     qmlRegisterSingletonType<KCMShell>(uri, 2, 0, "KCMShell", kcmshell_singleton_provider);
0054     qmlRegisterType<IconDialog>(uri, 2, 0, "IconDialog");
0055     qmlRegisterType<EventGenerator>(uri, 2, 0, "EventGenerator");
0056     qmlRegisterUncreatableType<FallbackTapHandlerMouseEvent>(uri,
0057                                                              2,
0058                                                              1,
0059                                                              "FallbackTapHandlerMouseEvent",
0060                                                              QStringLiteral("Cannot create items of type FallbackTapHandlerMouseEvent"));
0061     qmlRegisterType<FallbackTapHandler>(uri, 2, 1, "FallbackTapHandler");
0062 
0063 #if HAVE_EPOXY
0064     qmlRegisterType<PlotData>(uri, 2, 0, "PlotData");
0065     qmlRegisterType<Plotter>(uri, 2, 0, "Plotter");
0066 #endif
0067     qmlRegisterAnonymousType<QAbstractItemModel>(uri, 1);
0068     qRegisterMetaType<QModelIndex>("QModelIndex");
0069 }
0070 
0071 #include "moc_kquickcontrolsaddonsplugin.cpp"