Open-Typer
Open source typewriting tutor program
Loading...
Searching...
No Matches
IThemeEngine.h
1/*
2 * IThemeEngine.h
3 * This file is part of Open-Typer
4 *
5 * Copyright (C) 2023 - adazem009
6 *
7 * Open-Typer is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * Open-Typer is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with Open-Typer. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef ITHEMEENGINE_H
22#define ITHEMEENGINE_H
23
24#include <QObject>
25#include "global/modularity/ioc.h"
26
27class IThemeEngine : public QObject, MODULE_EXPORT_INTERFACE
28{
29 Q_OBJECT
30 public:
31 virtual ~IThemeEngine() { }
32
33 // Note: Default accent color is defined in the default value of the accentColorId settings key
34 // The actual colors are defined in getAccentColor()
35 enum AccentColor
36 {
37 Accent_Red = 0,
38 Accent_Orange = 1,
39 Accent_Yellow = 2,
40 Accent_Green = 3,
41 Accent_LightBlue = 4,
42 Accent_Purple = 5,
43 Accent_Pink = 6
44 };
45 Q_ENUM(AccentColor)
46
47 enum class Theme
48 {
49 LightTheme = 1,
50 DarkTheme = 0
51 };
52 Q_ENUM(Theme)
53
54 virtual QFont font(void) = 0;
55 virtual void setFont(QFont newFont) = 0;
56 virtual QString fontFamily(void) = 0;
57 virtual void setFontFamily(QString family) = 0;
58 virtual int fontSize(void) = 0;
59 virtual void setFontSize(int size) = 0;
60 virtual void increaseFontSize(int delta) = 0;
61 virtual int maxFontSize(void) = 0;
62
63 virtual bool customExerciseTextColor(void) = 0;
64 virtual QColor exerciseTextColor(void) = 0;
65 virtual void setExerciseTextColor(QColor color) = 0;
66 virtual void resetExerciseTextColor(void) = 0;
67 virtual QColor defaultExerciseTextColor(void) = 0;
68 virtual QColor defaultExerciseTextColor(bool dark) = 0;
69 virtual QColor defaultExerciseTextColor(QColor accent) = 0;
70 virtual QColor defaultExerciseTextColor(QColor accent, bool dark) = 0;
71
72 virtual bool customInputTextColor(void) = 0;
73 virtual QColor inputTextColor(void) = 0;
74 virtual void setInputTextColor(QColor color) = 0;
75 virtual void resetInputTextColor(void) = 0;
76 virtual QColor defaultInputTextColor(bool dark = false) = 0;
77
78 virtual bool customBgColor(void) = 0;
79 virtual QColor bgColor(void) = 0;
80 virtual void setBgColor(QColor color) = 0;
81 virtual void resetBgColor(void) = 0;
82 virtual QColor defaultBgColor(bool dark = false) = 0;
83
84 virtual bool customPaperColor(void) = 0;
85 virtual QColor paperColor(void) = 0;
86 virtual void setPaperColor(QColor color) = 0;
87 virtual void resetPaperColor(void) = 0;
88 virtual QColor defaultPaperColor(bool dark = false) = 0;
89
90 virtual bool customPanelColor(void) = 0;
91 virtual QColor panelColor(void) = 0;
92 virtual void setPanelColor(QColor color) = 0;
93 virtual void resetPanelColor(void) = 0;
94 virtual QColor defaultPanelColor(bool dark = false) = 0;
95
96 virtual AccentColor accentColor(void) = 0;
97 virtual void setAccentColor(AccentColor color) = 0;
98 virtual QColor getAccentColor(AccentColor colorId) = 0;
99 virtual QColor currentAccentColor(void) = 0;
100
101 virtual Theme theme(void) const = 0;
102 virtual void setTheme(Theme newTheme) = 0;
103 virtual void updateTheme(void) = 0;
104 virtual void setDefaultTheme(void) = 0;
105
106 virtual QColor borderColor() const = 0;
107
108 virtual QColor foregroundColor() const = 0;
109
110 signals:
135 void borderColorChanged();
136 void foregroundColorChanged();
137};
138
139#endif // ITHEMEENGINE_H
Definition IThemeEngine.h:28
void panelColorChanged()
void exerciseTextColorChanged()
void currentAccentColorChanged()
void inputTextColorChanged()
void fontFamilyChanged()
void fontSizeChanged()
void colorChanged()
void themeChanged()
void bgColorChanged()
void accentColorChanged()
void fontChanged()
void paperColorChanged()