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

kjsembed

value_binding.h File Reference

#include <kjs/object.h>
#include <kjs/interpreter.h>
#include "static_binding.h"
#include "pointer.h"

Include dependency graph for value_binding.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Namespaces

namespace  KJSEmbed

Classes

class  KJSEmbed::ValueBinding
 Value binding implementation. More...
class  KJSEmbed::ValueFactory
 The Bindings for the KJSEmbed::ValueBinding. More...

Defines

#define END_VALUE_METHOD
#define KJSO_VALUE_DERIVED_BINDING_CTOR(NAME, JSNAME, TYPE, BASENAME)
#define KJSO_VALUE_SIMPLE_BINDING_CTOR(NAME, JSNAME, TYPE, BASENAME)
#define START_VALUE_METHOD(METHODNAME, TYPE)

Functions

template<typename T>
KJS::JSValue * KJSEmbed::createValue (KJS::ExecState *exec, const KJS::UString &className, const T &value)
template<typename T>
T KJSEmbed::extractValue (KJS::ExecState *exec, const KJS::List &args, int idx, const T &defaultValue=T())
template<typename T>
T KJSEmbed::extractValue (KJS::ExecState *exec, KJS::JSValue *arg, const T &defaultValue)

Define Documentation

#define END_VALUE_METHOD

Value:

imp->setValue(value); \
        } \
        else { \
            KJS::throwError(exec, KJS::GeneralError, "Problem in ValueBinding here");\
        }\
        return result; \
}
End a variant method started by START_VALUE_METHOD.

Definition at line 53 of file value_binding.h.

#define KJSO_VALUE_DERIVED_BINDING_CTOR ( NAME,
JSNAME,
TYPE,
BASENAME   ) 

Value:

NAME::NAME(KJS::ExecState *exec, const char* typeName ) \
      : BASENAME( exec, typeName )                    \
    { \
      StaticBinding::publish( exec, this, NAME::methods() ); \
    } \
    NAME::NAME(KJS::ExecState *exec, const TYPE & value)                \
    : BASENAME( exec, #JSNAME )                                         \
    {                                                                   \
        setValue(value);                                                \
        StaticBinding::publish( exec, this, NAME::methods() );          \
    }

Definition at line 74 of file value_binding.h.

#define KJSO_VALUE_SIMPLE_BINDING_CTOR ( NAME,
JSNAME,
TYPE,
BASENAME   ) 

Value:

NAME::NAME(KJS::ExecState *exec, const char* typeName ) \
      : BASENAME( exec, typeName )                    \
    { \
      StaticBinding::publish( exec, this, NAME::methods() ); \
    } \
    NAME::NAME(KJS::ExecState *exec, const TYPE & value) \
      : BASENAME( exec, #JSNAME , value )                    \
    { \
      StaticBinding::publish( exec, this, NAME::methods() ); \
    }

Definition at line 62 of file value_binding.h.

#define START_VALUE_METHOD ( METHODNAME,
TYPE   ) 

Value:

KJS::JSValue *METHODNAME( KJS::ExecState *exec, KJS::JSObject *self, const KJS::List &args ) \
{ \
        Q_UNUSED(exec);\
        Q_UNUSED(self);\
        Q_UNUSED(args);\
        KJS::JSValue *result = KJS::jsNull(); \
        KJSEmbed::ValueBinding *imp = KJSEmbed::extractBindingImp<KJSEmbed::ValueBinding>(exec, self ); \
        if( imp ) \
        { \
                TYPE value = imp->value<TYPE>();
A simple variant syle method.

This will extract the value, cast it to the native type and place it in "value". Any data that should be returned from this method should be placed into "result";

Definition at line 39 of file value_binding.h.

kjsembed

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal