class Global

Unique global object containing initial native properties. More...

Full nameKJS::Global
Definition#include <object.h>
InheritsKJS::Object [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods


Detailed Description

The Global object represents the global namespace. It holds the native objects like String and functions like eval().

It also serves as a container for variables created by the user, i.e. the statement


   var i = 2;

will basically perform a Global::current().put("i", Number(2)); operation.

 Global ()

Global

Constructs a Global object. This is done by the interpreter once and there should be no need to create an instance on your own. Usually, you'll just want to access the current instance. For example like this:


 Global global(Global::current());
 KJSO proto = global.objectPrototype();

 ~Global ()

~Global

[virtual]

Destruct the Global object.

Global  current ()

current

[static]

Returns: A reference to the Global object belonging to the current interpreter instance.

KJSO  objectPrototype ()

objectPrototype

[const]

Returns: A handle to Object.prototype.

KJSO  functionPrototype ()

functionPrototype

[const]

Returns: A handle to Function.prototype.

void  setFilter (const KJSO &f)

setFilter

Set a filter object that will intercept all put() and get() calls to the global object. If this object returns Undefined on get() the request will be passed on the global object.

KJSO  filter ()

filter

[const]

Return a handle to the filter object (see setFilter()). Null if no filter has been installed.

void * extra ()

extra

[const]

Returns the extra user data set for this global object. Null by default. Typical usage if you need to query any info related to the currently running interpreter:

MyMainWindow *m = (MyMainWindow*)Global::current().extra();

void  setExtra (void *e)

setExtra

Set the extra user data for this global object. It's not used by the interpreter itself and can therefore be used to bind arbitrary data to each interpreter instance.


Generated by: dfaure on kde.faure.org on Thu Jan 17 22:18:54 2002, using kdoc 2.0a53.