class KJScript

ECMAScript interpreter. More...

Definition#include <kjs.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods


Detailed Description

This library implements ECMAScript. Currently its main aim is to add JavaScript support to KHTMLView.

 KJScript ()

Create a new ECMAScript interpreter. You can later ask it to interprete code by pass it via evaluate.

Parameters:
wis pointing to the KHTMLView you wish the script to operate on.

KJScript ()

Destructor

bool  evaluate (const char *code)

Asks the interpreter to evaluate a piece of code. If called more than once the state (global variables, functions etc.) will be preserved between each call.

Parameters:
codeis a string containing the code to be executed.

bool  evaluate (const KJS::UChar *code, unsigned int length)

Same as above. Only differing in the arguments accepted. KJS::UChar is a data type compatible to XChar2b and QChar.

Parameters:
codeis an Unicode string containing the code to be executed.
lengthof the string.

bool  evaluate (const KJS::UString &code)

Added for convenience in case you have the code in available in internal representation already.

Parameters:
codeis an Unicode string containing the code to be executed.

void  clear ()

Clear the interpreter's memory. Otherwise, function declarations and global variables will be remembered after each invokation of KJScript::evaluate.


Generated by: dfaure@faure on Sun Mar 26 14:25:02 2000, using kdoc 2.0a35.