Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure

StelScriptMgr Class Reference

Manage scripting in Stellarium. More...

#include <StelScriptMgr.hpp>

List of all members.

Public Slots

const QString getName (const QString &s)
const QString getAuthor (const QString &s)
const QString getLicense (const QString &s)
const QString getDescription (const QString &s)
bool runScript (const QString &fileName)
bool stopScript (void)

Signals

void scriptRunning ()
void scriptStopped ()

Public Member Functions

 StelScriptMgr (QObject *parent=0)
QStringList getScriptList (void)
bool scriptIsRunning (void)
QString runningScriptId (void)


Detailed Description

Manage scripting in Stellarium.

Member Function Documentation

bool StelScriptMgr::scriptIsRunning ( void   ) 

Find out if a script is running.

Returns:
true if a script is running, else false

QString StelScriptMgr::runningScriptId ( void   ) 

Get the ID (filename) of the currently running script.

Returns:
Empty string if no script is running, else the ID of the script which is running.

const QString StelScriptMgr::getName ( const QString &  s  )  [slot]

Gets a single line name of the script.

Parameters:
s the file name of the script whose name is to be returned.
Returns:
text following a comment with Name: at the start. If no such comment is found, the file name will be returned. If the file is not found or cannot be opened for some reason, an Empty string will be returned.

const QString StelScriptMgr::getAuthor ( const QString &  s  )  [slot]

Gets the name of the script Author.

Parameters:
s the file name of the script whose name is to be returned.
Returns:
text following a comment with Author: at the start. If no such comment is found, "" is returned. If the file is not found or cannot be opened for some reason, an Empty string will be returned.

const QString StelScriptMgr::getLicense ( const QString &  s  )  [slot]

Gets the licensing terms for the script.

Parameters:
s the file name of the script whose name is to be returned.
Returns:
text following a comment with License: at the start. If no such comment is found, "" is returned. If the file is not found or cannot be opened for some reason, an Empty string will be returned.

const QString StelScriptMgr::getDescription ( const QString &  s  )  [slot]

Gets a description of the script.

Parameters:
s the file name of the script whose name is to be returned.
Returns:
text following a comment with Description: at the start. The description is considered to be over when a line with no comment is found. If no such comment is found, QString("") is returned. If the file is not found or cannot be opened for some reason, an Empty string will be returned.

bool StelScriptMgr::runScript ( const QString &  fileName  )  [slot]

Run the script located at the given location.

Parameters:
fileName the location of the file containing the script.
Returns:
false if the named script could not be run, true otherwise

bool StelScriptMgr::stopScript ( void   )  [slot]

Stops any running script.

Returns:
false if no script was running, true otherwise.

void StelScriptMgr::scriptRunning (  )  [signal]

Notification when a script starts running.

void StelScriptMgr::scriptStopped (  )  [signal]

Notification when a script has stopped running.


Generated on Mon Feb 2 17:23:48 2009 for Stellarium by  doxygen 1.5.5