• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

kjsembed

  • sources
  • kde-4.12
  • kdelibs
  • kjsembed
  • kjsembed
Classes | Namespaces | Macros | Typedefs | Functions
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>
Include dependency graph for binding_support.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  KJSEmbed::Constructor
 
struct  KJSEmbed::Enumerator
 
struct  KJSEmbed::Method
 
class  KJSEmbed::ProxyBinding
 

Namespaces

 KJS
 
 KJSEmbed
 

Macros

#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::ExecState *exec, KJS::JSValue *val)
 
template<typename T >
T * KJSEmbed::extractBindingImp (KJS::JSObject *obj)
 
bool KJSEMBED_EXPORT KJSEmbed::extractBool (KJS::ExecState *exec, const KJS::List &args, int idx, bool defaultValue=false)
 
bool KJSEmbed::extractBool (KJS::ExecState *exec, KJS::JSValue *value, bool defaultValue=false)
 
double KJSEMBED_EXPORT KJSEmbed::extractDouble (KJS::ExecState *exec, const KJS::List &args, int idx, double defaultValue=0)
 
double KJSEMBED_EXPORT KJSEmbed::extractDouble (KJS::ExecState *exec, KJS::JSValue *value, double defaultValue=0)
 
float KJSEMBED_EXPORT KJSEmbed::extractFloat (KJS::ExecState *exec, const KJS::List &args, int idx, float defaultValue=0)
 
float KJSEMBED_EXPORT KJSEmbed::extractFloat (KJS::ExecState *exec, KJS::JSValue *value, float defaultValue=0)
 
int KJSEMBED_EXPORT KJSEmbed::extractInt (KJS::ExecState *exec, const KJS::List &args, int idx, int defaultValue=0)
 
int KJSEMBED_EXPORT KJSEmbed::extractInt (KJS::ExecState *exec, KJS::JSValue *value, int defaultValue=0)
 
template<typename T >
T KJSEMBED_EXPORT KJSEmbed::extractInteger (KJS::ExecState *exec, KJS::JSValue *value, T defaultValue)
 
template<typename T >
T KJSEMBED_EXPORT KJSEmbed::extractInteger (KJS::ExecState *exec, const KJS::List &args, int idx, T defaultValue=T(0))
 
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, KJS::JSValue *value, T defaultValue=T(0))
 
template<typename T >
T KJSEMBED_EXPORT KJSEmbed::extractNumber (KJS::ExecState *exec, const KJS::List &args, int idx, T defaultValue=T(0))
 
QByteArray KJSEMBED_EXPORT KJSEmbed::extractQByteArray (KJS::ExecState *exec, const KJS::List &args, int idx, const QByteArray &defaultValue=QByteArray())
 
QByteArray KJSEMBED_EXPORT KJSEmbed::extractQByteArray (KJS::ExecState *exec, KJS::JSValue *value, const QByteArray &defaultValue=QByteArray())
 
QDate KJSEMBED_EXPORT KJSEmbed::extractQDate (KJS::ExecState *exec, const KJS::List &args, int idx, const QDate &defaultValue=QDate())
 
QDate KJSEMBED_EXPORT KJSEmbed::extractQDate (KJS::ExecState *exec, KJS::JSValue *value, const QDate &defaultValue=QDate())
 
QDateTime KJSEMBED_EXPORT KJSEmbed::extractQDateTime (KJS::ExecState *exec, const KJS::List &args, int idx, const QDateTime &defaultValue=QDateTime())
 
QDateTime KJSEMBED_EXPORT KJSEmbed::extractQDateTime (KJS::ExecState *exec, KJS::JSValue *value, const QDateTime &defaultValue=QDateTime())
 
QString KJSEMBED_EXPORT KJSEmbed::extractQString (KJS::ExecState *exec, const KJS::List &args, int idx, const QString defaultValue=QString())
 
QString KJSEMBED_EXPORT KJSEmbed::extractQString (KJS::ExecState *exec, KJS::JSValue *value, const QString defaultValue=QString())
 
QStringList KJSEMBED_EXPORT KJSEmbed::extractQStringList (KJS::ExecState *exec, const KJS::List &args, int idx, const QStringList &defaultValue=QStringList())
 
QStringList KJSEMBED_EXPORT KJSEmbed::extractQStringList (KJS::ExecState *exec, KJS::JSValue *value, const QStringList &defaultValue=QStringList())
 
