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 QQMLSCRIPTSTRING_H |
5 | #define QQMLSCRIPTSTRING_H |
6 | |
7 | #include <QtQml/qtqmlglobal.h> |
8 | #include <QtQml/qqml.h> |
9 | #include <QtCore/qstring.h> |
10 | #include <QtCore/qshareddata.h> |
11 | #include <QtCore/qmetatype.h> |
12 | |
13 | QT_BEGIN_NAMESPACE |
14 | |
15 | |
16 | class QObject; |
17 | class QQmlContext; |
18 | class QQmlScriptStringPrivate; |
19 | class QQmlObjectCreator; |
20 | namespace QV4 { |
21 | struct QObjectWrapper; |
22 | } |
23 | class Q_QML_EXPORT QQmlScriptString |
24 | { |
25 | Q_GADGET |
26 | QML_ANONYMOUS |
27 | public: |
28 | QQmlScriptString(); |
29 | QQmlScriptString(const QQmlScriptString &); |
30 | ~QQmlScriptString(); |
31 | |
32 | QQmlScriptString &operator=(const QQmlScriptString &); |
33 | |
34 | bool operator==(const QQmlScriptString &) const; |
35 | bool operator!=(const QQmlScriptString &) const; |
36 | |
37 | bool isEmpty() const; |
38 | |
39 | bool isUndefinedLiteral() const; |
40 | bool isNullLiteral() const; |
41 | QString stringLiteral() const; |
42 | qreal numberLiteral(bool *ok) const; |
43 | bool booleanLiteral(bool *ok) const; |
44 | |
45 | private: |
46 | QQmlScriptString(const QString &script, QQmlContext *context, QObject *scope); |
47 | QSharedDataPointer<QQmlScriptStringPrivate> d; |
48 | |
49 | friend class QQmlObjectCreator; |
50 | friend class QQmlScriptStringPrivate; |
51 | friend class QQmlExpression; |
52 | friend class QQmlBinding; |
53 | friend class QQmlPropertyBinding; |
54 | friend struct QV4::QObjectWrapper; |
55 | }; |
56 | |
57 | QT_END_NAMESPACE |
58 | |
59 | Q_DECLARE_METATYPE(QQmlScriptString) |
60 | |
61 | #endif // QQMLSCRIPTSTRING_H |
62 | |
63 |