KSyntaxHighlighting
format.cpp
48QColor FormatPrivate::color(const Theme &theme, StyleColor styleColor, ThemeColor themeColor) const
55 return QColor::fromRgba(style.*styleColor ? style.*styleColor : (theme.*themeColor)(defaultStyle));
58bool FormatPrivate::hasColor(const Theme &theme, StyleColor styleColor, ThemeColor themeColor) const
61 return color(theme, styleColor, themeColor) != QColor::fromRgba((theme.*themeColor)(Theme::Normal)) && (style.*styleColor || (theme.*themeColor)(defaultStyle) || styleOverride(theme).*styleColor);
112 // use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black!
113 return (!hasTextColor(theme)) && (!hasBackgroundColor(theme)) && (selectedTextColor(theme).rgba() == theme.selectedTextColor(Theme::Normal))
114 && (selectedBackgroundColor(theme).rgba() == (theme.selectedBackgroundColor(Theme::Normal))) && (isBold(theme) == theme.isBold(Theme::Normal))
115 && (isItalic(theme) == theme.isItalic(Theme::Normal)) && (isUnderline(theme) == theme.isUnderline(Theme::Normal))
146 return d->color(theme, &TextStyleData::selectedBackgroundColor, &Theme::selectedBackgroundColor);
182 return d->style.hasStrikeThrough ? d->style.strikeThrough : theme.isStrikeThrough(d->defaultStyle);
Describes the format to be used for a specific text fragment.
Definition format.h:28
bool hasSelectedTextColorOverride() const
Returns true if the syntax definition file specifies a value for the selected text color attribute.
Definition format.cpp:220
bool hasBackgroundColorOverride() const
Returns true if the syntax definition file sets a value for the background color attribute and,...
Definition format.cpp:215
bool hasBoldOverride() const
Returns true if the syntax definition file sets a value for the bold text attribute and,...
Definition format.cpp:190
bool isUnderline(const Theme &theme) const
Returns true if the combination of this format and the given theme results in underlined text.
Definition format.cpp:167
QString name() const
The name of this format as used in the syntax definition file.
Definition format.cpp:95
bool hasTextColorOverride() const
Returns true if the syntax definition file sets a value for the foreground text color attribute and,...
Definition format.cpp:210
bool isDefaultTextStyle(const Theme &theme) const
Returns true if the combination of this format and the theme theme do not change the default text for...
Definition format.cpp:110
QColor textColor(const Theme &theme) const
Returns the foreground color of the combination of this format and the given theme.
Definition format.cpp:124
QColor selectedBackgroundColor(const Theme &theme) const
Returns the background color of selected text of the combination of this format and the given theme.
Definition format.cpp:144
bool hasBackgroundColor(const Theme &theme) const
Returns true if the combination of this format and the theme theme change the background color compar...
Definition format.cpp:134
Theme::TextStyle textStyle() const
Returns the underlying TextStyle of this Format.
Definition format.cpp:105
bool spellCheck() const
Returns whether characters with this format should be spell checked.
Definition format.cpp:185
bool isBold(const Theme &theme) const
Returns true if the combination of this format and the given theme results in bold text formatting.
Definition format.cpp:149
bool hasSelectedBackgroundColorOverride() const
Returns true if the syntax definition file specifies a value for the selected background color attrib...
Definition format.cpp:225
QColor backgroundColor(const Theme &theme) const
Returns the background color of the combination of this format and the given theme.
Definition format.cpp:139
bool hasItalicOverride() const
Returns true if the syntax definition file sets a value for the italic text attribute and,...
Definition format.cpp:195
bool hasStrikeThroughOverride() const
Returns true if the syntax definition file specifies a value for the struck through text attribute.
Definition format.cpp:205
QColor selectedTextColor(const Theme &theme) const
Returns the foreground color for selected text of the combination of this format and the given theme.
Definition format.cpp:129
bool isItalic(const Theme &theme) const
Returns true if the combination of this format and the given theme results in italic text formatting.
Definition format.cpp:158
bool hasUnderlineOverride() const
Returns true if the syntax definition file sets a value for the underlined text attribute and,...
Definition format.cpp:200
bool isStrikeThrough(const Theme &theme) const
Returns true if the combination of this format and the given theme results in struck through text.
Definition format.cpp:176
bool hasTextColor(const Theme &theme) const
Returns true if the combination of this format and the theme theme change the foreground color compar...
Definition format.cpp:119
bool isStrikeThrough(TextStyle style) const
Returns whether the given style should be shown struck through.
Definition theme.cpp:97
QRgb textColor(TextStyle style) const
Returns the text color to be used for style.
Definition theme.cpp:62
bool isBold(TextStyle style) const
Returns whether the given style should be shown in bold.
Definition theme.cpp:82
QRgb selectedTextColor(TextStyle style) const
Returns the selected text color to be used for style.
Definition theme.cpp:67
QRgb selectedBackgroundColor(TextStyle style) const
Returns the background color to be used for selected text for style.
Definition theme.cpp:77
bool isUnderline(TextStyle style) const
Returns whether the given style should be shown underlined.
Definition theme.cpp:92
TextStyle
Default styles that can be referenced from syntax definition XML files.
Definition theme.h:75
@ Normal
Default text style for normal text and source code without special highlighting.
Definition theme.h:78
bool isItalic(TextStyle style) const
Returns whether the given style should be shown in italic.
Definition theme.cpp:87
QRgb backgroundColor(TextStyle style) const
Returns the background color to be used for style.
Definition theme.cpp:72
KGuiItem ok()
Syntax highlighting engine for Kate syntax definitions.
Definition abstracthighlighter.h:17
const char * constData() const const
QColor fromRgb(QRgb rgb)
QColor fromRgba(QRgb rgba)
QRgb rgba() const const
QMetaEnum fromType()
bool isEmpty() const const
QStringView sliced(qsizetype pos) const const
bool startsWith(QChar ch) const const
QByteArray toLatin1() const const
QString toString() const const
QStringView value(QAnyStringView namespaceUri, QAnyStringView name) const const
QXmlStreamAttributes attributes() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.