24 #ifndef QSCRIPTVALUE_H
25 #define QSCRIPTVALUE_H
54 class QScriptValuePrivate;
55 class QScriptEnginePrivate;
56 struct QScriptValuePrivatePointerDeleter;
57 class Q_SCRIPT_EXPORT QScriptValue
62 ResolvePrototype = 0x01,
64 ResolveFull = ResolvePrototype | ResolveScope
67 Q_DECLARE_FLAGS(ResolveFlags, ResolveFlag)
70 ReadOnly = 0x00000001,
71 Undeletable = 0x00000002,
72 SkipInEnumeration = 0x00000004,
74 PropertyGetter = 0x00000008,
75 PropertySetter = 0x00000010,
77 QObjectMember = 0x00000020,
79 KeepExistingFlags = 0x00000800,
81 UserRange = 0xff000000
83 Q_DECLARE_FLAGS(PropertyFlags, PropertyFlag)
93 QScriptValue(
const QScriptValue &other);
94 QScriptValue(QScriptEngine *engine, SpecialValue val);
95 QScriptValue(QScriptEngine *engine,
bool val);
96 QScriptValue(QScriptEngine *engine,
int val);
97 QScriptValue(QScriptEngine *engine, uint val);
98 QScriptValue(QScriptEngine *engine, qsreal val);
99 QScriptValue(QScriptEngine *engine,
const QString &val);
100 #ifndef QT_NO_CAST_FROM_ASCII
101 QT_ASCII_CAST_WARN_CONSTRUCTOR QScriptValue(QScriptEngine *engine,
const char *val);
104 QScriptValue(SpecialValue
value);
105 QScriptValue(
bool value);
106 QScriptValue(
int value);
107 QScriptValue(uint
value);
108 QScriptValue(qsreal
value);
111 #ifndef QT_NO_CAST_FROM_ASCII
112 QT_ASCII_CAST_WARN_CONSTRUCTOR QScriptValue(
const char *
value);
115 QScriptValue &operator=(
const QScriptValue &other);
117 QScriptEngine *engine()
const;
119 bool isValid()
const;
121 bool isBoolean()
const;
122 bool isNumber()
const;
123 bool isFunction()
const;
125 bool isString()
const;
126 bool isUndefined()
const;
127 bool isVariant()
const;
128 bool isQObject()
const;
129 bool isQMetaObject()
const;
130 bool isObject()
const;
132 bool isRegExp()
const;
133 bool isArray()
const;
134 bool isError()
const;
137 qsreal toNumber()
const;
139 bool toBoolean()
const;
140 qsreal toInteger()
const;
144 QVariant toVariant()
const;
145 QObject *toQObject()
const;
146 const QMetaObject *toQMetaObject()
const;
147 QScriptValue toObject()
const;
148 QDateTime toDateTime()
const;
153 bool instanceOf(
const QScriptValue &other)
const;
155 bool lessThan(
const QScriptValue &other)
const;
156 bool equals(
const QScriptValue &other)
const;
157 bool strictlyEquals(
const QScriptValue &other)
const;
159 QScriptValue prototype()
const;
160 void setPrototype(
const QScriptValue &prototype);
162 QScriptValue scope()
const;
163 void setScope(
const QScriptValue &scope);
166 const ResolveFlags &
mode = ResolvePrototype)
const;
168 const PropertyFlags &flags = KeepExistingFlags);
170 QScriptValue property(
quint32 arrayIndex,
171 const ResolveFlags &
mode = ResolvePrototype)
const;
172 void setProperty(
quint32 arrayIndex,
const QScriptValue &
value,
173 const PropertyFlags &flags = KeepExistingFlags);
175 QScriptValue property(
const QScriptString &
name,
176 const ResolveFlags &
mode = ResolvePrototype)
const;
177 void setProperty(
const QScriptString &
name,
const QScriptValue &
value,
178 const PropertyFlags &flags = KeepExistingFlags);
180 QScriptValue::PropertyFlags propertyFlags(
181 const QString &
name,
const ResolveFlags &
mode = ResolvePrototype)
const;
182 QScriptValue::PropertyFlags propertyFlags(
183 const QScriptString &
name,
const ResolveFlags &
mode = ResolvePrototype)
const;
185 QScriptValue call(
const QScriptValue &thisObject = QScriptValue(),
187 QScriptValue call(
const QScriptValue &thisObject,
188 const QScriptValue &arguments);
190 QScriptValue construct(
const QScriptValue &arguments);
192 QScriptValue
data()
const;
193 void setData(
const QScriptValue &
data);
195 QScriptClass *scriptClass()
const;
196 void setScriptClass(QScriptClass *scriptClass);
202 QScriptValue(
void *);
204 QScriptValue(QScriptEngine *,
void *);
206 QScriptValue(QScriptValuePrivate*);
211 Q_DECLARE_PRIVATE(QScriptValue)
213 friend class QScriptEnginePrivate;
216 Q_DECLARE_OPERATORS_FOR_FLAGS(QScriptValue::ResolveFlags)
217 Q_DECLARE_OPERATORS_FOR_FLAGS(QScriptValue::PropertyFlags)
QList< QScriptValue > QScriptValueList
#define QT_BEGIN_NAMESPACE
GLsizei GLsizei GLenum GLenum const GLvoid * data
GLsizei const GLfloat * value
GLuint const GLchar * name