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

kjsembed

KJSEmbed::StaticConstructor

KJSEmbed::StaticConstructor Class Reference

A special method that will create other objects. More...

#include <static_binding.h>

Inheritance diagram for KJSEmbed::StaticConstructor:

Inheritance graph
[legend]

List of all members.


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

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.


Constructor & Destructor Documentation

StaticConstructor::StaticConstructor ( KJS::ExecState *  exec,
const Constructor *  constructor 
)

Create a new constructor.

Definition at line 70 of file static_binding.cpp.


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);
is equivelent to the following javascript
 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:
  • static_binding.h
  • static_binding.cpp

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
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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