1 | /* |
2 | * SPDX-FileCopyrightText: 2009 Alan Alpert <alan.alpert@nokia.com> |
3 | * SPDX-FileCopyrightText: 2010 Ménard Alexis <menard@kde.org> |
4 | * SPDX-FileCopyrightText: 2010 Marco Martin <mart@kde.org> |
5 | * |
6 | * SPDX-License-Identifier: LGPL-2.0-or-later |
7 | */ |
8 | |
9 | #ifndef KIRIGAMIPLUGIN_H |
10 | #define KIRIGAMIPLUGIN_H |
11 | |
12 | #include <QQmlEngine> |
13 | #include <QQmlExtensionPlugin> |
14 | #include <QUrl> |
15 | |
16 | class KirigamiPlugin : public QQmlExtensionPlugin |
17 | { |
18 | Q_OBJECT |
19 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface" ) |
20 | |
21 | public: |
22 | KirigamiPlugin(QObject *parent = nullptr); |
23 | void registerTypes(const char *uri) override; |
24 | void initializeEngine(QQmlEngine *engine, const char *uri) override; |
25 | |
26 | #ifdef KIRIGAMI_BUILD_TYPE_STATIC |
27 | static KirigamiPlugin &getInstance(); |
28 | static void registerTypes(QQmlEngine *engine = nullptr); |
29 | #endif |
30 | |
31 | Q_SIGNALS: |
32 | void languageChangeEvent(); |
33 | |
34 | private: |
35 | QUrl componentUrl(const QString &fileName) const; |
36 | }; |
37 | |
38 | #endif |
39 | |