#include <kjsembedpart.h>
Public Slots | |
virtual KJSEmbed::JSConsoleWidget * | view () |
virtual bool | openURL (const KURL &url) |
KJSEmbed::XMLActionClient * | actionClient () const |
bool | loadActionSet (const QString &file) |
KJS::Interpreter * | interpreter () const |
KJS::ExecState * | globalExec () const |
JSFactory * | factory () const |
virtual KJS::Value | evaluate (const QString &script, const KJS::Value &self=KJS::Null()) |
bool | execute (const QString &script, const KJS::Value &self=KJS::Null()) |
virtual bool | execute (KJS::Completion &result, const QString &script, const KJS::Value &self) |
virtual bool | runFile (const QString &filename, const KJS::Value &self=KJS::Null()) |
QString | loadFile (const QString &file) |
Public Member Functions | |
KJSEmbedPart (QObject *parent=0, const char *name=0) | |
KJSEmbedPart (QWidget *wparent, const char *wname=0, QObject *parent=0, const char *name=0) | |
KJSEmbedPart (KJS::Interpreter *js, QWidget *wparent, const char *wname=0, QObject *parent=0, const char *name=0) | |
virtual | ~KJSEmbedPart () |
QCString | versionString () const |
int | versionMajor () const |
int | versionMinor () const |
KJS::Value | callMethod (const QString &methodName, const KJS::List &args) const |
KJS::Value | getValue (const QString &valueName) const |
void | putValue (const QString &valueName, const KJS::Value &value) |
void | putVariant (const QString &valueName, const QVariant &value) |
QVariant | getVariant (const QString &valueName) const |
KJS::Object | globalObject () const |
KJS::Completion | completion () const |
KJS::Object | partObject () const |
KJS::Object | addObject (QObject *obj, const char *name=0) |
KJS::Object | addObject (QObject *obj, KJS::Object &parent, const char *name=0) |
KJS::Object | bind (QObject *obj) |
QStringList | constructorNames () const |
KJS::Value | constructors () const |
KJS::List | constructorList () const |
Protected Member Functions | |
void | createInterpreter () |
void | createBuiltIn (KJS::ExecState *exec, KJS::Object &parent) |
void | createActionClient () |
virtual bool | openFile () |
virtual void | virtual_hook (int id, void *data) |
|
Create a KJSEmbedPart.
|
|
Creates a KJSEmbedPart for which the parents of the view and part are different. Caution! you cannot use parent = [KQ]Application and wparent = 0L. This will cause a crash on exit since the widget will not be destroyed but the part will get destroyed at the end of the QApplication constructor. This results in the widget trying to do GUI related things after the QPaint stuff is destroyed. |
|
Create a KJSEmbedPart with the specified interpreter. See warning above. |
|
Cleans up.
|
|
Returns the current XMLActionClient.
|
|
Publishes 'obj' as property 'name' of object 'parent'. The binding is defined using JSObjectProxy, and is subject to the current default SecurityPolicy. |
|
Publishes 'obj' as property 'name' of the global object. If 'name' is not specified then the name property of 'obj' is used instead. |
|
Returns a JS::Object that provides a binding to the specified QObject.
|
|
Checks to see if a desired method is available in Javascript.
if ( js->hasMethod( "javascriptFunction" ) ) ... // do something with that function. else ... // function not present. */ bool hasMethod( const QString &methodName ); |
|
Returns the completion object for the last script executed.
|
|
Returns a list of the constructors of this interpreter.
|
|
Returns a list of the names of the constructors of this interpreter.
|
|
Returns a JS Array of the constructors of this interpreter.
|
|
Sets up the XMLActionClient.
|
|
Creates the built-in objects and methods in the specified parent object normally the global object of the interpreter. This method is called automatically unless you create the part with a custom interpreter, if you do then you have to call this method yourself if you want the built-ins to be available. |
|
Creates the interpreter.
|
|
Evaluates the specified string, with the specified value as 'this'.
|
|
Executes the specified string, with the specified value as 'this' and sets result to the completion object returned by the interpreter.
|
|
Executes the specified string, with the specified value as 'this'.
|
|
Returns the current factory object.
|
|
Gets a value from Javascript starting from the global context.
KJS::Value val = js->getValue("someValue");
QString myString = val.toString().qstring();
|
|
Convinence method that wraps around getValue that only handles values that are supported by QVariant.
QColor value = js->getVariant( "myVar").toColor();
|
|
Returns the execution context of the interpreter.
|
|
Returns the global object of the interpreter.
|
|
Returns the current interpreter.
|
|
Loads the XML actions defined in the specified file to the default XMLActionClient.
|
|
Loads but does not execute the specified script file. If the first line of the file starts with the string '#!' then that line will be omitted from the returned string. |
|
Reimplemented to disable file support.
|
|
Opens a URL. If the URL has the protocol 'javascript' then it is executed. |
|
Returns the JS object of the part.
|
|
Sets a value in a Javascript starting from the global context. Note if this value is not present in the javascript context it will become defined once this method is called. KJS::Value val = KJSEmbed::convertToValue(js->globalExec(), QColor("blue")); js->putValue("myVar", val); |
|
Convinence method that wraps around putValue that only handles values that are supported by QVariant.
js->putVariant( "myVar", QColor("blue") ); |
|
Loads and runs the specified file.
|
|
Returns the minor version number of KJSEmbed.
|
|
Returns the major version number of KJSEmbed.
|
|
Returns the version of KJSEmbed.
|
|
Returns the view widget, creating one if required.
|
|
|