20 #ifndef _STELSCRIPTMGR_HPP_
21 #define _STELSCRIPTMGR_HPP_
25 #include <QStringList>
29 #include <QScriptEngineAgent>
34 #ifdef ENABLE_SCRIPT_CONSOLE
43 #ifdef ENABLE_SCRIPT_CONSOLE
51 QStringList getScriptList();
62 bool preprocessScript(
const QString& input, QString&
output,
const QString& scriptDir);
63 bool preprocessScript(QFile &input, QString& output,
const QString& scriptDir);
74 const QString
getName(
const QString& s);
82 const QString
getAuthor(
const QString& s);
122 bool runScript(
const QString& fileName,
const QString& includePath=
"");
141 void debug(
const QString& msg);
145 void output(
const QString& msg);
171 QMap<QString, QString> mappify(
const QStringList& args,
bool lowerKey=
false);
172 bool strToBool(
const QString& str);
184 const QString getHeaderSingleLineCommentText(
const QString& s,
const QString&
id,
const QString& notFoundText=
"");
185 QScriptEngine engine;
190 QString scriptFileName;
203 void setPauseScript(
bool pause) { isPaused=pause; }
204 bool getPauseScript() {
return isPaused; }
206 void positionChange(qint64 scriptId,
int lineNumber,
int columnNumber);
213 #endif // _STELSCRIPTMGR_HPP_
const QString getLicense(const QString &s)
Gets the licensing terms for the script.
const QString getAuthor(const QString &s)
Gets the name of the script Author.
bool runScript(const QString &fileName, const QString &includePath="")
Run the script located at the given location.
void debug(const QString &msg)
cause the emission of the scriptDebug signal.
void setScriptRate(float r)
Changes the rate at which the script executes as a multiple of real time.
void scriptRunning()
Notification when a script starts running.
void scriptDebug(const QString &)
Notification of a script event - warnings, current execution line etc.
void stopScript()
Stops any running script.
bool scriptIsRunning()
Find out if a script is running.
void addModules()
Add all the StelModules into the script engine.
Provide script API for Stellarium global functions.
void resumeScript()
Resume a paused script.
void scriptStopped()
Notification when a script has stopped running.
void output(const QString &msg)
cause the emission of the scriptOutput signal.
void pauseScript()
Pause a running script.
Manage scripting in Stellarium.
const QString getDescription(const QString &s)
Gets a description of the script.
const QString getName(const QString &s)
Gets a single line name of the script.
QString runningScriptId()
Get the ID (filename) of the currently running script.
void resetOutput(void)
Reset output file and cause the emission of an (empty) scriptOutput signal.
bool runPreprocessedScript(const QString &preprocessedScript)
Run the prprocessed script.
void scriptOutput(const QString &)
Notification of a script event - output line.
const QString getShortcut(const QString &s)
Gets the default shortcut of the script.
double getScriptRate()
Get the rate at which the script is running as a multiple of the normal execution rate...