kjsembed
binding_support.h File Reference
#include <QtCore/QDate>
#include <QtCore/QStringList>
#include <kjsembed/kjseglobal.h>
#include <kjsembed/pointer.h>
#include <kjs/object.h>
#include <kdemacros.h>


Go to the source code of this file.
Classes | |
struct | KJSEmbed::Constructor |
struct | KJSEmbed::Enumerator |
Enumerator structure. More... | |
struct | KJSEmbed::Method |
Method structure. More... | |
class | KJSEmbed::ProxyBinding |
Namespaces | |
namespace | KJS |
namespace | KJSEmbed |
Defines | |
#define | END_CTOR } |
#define | END_ENUM_LUT |
#define | END_METHOD_LUT |
#define | KJS_BINDING(NAME) |
#define | KJSO_BINDING(NAME, TYPE, BASENAME) |
#define | KJSO_BINDING_NOEXP(NAME, TYPE, BASENAME) |
#define | KJSO_END_BIND } |
#define | KJSO_END_BINDING_CTOR } |
#define | KJSO_END_CTOR } |
#define | KJSO_QOBJECT_BIND(NAME, TYPE) |
#define | KJSO_QOBJECT_END_BIND } |
#define | KJSO_QOBJECT_START_BIND(NAME, TYPE) |
#define | KJSO_SIMPLE_BINDING_CTOR(NAME, TYPE, BASENAME) |
#define | KJSO_START_BIND(NAME, TYPE) |
#define | KJSO_START_BINDING_CTOR(NAME, TYPE, BASENAME) |
#define | KJSO_START_CTOR(TYPE, JSNAME, ARGS) |
#define | KJSO_VALUE_BIND(NAME, TYPE) |
#define | KJSO_VALUE_BINDING(NAME, TYPE, BASENAME) |
#define | KJSO_VALUE_END_BIND } |
#define | KJSO_VALUE_START_BIND(NAME, TYPE) |
#define | KJSV_SIMPLE_BINDING_CTOR(NAME, JSNAME, TYPE, BASENAME) |
#define | NO_ENUMS(TYPE) const Enumerator TYPE::p_enums[] = {{0, 0 }}; |
#define | NO_METHODS(TYPE) const Method TYPE::p_methods[] = { {0, 0, 0, 0 } }; |
#define | NO_STATICS(TYPE) const Method TYPE::p_statics[] = { {0, 0, 0, 0 } }; |
#define | START_CTOR(TYPE, JSNAME, ARGS) |
#define | START_ENUM_LUT(TYPE) |
#define | START_METHOD_LUT(TYPE) |
#define | START_STATIC_METHOD_LUT(TYPE) |
Typedefs | |
typedef KJS::JSObject *(* | KJSEmbed::callBind )(KJS::ExecState *, PointerBase &) |
typedef KJS::JSObject *(* | KJSEmbed::callConstructor )(KJS::ExecState *, const KJS::List &) |
typedef KJS::JSValue *(* | KJSEmbed::callMethod )(KJS::ExecState *, KJS::JSObject *, const KJS::List &) |
Functions | |
KJS::JSValue * | KJSEmbed::createBool (KJS::ExecState *exec, bool value) |
KJS::JSValue * | KJSEmbed::createDouble (KJS::ExecState *exec, double value) |
KJS::JSValue * | KJSEmbed::createFloat (KJS::ExecState *exec, float value) |
KJS::JSValue * | KJSEmbed::createInt (KJS::ExecState *exec, int value) |
KJS::JSValue * | KJSEmbed::createQByteArray (KJS::ExecState *exec, const QByteArray &value) |
KJS::JSValue * | KJSEmbed::createQDate (KJS::ExecState *exec, const QDate &value) |
KJS::JSValue * | KJSEmbed::createQDateTime (KJS::ExecState *exec, const QDateTime &value) |
KJS::JSValue * | KJSEmbed::createQString (KJS::ExecState *exec, const QString &value) |
KJS::JSValue * | KJSEmbed::createQStringList (KJS::ExecState *exec, const QStringList &value) |
KJS::JSValue * | KJSEmbed::createQTime (KJS::ExecState *exec, const QTime &value) |
template<typename T > | |
T * | KJSEmbed::extractBindingImp (KJS::JSObject *obj) |
template<typename T > | |
T * | KJSEmbed::extractBindingImp (KJS::ExecState *exec, KJS::JSValue *val) |
bool | KJSEmbed::extractBool (KJS::ExecState *exec, KJS::JSValue *value, bool defaultValue=false) |
bool KJSEMBED_EXPORT | KJSEmbed::extractBool (KJS::ExecState *exec, const KJS::List &args, int idx, bool defaultValue=false) |
double KJSEMBED_EXPORT | KJSEmbed::extractDouble (KJS::ExecState *exec, KJS::JSValue *value, double defaultValue=0) |
double KJSEMBED_EXPORT | KJSEmbed::extractDouble (KJS::ExecState *exec, const KJS::List &args, int idx, double defaultValue=0) |
float KJSEMBED_EXPORT | KJSEmbed::extractFloat (KJS::ExecState *exec, KJS::JSValue *value, float defaultValue=0) |
float KJSEMBED_EXPORT | KJSEmbed::extractFloat (KJS::ExecState *exec, const KJS::List &args, int idx, float defaultValue=0) |
int KJSEMBED_EXPORT | KJSEmbed::extractInt (KJS::ExecState *exec, KJS::JSValue *value, int defaultValue=0) |
int KJSEMBED_EXPORT | KJSEmbed::extractInt (KJS::ExecState *exec, const KJS::List &args, int idx, int defaultValue=0) |
template<typename T > | |
T KJSEMBED_EXPORT | KJSEmbed::extractInteger (KJS::ExecState *exec, const KJS::List &args, int idx, T defaultValue=T(0)) |
template<typename T > | |
T KJSEMBED_EXPORT | KJSEmbed::extractInteger (KJS::ExecState *exec, KJS::JSValue *value, T defaultValue) |
template<> | |
qint32 KJSEMBED_EXPORT | KJSEmbed::extractInteger< qint32 > (KJS::ExecState *exec, KJS::JSValue *value, qint32 defaultValue) |
template<> | |
quint16 KJSEMBED_EXPORT | KJSEmbed::extractInteger< quint16 > (KJS::ExecState *exec, KJS::JSValue *value, quint16 defaultValue) |
template<> | |
quint32 KJSEMBED_EXPORT | KJSEmbed::extractInteger< quint32 > (KJS::ExecState *exec, KJS::JSValue *value, quint32 defaultValue) |
template<typename T > | |
T KJSEMBED_EXPORT | KJSEmbed::extractNumber (KJS::ExecState *exec, const KJS::List &args, int idx, T defaultValue=T(0)) |
template<typename T > | |
T KJSEMBED_EXPORT | KJSEmbed::extractNumber (KJS::ExecState *exec, KJS::JSValue *value, T defaultValue=T(0)) |
QByteArray KJSEMBED_EXPORT | KJSEmbed::extractQByteArray (KJS::ExecState *exec, KJS::JSValue *value, const QByteArray &defaultValue=QByteArray()) |
QByteArray KJSEMBED_EXPORT | KJSEmbed::extractQByteArray (KJS::ExecState *exec, const KJS::List &args, int idx, const QByteArray &defaultValue=QByteArray()) |
QDate KJSEMBED_EXPORT | KJSEmbed::extractQDate (KJS::ExecState *exec, KJS::JSValue *value, const QDate &defaultValue=QDate()) |
QDate KJSEMBED_EXPORT | KJSEmbed::extractQDate (KJS::ExecState *exec, const KJS::List &args, int idx, const QDate &defaultValue=QDate()) |
QDateTime KJSEMBED_EXPORT | KJSEmbed::extractQDateTime (KJS::ExecState *exec, KJS::JSValue *value, const QDateTime &defaultValue=QDateTime()) |
QDateTime KJSEMBED_EXPORT | KJSEmbed::extractQDateTime (KJS::ExecState *exec, const KJS::List &args, int idx, const QDateTime &defaultValue=QDateTime()) |
QString KJSEMBED_EXPORT | KJSEmbed::extractQString (KJS::ExecState *exec, KJS::JSValue *value, const QString defaultValue=QString()) |
QString KJSEMBED_EXPORT | KJSEmbed::extractQString (KJS::ExecState *exec, const KJS::List &args, int idx, const QString defaultValue=QString()) |
QStringList KJSEMBED_EXPORT | KJSEmbed::extractQStringList (KJS::ExecState *exec, KJS::JSValue *value, const QStringList &defaultValue=QStringList()) |
QStringList KJSEMBED_EXPORT | KJSEmbed::extractQStringList (KJS::ExecState *exec, const KJS::List &args, int idx, const QStringList &defaultValue=QStringList()) |
QTime KJSEMBED_EXPORT | KJSEmbed::extractQTime (KJS::ExecState *exec, KJS::JSValue *value, const QTime &defaultValue=QTime()) |
QTime KJSEMBED_EXPORT | KJSEmbed::extractQTime (KJS::ExecState *exec, const KJS::List &args, int idx, const QTime &defaultValue=QTime()) |
template<typename T > | |
T KJSEMBED_EXPORT | KJSEmbed::extractString (KJS::ExecState *exec, const KJS::List &args, int idx, T defaultValue=T()) |
template<typename T > | |
T KJSEMBED_EXPORT | KJSEmbed::extractString (KJS::ExecState *exec, KJS::JSValue *value, T defaultValue=T()) |
JSObject * | KJS::throwError (ExecState *e, ErrorType t, const QString &m) |
Define Documentation
#define END_CTOR } |
Definition at line 166 of file binding_support.h.
#define END_ENUM_LUT |
#define END_METHOD_LUT |
#define KJS_BINDING | ( | NAME | ) |
Value:
class NAME \ { \ public: \ static const KJSEmbed::Method p_methods[]; \ static const KJSEmbed::Method p_statics[]; \ static const KJSEmbed::Enumerator p_enums[]; \ static const KJSEmbed::Constructor p_constructor; \ static KJS::JSObject *ctorMethod( KJS::ExecState *exec, const KJS::List &args );\ static const KJSEmbed::Enumerator *enums() { return p_enums;} \ static const KJSEmbed::Method *methods() { return p_methods;} \ static const KJSEmbed::Method *statics() { return p_statics;} \ static const KJSEmbed::Constructor *constructor() { return &p_constructor;} \ static const KJS::JSObject *construct(KJS::ExecState *exec, const KJS::List &args)\ { return (*p_constructor.construct)(exec,args); } \ };
Definition at line 34 of file binding_support.h.
#define KJSO_BINDING | ( | NAME, | |||
TYPE, | |||||
BASENAME | ) |
Value:
class KJSEMBED_EXPORT NAME : public BASENAME \ { \ public: \ NAME(KJS::ExecState *exec, TYPE * obj); \ static const KJSEmbed::Method p_methods[]; \ static const KJSEmbed::Method p_statics[]; \ static const KJSEmbed::Enumerator p_enums[]; \ static const KJSEmbed::Constructor p_constructor; \ static KJS::JSObject *bindMethod( KJS::ExecState *exec, PointerBase& ptrObj );\ static KJS::JSObject *ctorMethod( KJS::ExecState *exec, const KJS::List &args );\ static const KJSEmbed::Enumerator *enums() { return p_enums;} \ static const KJSEmbed::Method *methods() { return p_methods;} \ static const KJSEmbed::Method *statics() { return p_statics;} \ static const KJSEmbed::Constructor *constructor() { return &p_constructor;} \ };
Definition at line 51 of file binding_support.h.
#define KJSO_BINDING_NOEXP | ( | NAME, | |||
TYPE, | |||||
BASENAME | ) |
Value:
class NAME : public BASENAME \ { \ public: \ NAME(KJS::ExecState *exec, TYPE * obj); \ static const KJSEmbed::Method p_methods[]; \ static const KJSEmbed::Method p_statics[]; \ static const KJSEmbed::Enumerator p_enums[]; \ static const KJSEmbed::Constructor p_constructor; \ static KJS::JSObject *bindMethod( KJS::ExecState *exec, PointerBase& ptrObj );\ static KJS::JSObject *ctorMethod( KJS::ExecState *exec, const KJS::List &args );\ static const KJSEmbed::Enumerator *enums() { return p_enums;} \ static const KJSEmbed::Method *methods() { return p_methods;} \ static const KJSEmbed::Method *statics() { return p_statics;} \ static const KJSEmbed::Constructor *constructor() { return &p_constructor;} \ };
Definition at line 69 of file binding_support.h.
#define KJSO_END_BIND } |
Definition at line 188 of file binding_support.h.
#define KJSO_END_BINDING_CTOR } |
Definition at line 110 of file binding_support.h.
#define KJSO_END_CTOR } |
Definition at line 178 of file binding_support.h.
#define KJSO_QOBJECT_BIND | ( | NAME, | |||
TYPE | ) |
Value:
KJS::JSObject *NAME::bindMethod( KJS::ExecState *exec, PointerBase& ptrObj )\ {\ Q_UNUSED(exec);\ QObject* qobj = pointer_cast<QObject>(&ptrObj); \ if (! qobj ) \ return 0; \ TYPE* object = qobject_cast<TYPE*>(qobj); \ if (! object ) \ return 0; \ return new NAME(exec, object); \ }
Definition at line 205 of file binding_support.h.
#define KJSO_QOBJECT_END_BIND } |
Definition at line 202 of file binding_support.h.
#define KJSO_QOBJECT_START_BIND | ( | NAME, | |||
TYPE | ) |
Value:
KJS::JSObject *NAME::bindMethod( KJS::ExecState *exec, PointerBase& ptrObj )\ {\ Q_UNUSED(exec);\ QObject* qobj = pointer_cast<QObject>(&ptrObj); \ if (! qobj ) \ return 0; \ TYPE* object = qobject_cast<TYPE*>(qobj); \ if (! object ) \ return 0; \
Definition at line 191 of file binding_support.h.
#define KJSO_SIMPLE_BINDING_CTOR | ( | NAME, | |||
TYPE, | |||||
BASENAME | ) |
Value:
NAME::NAME(KJS::ExecState *exec, TYPE * obj) \
: BASENAME( exec, obj ) \
{ \
StaticBinding::publish( exec, this, NAME::methods() ); \
}
Definition at line 113 of file binding_support.h.
#define KJSO_START_BIND | ( | NAME, | |||
TYPE | ) |
Value:
KJS::JSObject *NAME::bindMethod( KJS::ExecState *exec, PointerBase& ptrObj )\ {\ Q_UNUSED(exec);\ Q_UNUSED(ptrObj); \
Definition at line 182 of file binding_support.h.
#define KJSO_START_BINDING_CTOR | ( | NAME, | |||
TYPE, | |||||
BASENAME | ) |
Value:
NAME::NAME(KJS::ExecState *exec, TYPE * obj) \
: BASENAME( exec, obj ) \
{ \
StaticBinding::publish( exec, this, NAME::methods() );
Definition at line 104 of file binding_support.h.
#define KJSO_START_CTOR | ( | TYPE, | |||
JSNAME, | |||||
ARGS | ) |
Value:
const Constructor TYPE::p_constructor = \ { \ #JSNAME, ARGS, KJS::DontDelete|KJS::ReadOnly, &TYPE::bindMethod, &TYPE::ctorMethod, p_statics, p_enums, p_methods };\ KJS::JSObject *TYPE::ctorMethod( KJS::ExecState *exec, const KJS::List &args )\ {\ Q_UNUSED(exec);\ Q_UNUSED(args);
Definition at line 169 of file binding_support.h.
#define KJSO_VALUE_BIND | ( | NAME, | |||
TYPE | ) |
Value:
KJS::JSObject *NAME::bindMethod( KJS::ExecState *exec, PointerBase& ptrObj )\ {\ Q_UNUSED(exec);\ TYPE* object = pointer_cast<TYPE>(&ptrObj); \ if (! object ) \ return 0; \ return new NAME(exec, *object); \ }
Definition at line 229 of file binding_support.h.
#define KJSO_VALUE_BINDING | ( | NAME, | |||
TYPE, | |||||
BASENAME | ) |
Value:
class KJSEMBED_EXPORT NAME : public BASENAME \ { \ public: \ NAME(KJS::ExecState *exec, const TYPE & val ); \ NAME(KJS::ExecState *exec, const char *typeName ); \ static const KJSEmbed::Method p_methods[]; \ static const KJSEmbed::Method p_statics[]; \ static const KJSEmbed::Enumerator p_enums[]; \ static const KJSEmbed::Constructor p_constructor; \ static KJS::JSObject *bindMethod( KJS::ExecState *exec, PointerBase& ptrObj );\ static KJS::JSObject *ctorMethod( KJS::ExecState *exec, const KJS::List &args );\ static const KJSEmbed::Enumerator *enums() { return p_enums;} \ static const KJSEmbed::Method *methods() { return p_methods;} \ static const KJSEmbed::Method *statics() { return p_statics;} \ static const KJSEmbed::Constructor *constructor() { return &p_constructor;} \ };
Definition at line 86 of file binding_support.h.
#define KJSO_VALUE_END_BIND } |
Definition at line 226 of file binding_support.h.
#define KJSO_VALUE_START_BIND | ( | NAME, | |||
TYPE | ) |
Value:
KJS::JSObject *NAME::bindMethod( KJS::ExecState *exec, PointerBase& ptrObj )\ {\ Q_UNUSED(exec);\ TYPE* object = pointer_cast<TYPE>(&ptrObj); \ if (! object ) \ return 0; \
Definition at line 218 of file binding_support.h.
#define KJSV_SIMPLE_BINDING_CTOR | ( | NAME, | |||
JSNAME, | |||||
TYPE, | |||||
BASENAME | ) |
Value:
NAME::NAME(KJS::ExecState *exec, const TYPE & value) \ : BASENAME( exec, #JSNAME , value ) \ { \ StaticBinding::publish( exec, this, NAME::methods() ); \ }
Definition at line 120 of file binding_support.h.
#define NO_ENUMS | ( | TYPE | ) | const Enumerator TYPE::p_enums[] = {{0, 0 }}; |
Definition at line 147 of file binding_support.h.
#define NO_METHODS | ( | TYPE | ) | const Method TYPE::p_methods[] = { {0, 0, 0, 0 } }; |
Definition at line 150 of file binding_support.h.
#define NO_STATICS | ( | TYPE | ) | const Method TYPE::p_statics[] = { {0, 0, 0, 0 } }; |
Definition at line 153 of file binding_support.h.
#define START_CTOR | ( | TYPE, | |||
JSNAME, | |||||
ARGS | ) |
Value:
const Constructor TYPE::p_constructor = \ { \ #JSNAME, ARGS, KJS::DontDelete|KJS::ReadOnly, 0, &TYPE::ctorMethod, p_statics, p_enums, p_methods };\ KJS::JSObject *TYPE::ctorMethod( KJS::ExecState *exec, const KJS::List &args )\ {\ Q_UNUSED(exec);\ Q_UNUSED(args);
Definition at line 157 of file binding_support.h.
#define START_ENUM_LUT | ( | TYPE | ) |
#define START_METHOD_LUT | ( | TYPE | ) |
#define START_STATIC_METHOD_LUT | ( | TYPE | ) |