QTime KJSEMBED_EXPORT KJSEmbed::extractQTime (KJS::ExecState *exec, const KJS::List &args, int idx, const QTime &defaultValue=QTime())
 
QTime KJSEMBED_EXPORT KJSEmbed::extractQTime (KJS::ExecState *exec, KJS::JSValue *value, const QTime &defaultValue=QTime())
 
template<typename T >
T KJSEMBED_EXPORT KJSEmbed::extractString (KJS::ExecState *exec, KJS::JSValue *value, T defaultValue=T())
 
template<typename T >
T KJSEMBED_EXPORT KJSEmbed::extractString (KJS::ExecState *exec, const KJS::List &args, int idx, T defaultValue=T())
 
JSObject * KJS::throwError (ExecState *e, ErrorType t, const QString &m)
 

Macro Definition Documentation

#define END_CTOR   }

Definition at line 166 of file binding_support.h.

#define END_ENUM_LUT
Value:
,{0, 0 }\
};

Definition at line 143 of file binding_support.h.

#define END_METHOD_LUT
Value:
,{0, 0, 0, 0 }\
};

Definition at line 135 of file binding_support.h.

#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); } \
};
KJSEmbed::Enumerator
Enumerator structure.
Definition: binding_support.h:317
KJSEmbed::Method
Method structure.
Definition: binding_support.h:294
KJSEmbed::Constructor
Definition: binding_support.h:345
List
Definition: variant_binding.cpp:130

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;} \
};
KJSEmbed::Enumerator
Enumerator structure.
Definition: binding_support.h:317
PointerBase
Definition: pointer.h:31
KJSEmbed::Method
Method structure.
Definition: binding_support.h:294
KJSEmbed::Constructor
Definition: binding_support.h:345
List
Definition: variant_binding.cpp:130
KJSEMBED_EXPORT
#define KJSEMBED_EXPORT
Definition: kjseglobal.h:32

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;} \
};
KJSEmbed::Enumerator
Enumerator structure.
Definition: binding_support.h:317
PointerBase
Definition: pointer.h:31
KJSEmbed::Method
Method structure.
Definition: binding_support.h:294
KJSEmbed::Constructor
Definition: binding_support.h:345
List
Definition: variant_binding.cpp:130

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); \
}
QObject
DomDocumentNS::if
if(!success)
Definition: dom.cpp:363
PointerBase
Definition: pointer.h:31
pointer_cast
ValueType * pointer_cast(PointerBase *pointer)
Definition: pointer.h:133

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; \
QObject
DomDocumentNS::if
if(!success)
Definition: dom.cpp:363
PointerBase
Definition: pointer.h:31
pointer_cast
ValueType * pointer_cast(PointerBase *pointer)
Definition: pointer.h:133

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); \
PointerBase
Definition: pointer.h:31

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); \
}
DomDocumentNS::if
if(!success)
Definition: dom.cpp:363
PointerBase
Definition: pointer.h:31
pointer_cast
ValueType * pointer_cast(PointerBase *pointer)
Definition: pointer.h:133

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;} \
};
KJSEmbed::Enumerator
Enumerator structure.
Definition: binding_support.h:317
DomElementNS::val
QString val
Definition: dom.cpp:529
PointerBase
Definition: pointer.h:31
KJSEmbed::Method
Method structure.
Definition: binding_support.h:294
KJSEmbed::Constructor
Definition: binding_support.h:345
List
Definition: variant_binding.cpp:130
KJSEMBED_EXPORT
#define KJSEMBED_EXPORT
Definition: kjseglobal.h:32

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; \
DomDocumentNS::if
if(!success)
Definition: dom.cpp:363
PointerBase
Definition: pointer.h:31
pointer_cast
ValueType * pointer_cast(PointerBase *pointer)
Definition: pointer.h:133

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() ); \
}
value
QVariant value
Definition: settings.cpp:35

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)
Value:
const Enumerator TYPE::p_enums[] =\
{

Definition at line 139 of file binding_support.h.

#define START_METHOD_LUT (   TYPE)
Value:
const Method TYPE::p_methods[] = \
{

Definition at line 127 of file binding_support.h.

#define START_STATIC_METHOD_LUT (   TYPE)
Value:
const Method TYPE::p_statics[] = \
{

Definition at line 131 of file binding_support.h.

This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kjsembed

Skip menu "kjsembed"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal