44 #ifndef SCRIPTINGPLUGIN_HH 45 #define SCRIPTINGPLUGIN_HH 55 #ifdef QT_SCRIPTTOOLS_LIB 56 #include <QtScriptTools/QScriptEngineDebugger> 59 #include "widgets/highLighter.hh" 60 #include "widgets/scriptingWidget.hh" 74 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-Scripting")
79 void getScriptingEngine( QScriptEngine*& _engine );
80 void getAvailableFunctions( QStringList& _functions );
82 void log(
Logtype _type, QString _message);
83 void log(QString _message);
85 void getMenubarMenu (QString _name, QMenu *& _menu,
bool _create);
87 void getDescription(QString _function, QString& _description,
88 QStringList& _parameters, QStringList& _descriptions);
92 void slotScriptInfo( QString _pluginName , QString _functionName );
94 void slotExecuteFileScript( QString _filename );
96 void slotLoadScript();
97 void slotSaveScript();
98 void slotSaveScriptAs();
101 void noguiSupported( ) {} ;
107 QString
name() {
return (QString(tr(
"Scripting"))); };
108 QString
description( ) {
return (QString(tr(
"Provides Scripting for OpenFlipper"))); };
112 void slotExecuteScriptButton();
120 void slotFunctionClicked(QListWidgetItem* _item);
121 void slotFunctionDoubleClicked(QListWidgetItem* _item);
123 void slotApplyFilter();
142 QList< QLabel* > descriptionLabels_;
143 QVBoxLayout* descrLayout_;
174 void slotLoadScript( QString _filename );
203 void sleep(
int _seconds );
218 QString mangleScript( QString _input );
226 QStatusBar* statusBar_;
239 QAction* debuggerButton_;
241 #ifdef ENABLE_SCRIPT_DEBUGGER 242 #ifdef QT_SCRIPTTOOLS_LIB 243 QScriptEngineDebugger* debugger_;
250 QString version() {
return QString(
"1.0"); };
253 #endif //SCRIPTINGPLUGIN_HH void hideScriptWidget()
Hide the script editor widget.
QString name()
Return a name for the plugin.
void pluginsInitialized()
void slotHighlightError()
Called when an error is detected when checking the syntax.
Logtype
Log types for Message Window.
void showScriptWidget()
Show the script editor widget.
void sleepmsecs(int _mseconds)
Sleeps for some mseconds in script execution ( Gui will remain functional)
int lastProblemLine_
Store the last line that contained an error.
Interface for all Plugins which do logging to the logging window of the framework.
void clearEditor()
Clear the editor window Clears the script editor window.
void waitFrameEnd(int _mseconds)
wait until _mseconds have passed since frameStart (if more time has passed, it will return immediatel...
void slotDebuggerButton()
Triggered by the debugger button.
void sleep(int _seconds)
Sleeps for some seconds in script execution ( Gui will remain functional)
Interface to call functions across plugins.
void frameStart()
Marks the current time as the frame start ( Use wait sleepFrameLength to wait until _mseconds have pa...
QElapsedTimer frameTime_
Counts mseconds since a frame start has occured.
QTimer * errorTimer_
Timer to wait until the user stopped typing before showing an error.
QString lastError_
Store the last error message.
QString description()
Return a description of what the plugin is doing.
Interface for all Plugins which provide scriptable Functions.
void showScriptInEditor(QString _code)
Show the given Code in the script editor.
void slotExecuteScript(QString _script)
Interface class from which all plugins have to be created.
void slotScriptChanged()
Called everytime the text in the scriptingwidget is changed by the user.