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 slotScriptChanged()
Called everytime the text in the scriptingwidget is changed by the user.
Interface to call functions across plugins.
QTimer * errorTimer_
Timer to wait until the user stopped typing before showing an error.
Logtype
Log types for Message Window.
Interface for all Plugins which provide scriptable Functions.
QString name()
Return a name for the plugin.
QString description()
Return a description of what the plugin is doing.
Interface for all Plugins which do logging to the logging window of the framework.
void frameStart()
Marks the current time as the frame start ( Use wait sleepFrameLength to wait until _mseconds have pa...
void showScriptInEditor(QString _code)
Show the given Code in the script editor.
QTime frameTime_
Counts mseconds since a frame start has occured.
void showScriptWidget()
Show the script editor widget.
Interface class from which all plugins have to be created.
int lastProblemLine_
Store the last line that contained an error.
void sleep(int _seconds)
Sleeps for some seconds in script execution ( Gui will remain functional)
void waitFrameEnd(int _mseconds)
wait until _mseconds have passed since frameStart (if more time has passed, it will return immediatel...
void clearEditor()
Clear the editor window Clears the script editor window.
void slotExecuteScript(QString _script)
Interface for all plugins which provide entries to the main menubar.
void sleepmsecs(int _mseconds)
Sleeps for some mseconds in script execution ( Gui will remain functional)
void slotHighlightError()
Called when an error is detected when checking the syntax.
void hideScriptWidget()
Hide the script editor widget.
void slotDebuggerButton()
Triggered by the debugger button.
QString lastError_
Store the last error message.
void pluginsInitialized()