Developer Documentation

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | List of all members
ScriptInterface Class Reference

Interface for all Plugins which provide scriptable Functions. More...

`#include <OpenFlipper/BasePlugin/ScriptInterface.hh>`

Inheritance diagram for ScriptInterface:

## Signals
Scripting History
virtual void | scriptInfo (QString _functionWithParameters)
| Emit this signal if a scriptable function is executed. More...
Others
virtual void | getScriptingEngine (QScriptEngine *&_engine)

## Public Member Functions
virtual | ~ScriptInterface ()
| Destructor.

## Script execution
virtual void | executeFileScript (QString _filename)
virtual void | executeScript (QString _script)

## Function Information
virtual void | getDescription (QString _function, QString &_description, QStringList &_parameters, QStringList &_descriptions)
virtual void | getAvailableFunctions (QStringList &_functions)

## Slots for a scripting control plugin like Plugin-Script
virtual void | slotScriptInfo (QString _pluginName, QString _functionWithParameters)
virtual void | slotExecuteScript (QString _script)
virtual void | slotExecuteFileScript (QString _filename)

## Detailed Description

Interface for all Plugins which provide scriptable Functions.

Detailed description

Definition at line 67 of file ScriptInterface.hh.

## Member Function Documentation

virtual void ScriptInterface::executeFileScript | ( | QString | _filename | ) |
| inline virtual

Emit this signal to execute a script from a file

Parameters

  _filename | Filename of the script to execute

Definition at line 89 of file ScriptInterface.hh.

virtual void ScriptInterface::executeScript | ( | QString | _script | ) |
| inline virtual signal

Emit this signal to execute a script

Parameters

  _script | The script to execute

Definition at line 84 of file ScriptInterface.hh.

virtual void ScriptInterface::getAvailableFunctions | ( | QStringList & | _functions | ) |
| inline virtual signal

With this signal you can get a list of all available scripting functions

Parameters

  _functions | All available functions

Definition at line 103 of file ScriptInterface.hh.

virtual void ScriptInterface::getDescription | ( | QString | _function,
|  | QString & | _description,
|  | QStringList & | _parameters,
|  | QStringList & | _descriptions
| ) |  |
| inline virtual

With this signal you can get descriptions about a given function if available

Parameters

  _function | name of the function (e.g. plugin.function)
  _description | a description for the function
  _parameters | list of names for the parameters
  _descriptions | list of descriptions for the parameters (_descriptions[i] corresponds to _parameters[i])

Definition at line 112 of file ScriptInterface.hh.

virtual void ScriptInterface::getScriptingEngine | ( | QScriptEngine *& | _engine | ) |
| inline virtual signal

Emit this signal to get a reference to the core scripting engine

Parameters

  _engine | The scripting Engine

Definition at line 155 of file ScriptInterface.hh.

virtual void ScriptInterface::scriptInfo | ( | QString | _functionWithParameters | ) |
| inline virtual signal

Emit this signal if a scriptable function is executed.

e.g. selectAllVertices( ObjectId )

If you execute this function, you can append your functions to the script execution history in OpenFlipper. In this history OpenFlipper records operations that are scriptable. Later this list can be executed again and therefore reruns the recorded operations.

The following example code shows a function called translate in a plugin, that gets an ObjectId as a parameter. The plugin which emits this function will automatically be added in the history ( e.g.

move.translate( ObjectId , Vector(1 , 0 , 0 ) )

)

emit scriptInfo( "translate( ObjectId , Vector(1 , 0 , 0 ) )" );

Parameters

  _functionWithParameters | The called function with all parameters

Definition at line 140 of file ScriptInterface.hh.

virtual void ScriptInterface::slotExecuteFileScript | ( | QString | _filename | ) |
| inline private virtual

Slot for a scripting plugin. Gets the Script as a filename, opens and executes it.

Definition at line 184 of file ScriptInterface.hh.

virtual void ScriptInterface::slotExecuteScript | ( | QString | _script | ) |
| inline private virtual

Slot for a scripting plugin. Gets the Script as QString and executes it.

Parameters

  _script | Script to execute as a QString

Definition at line 179 of file ScriptInterface.hh.

virtual void ScriptInterface::slotScriptInfo | ( | QString | _pluginName,
|  | QString | _functionWithParameters
| ) |  |
| inline private virtual slot

Slot for a scripting plugin. Gets the Script and executes it.

Parameters

  _pluginName | Name of the plugin that executed a scriptable function
  _functionWithParameters | Name with parameters (values!) of the function to call.

Definition at line 172 of file ScriptInterface.hh.

The documentation for this class was generated from the following file:

- OpenFlipper/BasePlugin/ScriptInterface.hh