Carousel
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Pages
Public Member Functions | List of all members
IScriptExtension Class Referenceabstract

This interface used by the IScriptEngineConfigurationDelegate to configure QScriptEngine by the component extension. More...

#include <IScriptExtension.h>

Inherits IComponentExtension.

Public Member Functions

 IScriptExtension ()
 
virtual void configureEngine (QScriptEngine *engine)=0
 

Detailed Description

This interface used by the IScriptEngineConfigurationDelegate to configure QScriptEngine by the component extension.

If some component wants to extend script with new funcitons or types, or register wrappers for some non-QObject classes, it should be a child of the JsScriptingComponent. This mean a dependency of component parent name: "org.carousel.JsScripting". Then to get chance for registration, this component should also provide IScriptExtension extension. The overridden IScriptExtension::configureEngine method will be invoked every time, when QScriptEngine configuration is needed. So, in your extension you can register what ever you want in the QScriptEngine.

See Also
IComponent::extension(), IScriptEngineConfigurationDelegate

Constructor & Destructor Documentation

IScriptExtension::IScriptExtension ( )
inline

Initializes a new instance of the IScriptExtension class.

Member Function Documentation

virtual void IScriptExtension::configureEngine ( QScriptEngine engine)
pure virtual

This method will be invoked every time when a new instance of the QScriptEngine is needed to be configured by other components. Usually each execution of the IScriptUnit is required a new engine.

Implement this method to extend an engine with additional functions, classes or wrappers for your types.