1 /*
2     SPDX-FileCopyrightText: 2006-2007 Aaron Seigo <aseigo@kde.org>
3     SPDX-FileCopyrightText: 2013 Marco Martin <mart@kde.org>
4 
5     SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef PLASMA_QUICKTHEME_H
9 #define PLASMA_QUICKTHEME_H
10 
11 #include <plasma/theme.h>
12 
13 #include <QColor>
14 
15 namespace Plasma
16 {
17 /**
18  * @class QuickTheme plasma/theme.h <Plasma/Theme>
19  *
20  * @short Interface to the Plasma theme
21  *
22  *
23  * Plasma::Theme provides access to a common and standardized set of graphic
24  * elements stored in SVG format. This allows artists to create single packages
25  * of SVGs that will affect the look and feel of all workspace components.
26  *
27  * Plasma::Svg uses Plasma::Theme internally to locate and load the appropriate
28  * SVG data. Alternatively, Plasma::Theme can be used directly to retrieve
29  * file system paths to SVGs by name.
30  */
31 class QuickTheme : public Plasma::Theme
32 {
33     Q_OBJECT
34 
35     // colors
36     Q_PROPERTY(QColor textColor READ textColor NOTIFY themeChangedProxy)
37     Q_PROPERTY(QColor highlightColor READ highlightColor NOTIFY themeChangedProxy)
38     Q_PROPERTY(QColor highlightedTextColor READ highlightedTextColor NOTIFY themeChangedProxy)
39     Q_PROPERTY(QColor backgroundColor READ backgroundColor NOTIFY themeChangedProxy)
40     Q_PROPERTY(QColor linkColor READ linkColor NOTIFY themeChangedProxy)
41     Q_PROPERTY(QColor visitedLinkColor READ visitedLinkColor NOTIFY themeChangedProxy)
42     Q_PROPERTY(QColor positiveTextColor READ positiveTextColor NOTIFY themeChangedProxy)
43     Q_PROPERTY(QColor neutralTextColor READ neutralTextColor NOTIFY themeChangedProxy)
44     Q_PROPERTY(QColor negativeTextColor READ negativeTextColor NOTIFY themeChangedProxy)
45     Q_PROPERTY(QColor disabledTextColor READ disabledTextColor NOTIFY themeChangedProxy)
46 
47     Q_PROPERTY(QColor buttonTextColor READ buttonTextColor NOTIFY themeChangedProxy)
48     Q_PROPERTY(QColor buttonBackgroundColor READ buttonBackgroundColor NOTIFY themeChangedProxy)
49     Q_PROPERTY(QColor buttonHoverColor READ buttonHoverColor NOTIFY themeChangedProxy)
50     Q_PROPERTY(QColor buttonFocusColor READ buttonFocusColor NOTIFY themeChangedProxy)
51     Q_PROPERTY(QColor buttonHighlightedTextColor READ buttonHighlightedTextColor NOTIFY themeChangedProxy)
52     Q_PROPERTY(QColor buttonPositiveTextColor READ buttonPositiveTextColor NOTIFY themeChangedProxy)
53     Q_PROPERTY(QColor buttonNeutralTextColor READ buttonNeutralTextColor NOTIFY themeChangedProxy)
54     Q_PROPERTY(QColor buttonNegativeTextColor READ buttonNegativeTextColor NOTIFY themeChangedProxy)
55 
56     Q_PROPERTY(QColor viewTextColor READ viewTextColor NOTIFY themeChangedProxy)
57     Q_PROPERTY(QColor viewBackgroundColor READ viewBackgroundColor NOTIFY themeChangedProxy)
58     Q_PROPERTY(QColor viewHoverColor READ viewHoverColor NOTIFY themeChangedProxy)
59     Q_PROPERTY(QColor viewFocusColor READ viewFocusColor NOTIFY themeChangedProxy)
60     Q_PROPERTY(QColor viewHighlightedTextColor READ viewHighlightedTextColor NOTIFY themeChangedProxy)
61     Q_PROPERTY(QColor viewPositiveTextColor READ viewPositiveTextColor NOTIFY themeChangedProxy)
62     Q_PROPERTY(QColor viewNeutralTextColor READ viewNeutralTextColor NOTIFY themeChangedProxy)
63     Q_PROPERTY(QColor viewNegativeTextColor READ viewNegativeTextColor NOTIFY themeChangedProxy)
64 
65     Q_PROPERTY(QColor complementaryTextColor READ complementaryTextColor NOTIFY themeChangedProxy)
66     Q_PROPERTY(QColor complementaryBackgroundColor READ complementaryBackgroundColor NOTIFY themeChangedProxy)
67     Q_PROPERTY(QColor complementaryHoverColor READ complementaryHoverColor NOTIFY themeChangedProxy)
68     Q_PROPERTY(QColor complementaryFocusColor READ complementaryFocusColor NOTIFY themeChangedProxy)
69     Q_PROPERTY(QColor complementaryHighlightedTextColor READ complementaryHighlightedTextColor NOTIFY themeChangedProxy)
70     Q_PROPERTY(QColor complementaryPositiveTextColor READ complementaryPositiveTextColor NOTIFY themeChangedProxy)
71     Q_PROPERTY(QColor complementaryNeutralTextColor READ complementaryNeutralTextColor NOTIFY themeChangedProxy)
72     Q_PROPERTY(QColor complementaryNegativeTextColor READ complementaryNegativeTextColor NOTIFY themeChangedProxy)
73 
74     Q_PROPERTY(QColor headerTextColor READ headerTextColor NOTIFY themeChangedProxy)
75     Q_PROPERTY(QColor headerBackgroundColor READ headerBackgroundColor NOTIFY themeChangedProxy)
76     Q_PROPERTY(QColor headerHoverColor READ headerHoverColor NOTIFY themeChangedProxy)
77     Q_PROPERTY(QColor headerFocusColor READ headerFocusColor NOTIFY themeChangedProxy)
78     Q_PROPERTY(QColor headerHighlightedTextColor READ headerHighlightedTextColor NOTIFY themeChangedProxy)
79     Q_PROPERTY(QColor headerPositiveTextColor READ headerPositiveTextColor NOTIFY themeChangedProxy)
80     Q_PROPERTY(QColor headerNeutralTextColor READ headerNeutralTextColor NOTIFY themeChangedProxy)
81     Q_PROPERTY(QColor headerNegativeTextColor READ headerNegativeTextColor NOTIFY themeChangedProxy)
82 
83 public:
84     explicit QuickTheme(QObject *parent = nullptr);
85     ~QuickTheme() override;
86 
87     /**
88      * @return The theme's colorscheme's text color
89      * @since 5.0
90      */
91     QColor textColor() const;
92 
93     /**
94      * @return The theme's colorscheme's highlight color
95      * @since 5.0
96      */
97     QColor highlightColor() const;
98 
99     /**
100      * @return The theme's colorscheme's highlighted text color
101      * @since 5.22
102      */
103     QColor highlightedTextColor() const;
104 
105     /**
106      * @return The theme's colorscheme's positive text color
107      * @since 5.22
108      */
109     QColor positiveTextColor() const;
110 
111     /**
112      * @return The theme's colorscheme's neutral text color
113      * @since 5.22
114      */
115     QColor neutralTextColor() const;
116 
117     /**
118      * @return The theme's colorscheme's negative text color
119      * @since 5.22
120      */
121     QColor negativeTextColor() const;
122 
123     /**
124      * @return The theme's colorscheme's disabled text color
125      * @since 5.64
126      */
127     QColor disabledTextColor() const;
128 
129     /**
130      * @return The theme's colorscheme's background color
131      * @since 5.0
132      */
133     QColor backgroundColor() const;
134 
135     /**
136      * @return The theme's colorscheme's color for text on buttons
137      * @since 5.0
138      */
139     QColor buttonTextColor() const;
140 
141     /**
142      * @return The theme's colorscheme's background color color of buttons
143      * @since 5.0
144      */
145     QColor buttonBackgroundColor() const;
146 
147     /**
148      * @return The theme's colorscheme's positive text color of buttons
149      * @since 5.22
150      */
151     QColor buttonPositiveTextColor() const;
152 
153     /**
154      * @return The theme's colorscheme's neutral text color of buttons
155      * @since 5.22
156      */
157     QColor buttonNeutralTextColor() const;
158 
159     /**
160      * @return The theme's colorscheme's negative text color of buttons
161      * @since 5.22
162      */
163     QColor buttonNegativeTextColor() const;
164 
165     /**
166      * @return The theme's colorscheme's link color
167      * @since 5.0
168      */
169     QColor linkColor() const;
170 
171     /**
172      * @return The theme's colorscheme's text color for visited links
173      * @since 5.0
174      */
175     QColor visitedLinkColor() const;
176 
177     /**
178      * @return The theme's colorscheme's color of hovered buttons
179      * @since 5.0
180      */
181     QColor buttonHoverColor() const;
182 
183     /**
184      * @return The theme's colorscheme's color of focused buttons
185      * @since 5.0
186      */
187     QColor buttonFocusColor() const;
188 
189     /**
190      * @return The theme's colorscheme's highlighted text color for buttons
191      * @since 5.22
192      */
193     QColor buttonHighlightedTextColor() const;
194 
195     /**
196      * @return The theme's colorscheme's text color in views
197      * @since 5.0
198      */
199     QColor viewTextColor() const;
200 
201     /**
202      * @return The theme's colorscheme's background color of views
203      * @since 5.0
204      */
205     QColor viewBackgroundColor() const;
206 
207     /**
208      * @return The theme's colorscheme's color of hovered views
209      * @since 5.0
210      */
211     QColor viewHoverColor() const;
212 
213     /**
214      * @return The theme's colorscheme's color of focused views
215      * @since 5.0
216      */
217     QColor viewFocusColor() const;
218 
219     /**
220      * @return The theme's colorscheme's highlighted text color for views
221      * @since 5.22
222      */
223     QColor viewHighlightedTextColor() const;
224 
225     /**
226      * @return The theme's colorscheme's positive text color of view
227      * @since 5.22
228      */
229     QColor viewPositiveTextColor() const;
230 
231     /**
232      * @return The theme's colorscheme's neutral text color of view
233      * @since 5.22
234      */
235     QColor viewNeutralTextColor() const;
236 
237     /**
238      * @return The theme's colorscheme's negative text color of view
239      * @since 5.22
240      */
241     QColor viewNegativeTextColor() const;
242 
243     /**
244      * @return The theme's colorscheme's text color of "complementary" areas
245      * @since 5.0
246      */
247     QColor complementaryTextColor() const;
248 
249     /**
250      * @return The theme's colorscheme's background color of "complementary" areas
251      * @since 5.0
252      */
253     QColor complementaryBackgroundColor() const;
254 
255     /**
256      * @return The theme's colorscheme's color of hovered "complementary" areas
257      * @since 5.0
258      */
259     QColor complementaryHoverColor() const;
260 
261     /**
262      * @return The theme's colorscheme's color of focused "complementary" areas
263      * @since 5.0
264      */
265     QColor complementaryFocusColor() const;
266 
267     /**
268      * @return The theme's colorscheme's highlighted text color for "complementary" areas
269      * @since 5.22
270      */
271     QColor complementaryHighlightedTextColor() const;
272 
273     /**
274      * @return The theme's colorscheme's positive text color of complementary
275      * @since 5.22
276      */
277     QColor complementaryPositiveTextColor() const;
278 
279     /**
280      * @return The theme's colorscheme's neutral text color of complementary
281      * @since 5.22
282      */
283     QColor complementaryNeutralTextColor() const;
284 
285     /**
286      * @return The theme's colorscheme's negative text color of complementary
287      * @since 5.22
288      */
289     QColor complementaryNegativeTextColor() const;
290 
291     /**
292      * @return The theme's colorscheme's text color of "header" areas
293      * @since 5.0
294      */
295     QColor headerTextColor() const;
296 
297     /**
298      * @return The theme's colorscheme's background color of "header" areas
299      * @since 5.0
300      */
301     QColor headerBackgroundColor() const;
302 
303     /**
304      * @return The theme's colorscheme's color of hovered "header" areas
305      * @since 5.0
306      */
307     QColor headerHoverColor() const;
308 
309     /**
310      * @return The theme's colorscheme's color of focused "header" areas
311      * @since 5.0
312      */
313     QColor headerFocusColor() const;
314 
315     /**
316      * @return The theme's colorscheme's highlighted text color for "header" areas
317      * @since 5.22
318      */
319     QColor headerHighlightedTextColor() const;
320 
321     /**
322      * @return The theme's colorscheme's positive text color of header
323      * @since 5.22
324      */
325     QColor headerPositiveTextColor() const;
326 
327     /**
328      * @return The theme's colorscheme's neutral text color of header
329      * @since 5.22
330      */
331     QColor headerNeutralTextColor() const;
332 
333     /**
334      * @return The theme's colorscheme's negative text color of header
335      * @since 5.22
336      */
337     QColor headerNegativeTextColor() const;
338 
339 Q_SIGNALS:
340     void themeChangedProxy();
341 };
342 
343 } // Plasma namespace
344 
345 #endif // multiple inclusion guard
346