class JSObjectProxy

A JS object that provides a binding to a QObject. More...

Full nameKJSEmbed::JSObjectProxy
Definition#include <kjsembed/jsobjectproxy.h>
InheritsKJS::ObjectImp (kjs) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

A JS object that provides a binding to a QObject. The JS object created lets scripts access all the properties defined by the object in a similar way to the DCOP/QObject bridge.

The following example creates a KJS::ObjectImp that provides a binding to the properties of a QLineEdit . This binding is then used to create a property 'edit' for the object 'jsparent'.


   QLineEdit *edit = new QLineEdit();
   KJSEmbed::JSObjectProxy *proxy = new KJSEmbed::JSObjectProxy( js, edit );
   jsparent.put( js->globalExec(), "edit", proxy );

It is

 JSObjectProxy ( KJS::Interpreter *js, QObject *target, QObject *root )

JSObjectProxy

Create a JS binding to the target object. The binding will allow scripts to access any QObject that is descended from the specified root. If the specified root is 0 then access is granted to all objects.

 JSObjectProxy ( KJS::Interpreter *js, QObject *target )

JSObjectProxy

Create a JS binding to the target object. The binding will allow scripts to access any QObject that is descended the target and no others.

 ~JSObjectProxy ()

~JSObjectProxy

KJS::Interpreterjscript ()

jscript

[const]

void  addBindings ( KJS::ExecState *state, KJS::Object &object )

addBindings

[virtual]

Adds methods for traversing the QObject tree to the specified KJS::Object . Only QObjects descended from the root specified in the constructor can be reached through JS proxies created with these bindings.

KJS::Value  get ( KJS::ExecState *state, const KJS::UString &p )

get

[const virtual]

Reimplemented from ObjectImp.

void  put ( KJS::ExecState *state, const KJS::UString &p, const KJS::Value &v, int attr = KJS::None )

put

[virtual]

Reimplemented from ObjectImp.

KJS::UString  toString ( KJS::ExecState *exec )

toString

[const virtual]

Reimplemented from ObjectImp.

bool  isAllowed ( KJS::Interpreter *interp )

isAllowed

[const virtual]

bool  isAllowed ( QObject *obj )

isAllowed

[const virtual]

bool  isAllowed ( QObject *obj, const char *prop )

isAllowed

[const virtual]