Q3270
A Qt-based 3270 Terminal Emulator
Loading...
Searching...
No Matches
ColourStore.h
1/*
2 * Q3270 Terminal Emulator
3 *
4 * Copyright (c) 2020–2025 Andy Styles
5 * SPDX-License-Identifier: BSD-3-Clause
6 *
7 * This file is part of Q3270.
8 * See the LICENSE file in the project root for full license information.
9 */
10
11#ifndef COLOURSTORE_H
12#define COLOURSTORE_H
13
14#include <QMap>
15#include <QStringList>
16#include <QSettings>
17
18#include "Models/Colours.h"
19
21{
22 public:
23
25
26 const QStringList themeNames() const;
27
28 Colours getTheme(const QString &name) const;
29
30 void saveTheme(const Colours &theme);
31 void removeTheme(const QString &name);
32
33 void setTheme(const QString &name, const Colours &theme);
34 void setThemes(const QMap<QString, Colours> &themes);
35
36 void saveAllThemes() const;
37
38 bool exists(const QString &name) const;
39
40 private:
41
42 QMap<QString, Colours> themes;
43
44 mutable QSettings settings;
45
46 void load();
47 void loadFactoryTheme();
48
49 void saveColours(const Colours &theme) const;
50};
51
52#endif // COLOURSTORE_H
Definition ColourStore.h:21
const QStringList themeNames() const
Retrieve the list of available theme names.
Definition ColourStore.cpp:236
Colours getTheme(const QString &name) const
Retrieve a colour theme by name.
Definition ColourStore.cpp:91
bool exists(const QString &name) const
Check if a colour theme exists.
Definition ColourStore.cpp:250
void setTheme(const QString &name, const Colours &theme)
Set or update a colour theme.
Definition ColourStore.cpp:182
ColourStore()
ColourStore::ColourStore constructor.
Definition ColourStore.cpp:18
void saveAllThemes() const
Save all colour themes to persistent storage.
Definition ColourStore.cpp:126
void saveTheme(const Colours &theme)
Save a colour theme.
Definition ColourStore.cpp:107
void setThemes(const QMap< QString, Colours > &themes)
Set multiple colour themes at once.
Definition ColourStore.cpp:199
void removeTheme(const QString &name)
Remove a colour theme by name.
Definition ColourStore.cpp:221
Definition Colours.h:19