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

kjsembed

object_binding.h File Reference

#include <kdemacros.h>
#include "static_binding.h"
#include "variant_binding.h"
#include "pointer.h"
#include "kjseglobal.h"

Go to the source code of this file.

Classes

class  KJSEmbed::ObjectBinding
class  KJSEmbed::ObjectFactory

Namespaces

namespace  KJSEmbed

Defines

#define END_OBJECT_METHOD
#define END_STATIC_OBJECT_METHOD
#define START_OBJECT_METHOD(METHODNAME, TYPE)
#define START_STATIC_OBJECT_METHOD(METHODNAME)

Functions

template<typename T >
KJS::JSValue * KJSEmbed::createObject (KJS::ExecState *exec, const KJS::UString &className, const T *value, KJSEmbed::ObjectBinding::Ownership owner=KJSEmbed::ObjectBinding::JSOwned)
template<typename T >
T * KJSEmbed::extractObject (KJS::ExecState *exec, const KJS::List &args, int idx, T *defaultValue=0L)
template<typename T >
T * KJSEmbed::extractObject (KJS::ExecState *exec, KJS::JSValue *arg, T *defaultValue)
template<typename T >
T KJSEmbed::extractParameter (KJS::ExecState *exec, KJS::JSValue *arg, const T &defaultValue)

Define Documentation

#define END_OBJECT_METHOD
Value:
} \
            else \
                KJS::throwError(exec, KJS::ReferenceError, QString("O: The internal object died."));\
        } \
        else \
            KJS::throwError(exec, KJS::GeneralError, QString("Object cast failed."));\
        return result; \
}

End a variant method started by START_OBJECT_METHOD.

Definition at line 57 of file object_binding.h.

#define END_STATIC_OBJECT_METHOD
Value:
return result; \
}

Definition at line 75 of file object_binding.h.

#define START_OBJECT_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::ObjectBinding *imp = KJSEmbed::extractBindingImp<KJSEmbed::ObjectBinding>(exec, self ); \
        if( imp ) \
        { \
            TYPE *object = imp->object<TYPE>(); \
            if( object ) \
            {

A simple pointer syle method.

This will extract the pointer, 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 40 of file object_binding.h.

#define START_STATIC_OBJECT_METHOD ( METHODNAME   ) 
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(); \

Definition at line 67 of file object_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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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