Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::ScriptManager Class Reference

Manages scripts for the application. More...

#include <ScriptManager.h>

Inheritance diagram for sf::ScriptManager:
[legend]
Collaboration diagram for sf::ScriptManager:
[legend]

Public Member Functions

 ScriptManager (QSettings *settings, QObject *parent)
 Constructor.
 ~ScriptManager () override
 Overridden destructor.
QString getScriptFilePath (const QString &base_name=QString()) const
 Gets the full file path of a script name passed.
void shortcutActivated (ScriptEntry *entry)
 Gets called from an entry when a shortcut is activated.
void storeSettings (bool save)
 Saves and restores the entries from settings.
bool isModified () const
 Gets status whether to save to settings is needed.
void addAt (qsizetype index=-1)
 Adds and empty entry to the list.
void remove (qsizetype index)
 Removes an entry in the list.
void start (qsizetype index=-1)
 Compiles and initializes script at passed position or all scripts when passing -1.
void stop (qsizetype index=-1)
 Stops script at passed position or all scripts when passing -1.
ScriptEntry * getEntry (qsizetype index)
 Gets the entry from the list by index.
void setModified (QObject *caller)
 Sets the modified flag and notifies ...
const ScriptEntry * getEntryByFilepath (const QString &filepath)
 Gets the entry pointer form the passed absolute file path.

Static Public Member Functions

static QString getFileSuffix ()
 Gets the file extension used for scripts.

Detailed Description

Manages scripts for the application.

Constructor & Destructor Documentation

◆ ScriptManager()

sf::ScriptManager::ScriptManager ( QSettings * settings,
QObject * parent )
explicit

Constructor.

◆ ~ScriptManager()

sf::ScriptManager::~ScriptManager ( )
override

Overridden destructor.

Member Function Documentation

◆ addAt()

void sf::ScriptManager::addAt ( qsizetype index = -1)

Adds and empty entry to the list.

◆ getEntry()

ScriptEntry * sf::ScriptManager::getEntry ( qsizetype index)

Gets the entry from the list by index.

◆ getEntryByFilepath()

const ScriptEntry * sf::ScriptManager::getEntryByFilepath ( const QString & filepath)

Gets the entry pointer form the passed absolute file path.

◆ getFileSuffix()

QString sf::ScriptManager::getFileSuffix ( )
static

Gets the file extension used for scripts.

◆ getScriptFilePath()

QString sf::ScriptManager::getScriptFilePath ( const QString & base_name = QString()) const
nodiscard

Gets the full file path of a script name passed.

Parameters
base_nameBase name of the file without extension.
Returns
Full filepath.

◆ isModified()

bool sf::ScriptManager::isModified ( ) const
nodiscard

Gets status whether to save to settings is needed.

◆ remove()

void sf::ScriptManager::remove ( qsizetype index)

Removes an entry in the list.

◆ setModified()

void sf::ScriptManager::setModified ( QObject * caller)

Sets the modified flag and notifies ...

◆ shortcutActivated()

void sf::ScriptManager::shortcutActivated ( ScriptEntry * entry)

Gets called from an entry when a shortcut is activated.

Parameters
entry

◆ start()

void sf::ScriptManager::start ( qsizetype index = -1)

Compiles and initializes script at passed position or all scripts when passing -1.

◆ stop()

void sf::ScriptManager::stop ( qsizetype index = -1)

Stops script at passed position or all scripts when passing -1.

◆ storeSettings()

void sf::ScriptManager::storeSettings ( bool save)

Saves and restores the entries from settings.


The documentation for this class was generated from the following file: