Q3270
A Qt-based 3270 Terminal Emulator
Loading...
Searching...
No Matches
ColourStore Class Reference

Public Member Functions

 ColourStore ()
 ColourStore::ColourStore constructor.
 
const QStringList themeNames () const
 Retrieve the list of available theme names.
 
Colours getTheme (const QString &name) const
 Retrieve a colour theme by name.
 
void saveTheme (const Colours &theme)
 Save a colour theme.
 
void removeTheme (const QString &name)
 Remove a colour theme by name.
 
void setTheme (const QString &name, const Colours &theme)
 Set or update a colour theme.
 
void setThemes (const QMap< QString, Colours > &themes)
 Set multiple colour themes at once.
 
void saveAllThemes () const
 Save all colour themes to persistent storage.
 
bool exists (const QString &name) const
 Check if a colour theme exists.
 

Constructor & Destructor Documentation

◆ ColourStore()

ColourStore::ColourStore ( )

ColourStore::ColourStore constructor.

This class manages the storage and retrieval of colour themes.

Member Function Documentation

◆ exists()

bool ColourStore::exists ( const QString &  theme) const

Check if a colour theme exists.

Parameters
nameThe name of the theme to check.
Returns
True if the theme exists, false otherwise.

◆ getTheme()

Colours ColourStore::getTheme ( const QString &  name) const

Retrieve a colour theme by name.

Parameters
nameThe name of the theme to retrieve.
Returns
The Colours object representing the requested theme.

If the requested theme does not exist, the factory default theme is returned.

◆ removeTheme()

void ColourStore::removeTheme ( const QString &  name)

Remove a colour theme by name.

Parameters
nameThe name of the theme to remove.

This function deletes the specified theme from the internal themes map. The "Factory" theme cannot be removed.

◆ saveAllThemes()

void ColourStore::saveAllThemes ( ) const

Save all colour themes to persistent storage.

This function iterates over all stored themes and saves them to QSettings, excluding the "Factory" theme.

◆ saveTheme()

void ColourStore::saveTheme ( const Colours theme)

Save a colour theme.

Parameters
themeThe Colours object representing the theme to save.

This function saves the given theme to persistent storage. The "Factory" theme is not saved as it is built-in.

◆ setTheme()

void ColourStore::setTheme ( const QString &  name,
const Colours theme 
)

Set or update a colour theme.

Parameters
nameThe name of the theme to set.
themeThe Colours object representing the theme.

This function adds or updates the specified theme in the internal themes map. The "Factory" theme cannot be modified.

◆ setThemes()

void ColourStore::setThemes ( const QMap< QString, Colours > &  newThemes)

Set multiple colour themes at once.

Parameters
newThemesA map of theme names to Colours objects.

This function replaces the current themes with the provided set, ensuring the "Factory" theme remains intact.

◆ themeNames()

const QStringList ColourStore::themeNames ( ) const

Retrieve the list of available theme names.

Returns
A QStringList containing the names of all themes.

The "Factory" theme is always listed first.


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