1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QQMLEXTENSIONINTERFACE_H |
5 | #define QQMLEXTENSIONINTERFACE_H |
6 | |
7 | #include <QtQml/qtqmlglobal.h> |
8 | #include <QtCore/qobject.h> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | |
13 | class QQmlEngine; |
14 | |
15 | class Q_QML_EXPORT QQmlTypesExtensionInterface |
16 | { |
17 | public: |
18 | virtual ~QQmlTypesExtensionInterface(); |
19 | virtual void registerTypes(const char *uri) = 0; |
20 | }; |
21 | |
22 | class Q_QML_EXPORT QQmlExtensionInterface : public QQmlTypesExtensionInterface |
23 | { |
24 | public: |
25 | ~QQmlExtensionInterface() override; |
26 | virtual void initializeEngine(QQmlEngine *engine, const char *uri) = 0; |
27 | }; |
28 | |
29 | class Q_QML_EXPORT QQmlEngineExtensionInterface |
30 | { |
31 | public: |
32 | virtual ~QQmlEngineExtensionInterface(); |
33 | virtual void initializeEngine(QQmlEngine *engine, const char *uri) = 0; |
34 | }; |
35 | |
36 | #define QQmlTypesExtensionInterface_iid "org.qt-project.Qt.QQmlTypesExtensionInterface" |
37 | Q_DECLARE_INTERFACE(QQmlTypesExtensionInterface, "org.qt-project.Qt.QQmlTypesExtensionInterface/1.0" ) |
38 | |
39 | // NOTE: When changing this to a new version and deciding to add backup code to |
40 | // continue to support the previous version, make sure to support both of these iids. |
41 | #define QQmlExtensionInterface_iid "org.qt-project.Qt.QQmlExtensionInterface/1.0" |
42 | #define QQmlExtensionInterface_iid_old "org.qt-project.Qt.QQmlExtensionInterface" |
43 | |
44 | Q_DECLARE_INTERFACE(QQmlExtensionInterface, QQmlExtensionInterface_iid) |
45 | |
46 | #define QQmlEngineExtensionInterface_iid "org.qt-project.Qt.QQmlEngineExtensionInterface" |
47 | Q_DECLARE_INTERFACE(QQmlEngineExtensionInterface, QQmlEngineExtensionInterface_iid) |
48 | |
49 | QT_END_NAMESPACE |
50 | |
51 | #endif // QQMLEXTENSIONINTERFACE_H |
52 | |