KParts
#include <scriptableextension.h>
Classes | |
struct | Exception |
struct | FunctionRef |
struct | Null |
struct | Object |
struct | Undefined |
lifetime | |
ScriptableExtension (QObject *parent) | |
virtual | ~ScriptableExtension () |
static ScriptableExtension * | childObject (QObject *obj) |
static ScriptableExtension * | adapterFromLiveConnect (QObject *parentObj, LiveConnectExtension *oldApi) |
Object Hierarchy | |
void | setHost (ScriptableExtension *host) |
ScriptableExtension * | host () const |
virtual QVariant | rootObject () |
QVariant | enclosingObject () |
Object Operations | |
All these methods share the following conventions:
| |
enum | ScriptLanguage { ECMAScript, EnumLimit = 0xFFFF } |
typedef QList< QVariant > | ArgList |
virtual QVariant | callAsFunction (ScriptableExtension *callerPrincipal, quint64 objId, const ArgList &args) |
virtual QVariant | callFunctionReference (ScriptableExtension *callerPrincipal, quint64 objId, const QString &f, const ArgList &args) |
virtual QVariant | callAsConstructor (ScriptableExtension *callerPrincipal, quint64 objId, const ArgList &args) |
virtual bool | hasProperty (ScriptableExtension *callerPrincipal, quint64 objId, const QString &propName) |
virtual QVariant | get (ScriptableExtension *callerPrincipal, quint64 objId, const QString &propName) |
virtual bool | put (ScriptableExtension *callerPrincipal, quint64 objId, const QString &propName, const QVariant &value) |
virtual bool | removeProperty (ScriptableExtension *callerPrincipal, quint64 objId, const QString &propName) |
virtual bool | enumerateProperties (ScriptableExtension *callerPrincipal, quint64 objId, QStringList *result) |
virtual bool | setException (ScriptableExtension *callerPrincipal, const QString &message) |
virtual QVariant | evaluateScript (ScriptableExtension *callerPrincipal, quint64 contextObjectId, const QString &code, ScriptLanguage language=ECMAScript) |
virtual bool | isScriptLanguageSupported (ScriptLanguage lang) const |
virtual void | acquire (quint64 objid) |
virtual void | release (quint64 objid) |
static QVariant | acquireValue (const QVariant &v) |
static QVariant | releaseValue (const QVariant &v) |
Additional Inherited Members | |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
Detailed Description
An extension class that permits KParts to be scripted (such as when embedded inside a KHTMLPart) and to access the host's scriptable objects as well.
See Script Value Types for how values are passed to/from various methods here.
- Since
- 4.5
Definition at line 44 of file scriptableextension.h.
Member Typedef Documentation
Definition at line 192 of file scriptableextension.h.
Member Enumeration Documentation
Enumerator | |
---|---|
ECMAScript | |
EnumLimit |
< also known as JavaScript |
Definition at line 247 of file scriptableextension.h.
Constructor & Destructor Documentation
|
protected |
Definition at line 34 of file scriptableextension.cpp.
|
virtual |
Definition at line 38 of file scriptableextension.cpp.
Member Function Documentation
|
virtual |
increases reference count of object objId
Reimplemented in KParts::ScriptableLiveConnectExtension.
Definition at line 190 of file scriptableextension.cpp.
Helper that calls acquire on any object or function reference base stored in v
.
- Returns
- a copy of the passed in value
Definition at line 195 of file scriptableextension.cpp.
|
static |
This returns a bridge object that permits KParts implementing the older LiveConnectExtension to be used via the ScriptableExtension API.
The bridge's parent will be the parentObj
.
Definition at line 48 of file scriptableextension.cpp.
|
virtual |
Try to use the object objId
associated with 'this' as a constructor (corresponding to ECMAScript's new foo(bar, baz, glarch) expression).
Definition at line 109 of file scriptableextension.cpp.
|
virtual |
Try to use the object objId
associated with 'this' as a function.
Definition at line 89 of file scriptableextension.cpp.
|
virtual |
Try to use a function reference to field f
of object as a function.
Reimplemented in KParts::ScriptableLiveConnectExtension.
Definition at line 98 of file scriptableextension.cpp.
|
static |
Queries obj
for a child object which inherits from this ScriptableExtension class.
Convenience method.
Definition at line 43 of file scriptableextension.cpp.
QVariant KParts::ScriptableExtension::enclosingObject | ( | ) |
Returns an object that represents the host()'s view of us.
For example, if the host is an HTML part, it would return a DOM node of an <object> handled by this part. May be undefined or null
Implemented in terms of objectForKid
Definition at line 69 of file scriptableextension.cpp.
|
virtual |
Tries to enumerate all fields of object objId
associated with this to result
.
Returns true on success
Definition at line 155 of file scriptableextension.cpp.
|
virtual |
Tries to evaluate a script code
with the given object as its context.
The parameter language
specifies the language to execute it as. Use isScriptLanguageSupported to check for support.
Definition at line 172 of file scriptableextension.cpp.
|
virtual |
Tries to get field propName
from object objId
associated with 'this'.
Reimplemented in KParts::ScriptableLiveConnectExtension.
Definition at line 127 of file scriptableextension.cpp.
|
virtual |
Returns true if the object objId
associated with 'this' has the property propName
.
Reimplemented in KParts::ScriptableLiveConnectExtension.
Definition at line 118 of file scriptableextension.cpp.
ScriptableExtension * KParts::ScriptableExtension::host | ( | ) | const |
Returns any registered parent scripting context.
May be 0 if setHost was not called (or not call yet).
Definition at line 59 of file scriptableextension.cpp.
|
virtual |
returns true if this extension can execute scripts in the given language
Definition at line 184 of file scriptableextension.cpp.
|
virtual |
Tries to set the field propName
from object objId
associated with 'this' to value
.
Returns true on success
Reimplemented in KParts::ScriptableLiveConnectExtension.
Definition at line 136 of file scriptableextension.cpp.
|
virtual |
decreases reference count of object objId
Reimplemented in KParts::ScriptableLiveConnectExtension.
Definition at line 207 of file scriptableextension.cpp.
Helper that calls release on any object or function reference base stored in v
.
- Returns
- a copy of the passed in value
Definition at line 212 of file scriptableextension.cpp.
|
virtual |
Tries to remove the field d propName
from object objId
associated with 'this'.
Returns true on success
Definition at line 146 of file scriptableextension.cpp.
|
virtual |
Return the root scriptable object of this KPart.
For example for an HTML part, it would represent a Window object. May be undefined or null
Reimplemented in KParts::ScriptableLiveConnectExtension.
Definition at line 64 of file scriptableextension.cpp.
|
virtual |
Tries to raise an exception with given message in this extension's scripting context.
Returns true on success
Definition at line 164 of file scriptableextension.cpp.
void KParts::ScriptableExtension::setHost | ( | ScriptableExtension * | host | ) |
Reports the hosting ScriptableExtension to a child.
It's the responsibility of a parent part to call this method on all of its kids' ScriptableExtensions as soon as possible.
Definition at line 54 of file scriptableextension.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.