| 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 QJSENGINE_P_H |
| 5 | #define QJSENGINE_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtCore/private/qobject_p.h> |
| 19 | #include <QtCore/qmutex.h> |
| 20 | #include <QtCore/qproperty.h> |
| 21 | #include "qjsengine.h" |
| 22 | #include "private/qtqmlglobal_p.h" |
| 23 | #include <private/qqmlmetatype_p.h> |
| 24 | |
| 25 | QT_BEGIN_NAMESPACE |
| 26 | |
| 27 | class QQmlPropertyCache; |
| 28 | |
| 29 | namespace QV4 { |
| 30 | struct ExecutionEngine; |
| 31 | } |
| 32 | |
| 33 | class Q_QML_EXPORT QJSEnginePrivate : public QObjectPrivate |
| 34 | { |
| 35 | Q_DECLARE_PUBLIC(QJSEngine) |
| 36 | |
| 37 | public: |
| 38 | static QJSEnginePrivate* get(QJSEngine*e) { return e->d_func(); } |
| 39 | static const QJSEnginePrivate* get(const QJSEngine*e) { return e->d_func(); } |
| 40 | static QJSEnginePrivate* get(QV4::ExecutionEngine *e); |
| 41 | |
| 42 | QJSEnginePrivate() = default; |
| 43 | ~QJSEnginePrivate() override; |
| 44 | |
| 45 | static void addToDebugServer(QJSEngine *q); |
| 46 | static void removeFromDebugServer(QJSEngine *q); |
| 47 | |
| 48 | void uiLanguageChanged() |
| 49 | { |
| 50 | Q_Q(QJSEngine); |
| 51 | if (q) |
| 52 | Q_EMIT q->uiLanguageChanged(); |
| 53 | } |
| 54 | Q_OBJECT_BINDABLE_PROPERTY(QJSEnginePrivate, QString, uiLanguage, &QJSEnginePrivate::uiLanguageChanged); |
| 55 | }; |
| 56 | |
| 57 | QT_END_NAMESPACE |
| 58 | |
| 59 | #endif // QJSENGINE_P_H |
| 60 |
