![]() |
LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
Interface for objects representing scripts. More...
#include "iscriptloader.h"
Public Member Functions | |
virtual | ~IScript () |
virtual QObject * | GetQObject ()=0 |
Returns this script object as a QObject. More... | |
virtual QVariant | InvokeMethod (const QString &name, const QVariantList &args={})=0 |
Runs the given function and returns its value. More... | |
virtual void | AddQObject (QObject *object, const QString &name)=0 |
Adds the given object to the script context. More... | |
virtual void | Execute ()=0 |
Executes the script. More... | |
Interface for objects representing scripts.
This interface is to be implemented by the objects that represent loaded scripts.
Definition at line 19 of file iscriptloader.h.
|
inlinevirtual |
Definition at line 28 of file iscriptloader.h.
|
pure virtual |
Adds the given object to the script context.
This method adds the object to the script context under the given name. The metafunctions of the object (that is, signals, slots, properties and Q_INVOKABLE functions) will become available to the script.
[in] | object | The object to add to the script context. |
[in] | name | The name under which the object should be added. |
|
pure virtual |
Executes the script.
There is no need to call this function explicitly if InvokeMethod() will be called, since the latter implies executing the script.
|
pure virtual |
Returns this script object as a QObject.
|
pure virtual |
Runs the given function and returns its value.
This method invokes the method identified by name with the given args, if any, and returns its value.
If there is no such method or call has failed, the returned variant is null.
[in] | name | The name of the method to invoke. |
[in] | args | The list of arguments for the method. |