2 Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef qscriptvalue_h
21 #define qscriptvalue_h
23 #include <QtCore/qlist.h>
24 #include <QtCore/qshareddata.h>
27 class QScriptValuePrivate
;
30 typedef QList
<QScriptValue
> QScriptValueList
;
32 typedef double qsreal
;
42 QScriptValue(bool value
);
43 QScriptValue(int value
);
44 QScriptValue(uint value
);
45 QScriptValue(qsreal value
);
46 QScriptValue(const QString
& value
);
47 QScriptValue(const char* value
);
48 QScriptValue(SpecialValue value
);
49 QScriptValue(const QScriptValue
& other
);
51 QScriptValue(QScriptEngine
* engine
, bool value
);
52 QScriptValue(QScriptEngine
* engine
, int value
);
53 QScriptValue(QScriptEngine
* engine
, uint value
);
54 QScriptValue(QScriptEngine
* engine
, qsreal value
);
55 QScriptValue(QScriptEngine
* engine
, const QString
& value
);
56 QScriptValue(QScriptEngine
* engine
, const char* value
);
57 QScriptValue(QScriptEngine
* engine
, SpecialValue value
);
61 QScriptValue
& operator=(const QScriptValue
& other
);
62 bool equals(const QScriptValue
& other
) const;
63 bool strictlyEquals(const QScriptValue
& other
) const;
65 QScriptEngine
* engine() const;
69 bool isBoolean() const;
70 bool isNumber() const;
71 bool isFunction() const;
73 bool isString() const;
74 bool isUndefined() const;
75 bool isObject() const;
78 QString
toString() const;
79 qsreal
toNumber() const;
81 bool toBoolean() const;
82 qsreal
toInteger() const;
83 qint32
toInt32() const;
84 quint32
toUInt32() const;
85 quint16
toUInt16() const;
87 QScriptValue
call(const QScriptValue
& thisObject
= QScriptValue(),
88 const QScriptValueList
& args
= QScriptValueList());
92 QScriptValue(QScriptValuePrivate
*);
94 QExplicitlySharedDataPointer
<QScriptValuePrivate
> d_ptr
;
96 friend class QScriptValuePrivate
;
99 #endif // qscriptvalue_h