1 | // Copyright (C) 2019 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 QQMLSCRIPTDATA_P_H |
5 | #define QQMLSCRIPTDATA_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 <private/qqmlrefcount_p.h> |
19 | #include <private/qqmlscriptblob_p.h> |
20 | #include <private/qv4value_p.h> |
21 | #include <private/qv4persistent_p.h> |
22 | #include <private/qv4executablecompilationunit_p.h> |
23 | |
24 | #include <QtCore/qurl.h> |
25 | |
26 | QT_BEGIN_NAMESPACE |
27 | |
28 | class QQmlTypeNameCache; |
29 | class QQmlContextData; |
30 | |
31 | class Q_AUTOTEST_EXPORT QQmlScriptData : public QQmlRefCounted<QQmlScriptData> |
32 | { |
33 | private: |
34 | friend class QQmlTypeLoader; |
35 | |
36 | QQmlScriptData(); |
37 | |
38 | public: |
39 | QUrl url; |
40 | QString urlString; |
41 | QQmlRefPointer<QQmlTypeNameCache> typeNameCache; |
42 | QVector<QQmlRefPointer<QQmlScriptBlob>> scripts; |
43 | |
44 | QV4::ReturnedValue scriptValueForContext(const QQmlRefPointer<QQmlContextData> &parentCtxt); |
45 | |
46 | QQmlRefPointer<QV4::ExecutableCompilationUnit> compilationUnit() const { return m_precompiledScript; } |
47 | |
48 | private: |
49 | friend class QQmlScriptBlob; |
50 | |
51 | QQmlRefPointer<QQmlContextData> qmlContextDataForContext( |
52 | const QQmlRefPointer<QQmlContextData> &parentQmlContextData); |
53 | |
54 | bool m_loaded; |
55 | QQmlRefPointer<QV4::ExecutableCompilationUnit> m_precompiledScript; |
56 | QV4::PersistentValue m_value; |
57 | }; |
58 | |
59 | QT_END_NAMESPACE |
60 | |
61 | #endif // QQMLSCRIPTDATA_P_H |
62 |