Qt 4.8
|
#include <qdeclarativeglobalscriptclass_p.h>
Public Functions | |
void | explicitSetProperty (const QStringList &, const QList< QScriptValue > &) |
const QSet< QString > & | illegalNames () const |
QDeclarativeGlobalScriptClass (QScriptEngine *) | |
virtual QueryFlags | queryProperty (const QScriptValue &object, const QScriptString &name, QueryFlags flags, uint *id) |
Queries this script class for how access to the property with the given name of the given object should be handled. More... | |
virtual void | setProperty (QScriptValue &object, const QScriptString &name, uint id, const QScriptValue &value) |
Sets the property with the given name of the given object to the given value. More... | |
const QScriptValue & | staticGlobalObject () const |
Public Functions inherited from QScriptClass | |
QScriptEngine * | engine () const |
Returns the engine that this QScriptClass is associated with. More... | |
virtual QVariant | extension (Extension extension, const QVariant &argument=QVariant()) |
This virtual function can be reimplemented in a QScriptClass subclass to provide support for extensions. More... | |
virtual QString | name () const |
Returns the name of the script class. More... | |
virtual QScriptClassPropertyIterator * | newIterator (const QScriptValue &object) |
Returns an iterator for traversing custom properties of the given object. More... | |
virtual QScriptValue | property (const QScriptValue &object, const QScriptString &name, uint id) |
Returns the value of the property with the given name of the given object. More... | |
virtual QScriptValue::PropertyFlags | propertyFlags (const QScriptValue &object, const QScriptString &name, uint id) |
Returns the flags of the property with the given name of the given object. More... | |
virtual QScriptValue | prototype () const |
Returns the object to be used as the prototype of new instances of this class (created with QScriptEngine::newObject()). More... | |
QScriptClass (QScriptEngine *engine) | |
Constructs a QScriptClass object to be used in the given engine. More... | |
virtual bool | supportsExtension (Extension extension) const |
Returns true if the QScriptClass supports the given extension; otherwise, false is returned. More... | |
virtual | ~QScriptClass () |
Destroys the QScriptClass object. More... | |
Properties | |
QSet< QString > | m_illegalNames |
QScriptValue | m_staticGlobalObject |
Additional Inherited Members | |
Public Types inherited from QScriptClass | |
enum | Extension { Callable, HasInstance } |
This enum specifies the possible extensions to a QScriptClass. More... | |
enum | QueryFlag { HandlesReadAccess = 0x01, HandlesWriteAccess = 0x02 } |
This enum describes flags that are used to query a QScriptClass regarding how access to a property should be handled. More... | |
Protected Functions inherited from QScriptClass | |
QScriptClass (QScriptEngine *engine, QScriptClassPrivate &dd) | |
Protected Variables inherited from QScriptClass | |
QScopedPointer< QScriptClassPrivate > | d_ptr |
Definition at line 61 of file qdeclarativeglobalscriptclass_p.h.
QDeclarativeGlobalScriptClass::QDeclarativeGlobalScriptClass | ( | QScriptEngine * | engine | ) |
Definition at line 57 of file qdeclarativeglobalscriptclass.cpp.
void QDeclarativeGlobalScriptClass::explicitSetProperty | ( | const QStringList & | names, |
const QList< QScriptValue > & | values | ||
) |
Definition at line 122 of file qdeclarativeglobalscriptclass.cpp.
Definition at line 77 of file qdeclarativeglobalscriptclass_p.h.
Referenced by QDeclarativeCompiler::checkDynamicMeta(), and QDeclarativeCompiler::checkValidId().
|
virtual |
Queries this script class for how access to the property with the given name of the given object should be handled.
The given flags specify the aspects of interest. This function should return a subset of flags to indicate which aspects of property access should be further handled by the script class.
For example, if the flags contain HandlesReadAccess, and you would like your class to handle the reading of the property (through the property() function), the returned flags should include HandlesReadAccess. If the returned flags do not contain HandlesReadAccess, the property will be handled as a normal script object property.
You can optionally use the id argument to store a value that will subsequently be passed on to functions such as property() and setProperty().
The default implementation of this function returns 0.
Note: This function is only called if the given property isn't already a normal property of the object. For example, say you advertise that you want to handle read access to property foo
, but not write access; if foo
is then assigned a value, it will become a normal script object property, and subsequently you will no longer be queried regarding read access to foo
.
Reimplemented from QScriptClass.
Definition at line 98 of file qdeclarativeglobalscriptclass.cpp.
|
virtual |
Sets the property with the given name of the given object to the given value.
The id argument is only useful if you assigned a value to it in queryProperty().
The default implementation does nothing.
An invalid value represents a request to remove the property.
Reimplemented from QScriptClass.
Definition at line 109 of file qdeclarativeglobalscriptclass.cpp.
|
inline |
Definition at line 75 of file qdeclarativeglobalscriptclass_p.h.
Referenced by QDeclarativeContextData::addImportedScript(), QDeclarativeExpressionPrivate::evalInObjectScope(), QDeclarativeInclude::include(), QDeclarativeExpressionPrivate::init(), and QDeclarativeExpressionPrivate::scriptValue().
Definition at line 80 of file qdeclarativeglobalscriptclass_p.h.
Referenced by QDeclarativeGlobalScriptClass().
|
private |
Definition at line 81 of file qdeclarativeglobalscriptclass_p.h.
Referenced by QDeclarativeGlobalScriptClass().