Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qv4include_p.h
Go to the documentation of this file.
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// Qt-Security score:significant
4
5#ifndef QV4INCLUDE_P_H
6#define QV4INCLUDE_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/qobject.h>
20#include <QtCore/qurl.h>
21#include <QtCore/qpointer.h>
22
23#include <private/qqmlnotifyingblob_p.h>
24#include <private/qv4context_p.h>
25#include <private/qv4persistent_p.h>
26#include <private/qv4value_p.h>
27
28QT_BEGIN_NAMESPACE
29
30class QV4Include : public QQmlNotifyingBlob::Callback
31{
32public:
33 enum Status {
34 Ok = 0,
35 Loading = 1,
36 NetworkError = 2,
37 Exception = 3
38 };
39
40 static QJSValue method_include(QV4::ExecutionEngine *engine, const QUrl &url,
41 const QJSValue &callbackFunction);
42
43 void ready(QQmlNotifyingBlob *) final;
44
45private:
46 static void callback(QV4::FunctionObject *callback, QV4::Object *result);
47 static QV4::ReturnedValue resultValue(QV4::ExecutionEngine *v4);
48 static void populateResultValue(
49 QV4::Object *o, Status status, const QString &statusText = QString());
50 static void processScriptBlob(
51 QQmlScriptBlob *scriptBlob, QV4::Object *result, QV4::FunctionObject *callbackFunction,
52 QV4::QmlContext *qmlContext);
53
54 QV4Include(
55 QV4::Object *result, QV4::FunctionObject *callbackFunction, QV4::QmlContext *qmlContext);
56
57 QV4::PersistentValue m_callbackFunction;
58 QV4::PersistentValue m_resultObject;
59 QV4::PersistentValue m_qmlContext;
60};
61
62QT_END_NAMESPACE
63
64#endif
Definition qjsvalue.h:23
Scoped< FunctionObject > ScopedFunctionObject
Scoped< Object > ScopedObject
Scoped< String > ScopedString
JSCallArguments(const Scope &scope, int argc=0)
Definition qv4jscall_p.h:60
Scope(ExecutionEngine *e)