kjsembed
KJSEmbed::StaticConstructor Class Reference
#include <static_binding.h>

Detailed Description
A special method that will create other objects.If you want to have your binding to be able to create instances of itself it must have at least one of these objects published at the global scope.
Definition at line 68 of file static_binding.h.
Public Member Functions | |
void | addStaticMethods (KJS::ExecState *exec, const Method *methods) |
KJS::JSValue * | callAsFunction (KJS::ExecState *exec, KJS::JSObject *, const KJS::List &args) |
KJS::JSObject * | construct (KJS::ExecState *exec, const KJS::List &args) |
KJS::JSValue * | defaultValue (KJS::ExecState *exec, KJS::JSType hint) const |
bool | implementsConstruct () const |
void | setDefaultValue (KJS::JSValue *value) |
StaticConstructor (KJS::ExecState *exec, const Constructor *constructor) | |
Static Public Member Functions | |
static KJS::JSObject * | add (KJS::ExecState *exec, KJS::JSObject *object, const Constructor *constructor) |
static KJS::JSObject * | bind (KJS::ExecState *exec, const QString &className, PointerBase &objPtr) |
static KJS::JSObject * | construct (KJS::ExecState *exec, KJS::JSObject *parent, const KJS::UString &className, const KJS::List &args=KJS::List()) |
static const Constructor * | constructor (const KJS::UString &className) |
static const Method * | methods (const KJS::UString &className) |
Protected Attributes | |
const Constructor * | m_constructor |
Constructor & Destructor Documentation
StaticConstructor::StaticConstructor | ( | KJS::ExecState * | exec, | |
const Constructor * | constructor | |||
) |
Member Function Documentation
KJS::JSObject * StaticConstructor::add | ( | KJS::ExecState * | exec, | |
KJS::JSObject * | object, | |||
const Constructor * | constructor | |||
) | [static] |
Add the constructor to an object.
This is usually the global scope.
Definition at line 96 of file static_binding.cpp.
void KJSEmbed::StaticConstructor::addStaticMethods | ( | KJS::ExecState * | exec, | |
const Method * | methods | |||
) |
Add static methods to the object.
KJS::JSObject *ctor = StaticConstructor::add( exec, parent, TestPointer::constructor() ); // Ctor ctor.addStaticMethods( exec, TestPointer::staticMethods() );
KJS::JSObject * StaticConstructor::bind | ( | KJS::ExecState * | exec, | |
const QString & | className, | |||
PointerBase & | objPtr | |||
) | [static] |
Definition at line 130 of file static_binding.cpp.
KJS::JSValue* KJSEmbed::StaticConstructor::callAsFunction | ( | KJS::ExecState * | exec, | |
KJS::JSObject * | , | |||
const KJS::List & | args | |||
) | [inline] |
Definition at line 93 of file static_binding.h.
KJS::JSObject * StaticConstructor::construct | ( | KJS::ExecState * | exec, | |
KJS::JSObject * | parent, | |||
const KJS::UString & | className, | |||
const KJS::List & | args = KJS::List() | |||
) | [static] |
This method is used to construct a KJS value from C++.
KJS::List args; args.append("test"); KJS::Value myType = KJSEmbed::construct(exec, "MyType", args);
var myType = new MyType("test");
Definition at line 140 of file static_binding.cpp.
KJS::JSObject * StaticConstructor::construct | ( | KJS::ExecState * | exec, | |
const KJS::List & | args | |||
) |
Calls the callback that will in turn create a new instance of this object with the arguments passed in with args.
Definition at line 79 of file static_binding.cpp.
const Constructor * StaticConstructor::constructor | ( | const KJS::UString & | className | ) | [static] |
Definition at line 125 of file static_binding.cpp.
KJS::JSValue * StaticConstructor::defaultValue | ( | KJS::ExecState * | exec, | |
KJS::JSType | hint | |||
) | const |
Definition at line 89 of file static_binding.cpp.
bool KJSEmbed::StaticConstructor::implementsConstruct | ( | ) | const [inline] |
Definition at line 86 of file static_binding.h.
const Method * StaticConstructor::methods | ( | const KJS::UString & | className | ) | [static] |
Definition at line 120 of file static_binding.cpp.
void StaticConstructor::setDefaultValue | ( | KJS::JSValue * | value | ) |
Definition at line 84 of file static_binding.cpp.
Member Data Documentation
const Constructor* KJSEmbed::StaticConstructor::m_constructor [protected] |
Definition at line 124 of file static_binding.h.
The documentation for this class was generated from the following files: