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

kjsembed

  • KJSEmbed
  • StaticConstructor
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
KJSEmbed::StaticConstructor Class Reference

#include <static_binding.h>

Inherits InternalFunctionImp.

Public Member Functions

 StaticConstructor (KJS::ExecState *exec, const Constructor *constructor)
 
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)
 

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,
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.

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.

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
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