KIconThemes

kiconcolors.h
1/*
2
3 This file is part of the KDE project, module kdecore.
4 SPDX-FileCopyrightText: 2000 Geert Jansen <jansen@kde.org>
5 SPDX-FileCopyrightText: 2000 Antonio Larrosa <larrosa@kde.org>
6
7 SPDX-License-Identifier: LGPL-2.0-only
8*/
9
10#ifndef KICONCOLORS_H
11#define KICONCOLORS_H
12
13#include "kiconloader.h"
14#include <QPalette>
15#include <QSharedDataPointer>
16
17class KIconColorsPrivate;
18
19/**
20 * @class KIconColors
21 *
22 * Sepecifies which colors will be used when recoloring icons as its stylesheet.
23 *
24 * KIconLoader supports re-coloring svg icons based on a set of colors. This
25 * class will define them.
26 *
27 * @see KIconEngine
28 * @see KDE::icon
29 */
30class KICONTHEMES_EXPORT KIconColors
31{
32public:
33 /**
34 * Will fill the colors based on the default QPalette() constructor.
35 */
37
38 /**
39 * Makes all the color property be @p colors
40 */
41 explicit KIconColors(const QColor &colors);
42
43 /**
44 * Uses @palette to define text, highlight, highlightedText, accent and background.
45 * The rest being positiveText, negativeText and neutralText are filled from
46 * KColorScheme(QPalette::Active, KColorScheme::Window);
47 */
48 explicit KIconColors(const QPalette &palette);
49
50 KIconColors(const KIconColors &other);
52 KIconColors operator=(const KIconColors &other);
53
54 QColor text() const;
55 QColor highlight() const;
56 QColor highlightedText() const;
57 QColor accent() const;
58 QColor background() const;
59 QColor neutralText() const;
60 QColor positiveText() const;
61 QColor negativeText() const;
62 QColor activeText() const;
63
64 void setText(const QColor &color);
65 void setHighlight(const QColor &color);
66 void setHighlightedText(const QColor &color);
67 void setAccent(const QColor &color);
68 void setBackground(const QColor &color);
69 void setNeutralText(const QColor &color);
70 void setPositiveText(const QColor &color);
71 void setNegativeText(const QColor &color);
72 void setActiveText(const QColor& color);
73
74protected:
75 /**
76 * @returns a CSS stylesheet to be used SVG icon files.
77 * @param state defines the state we are rendering the stylesheet for
78 *
79 * Specifies: .ColorScheme-Text, .ColorScheme-Background, .ColorScheme-Highlight,
80 * .ColorScheme-HighlightedText, .ColorScheme-PositiveText, .ColorScheme-NeutralText
81 * .ColorScheme-NegativeText, .ColorScheme-ActiveText, .ColorScheme-Complement,
82 * .ColorScheme-Contrast, .ColorScheme-Accent,
83 */
84 QString stylesheet(KIconLoader::States state) const;
85
86private:
87 Q_DECLARE_PRIVATE(KIconColors)
88 friend class KIconLoaderPrivate;
89
91};
92
93#endif
Sepecifies which colors will be used when recoloring icons as its stylesheet.
Definition kiconcolors.h:31
States
Defines the possible states of an icon.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.