50 #ifndef SCRIPTINGPLUGIN_HH 51 #define SCRIPTINGPLUGIN_HH 64 #ifdef QT_SCRIPTTOOLS_LIB 65 #include <QtScriptTools/QScriptEngineDebugger> 68 #include "highLighter.hh" 69 #include "scriptingWidget.hh" 82 #if QT_VERSION >= 0x050000 83 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-Scripting")
89 void getScriptingEngine( QScriptEngine*& _engine );
90 void getAvailableFunctions( QStringList& _functions );
92 void log(
Logtype _type, QString _message);
93 void log(QString _message);
95 void getMenubarMenu (QString _name, QMenu *& _menu,
bool _create);
97 void getDescription(QString _function, QString& _description,
98 QStringList& _parameters, QStringList& _descriptions);
102 void slotScriptInfo( QString _pluginName , QString _functionName );
104 void slotExecuteFileScript( QString _filename );
106 void slotLoadScript();
107 void slotSaveScript();
108 void slotSaveScriptAs();
111 void noguiSupported( ) {} ;
117 QString
name() {
return (QString(tr(
"Scripting"))); };
118 QString
description( ) {
return (QString(tr(
"Provides Scripting for OpenFlipper"))); };
122 void slotExecuteScriptButton();
130 void slotFunctionClicked(QListWidgetItem* _item);
131 void slotFunctionDoubleClicked(QListWidgetItem* _item);
133 void slotApplyFilter();
152 QList< QLabel* > descriptionLabels_;
153 QVBoxLayout* descrLayout_;
184 void slotLoadScript( QString _filename );
213 void sleep(
int _seconds );
228 QString mangleScript( QString _input );
236 QStatusBar* statusBar_;
249 QAction* debuggerButton_;
251 #ifdef ENABLE_SCRIPT_DEBUGGER 252 #ifdef QT_SCRIPTTOOLS_LIB 253 QScriptEngineDebugger* debugger_;
260 QString version() {
return QString(
"1.0"); };
263 #endif //SCRIPTINGPLUGIN_HH QTime frameTime_
Counts mseconds since a frame start has occured.
void hideScriptWidget()
Hide the script editor widget.
void frameStart()
Marks the current time as the frame start ( Use wait sleepFrameLength to wait until _mseconds have pa...
Logtype
Log types for Message Window.
Interface for all Plugins which provide scriptable Functions.
Interface class from which all plugins have to be created.
void slotHighlightError()
Called when an error is detected when checking the syntax.
void showScriptInEditor(QString _code)
Show the given Code in the script editor.
Interface for all Plugins which do logging to the logging window of the framework.
void sleepmsecs(int _mseconds)
Sleeps for some mseconds in script execution ( Gui will remain functional)
QTimer * errorTimer_
Timer to wait until the user stopped typing before showing an error.
int lastProblemLine_
Store the last line that contained an error.
void showScriptWidget()
Show the script editor widget.
Interface for all plugins which provide entries to the main menubar.
void slotScriptChanged()
Called everytime the text in the scriptingwidget is changed by the user.
void pluginsInitialized()
QString name()
Return a name for the plugin.
void sleep(int _seconds)
Sleeps for some seconds in script execution ( Gui will remain functional)
void clearEditor()
Clear the editor window Clears the script editor window.
void slotDebuggerButton()
Triggered by the debugger button.
void slotExecuteScript(QString _script)
QString lastError_
Store the last error message.
QString description()
Return a description of what the plugin is doing.
Interface to call functions across plugins.
void waitFrameEnd(int _mseconds)
wait until _mseconds have passed since frameStart (if more time has passed, it will return immediatel...