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
10QT_BEGIN_NAMESPACE
11
12
13class QQmlEngine;
14
15class Q_QML_EXPORT QQmlTypesExtensionInterface
16{
17public:
18 virtual ~QQmlTypesExtensionInterface();
19 virtual void registerTypes(const char *uri) = 0;
20};
21
22class Q_QML_EXPORT QQmlExtensionInterface : public QQmlTypesExtensionInterface
23{
24public:
25 ~QQmlExtensionInterface() override;
26 virtual void initializeEngine(QQmlEngine *engine, const char *uri) = 0;
27};
28
29class Q_QML_EXPORT QQmlEngineExtensionInterface
30{
31public:
32 virtual ~QQmlEngineExtensionInterface();
33 virtual void initializeEngine(QQmlEngine *engine, const char *uri) = 0;
34};
35
36#define QQmlTypesExtensionInterface_iid "org.qt-project.Qt.QQmlTypesExtensionInterface"
37Q_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
44Q_DECLARE_INTERFACE(QQmlExtensionInterface, QQmlExtensionInterface_iid)
45
46#define QQmlEngineExtensionInterface_iid "org.qt-project.Qt.QQmlEngineExtensionInterface"
47Q_DECLARE_INTERFACE(QQmlEngineExtensionInterface, QQmlEngineExtensionInterface_iid)
48
49QT_END_NAMESPACE
50
51#endif // QQMLEXTENSIONINTERFACE_H
52

source code of qtdeclarative/src/qml/qml/qqmlextensioninterface.h