diff options
Diffstat (limited to 'src/libs/3rdparty/syntax-highlighting/src/lib/format.h')
-rw-r--r-- | src/libs/3rdparty/syntax-highlighting/src/lib/format.h | 106 |
1 files changed, 73 insertions, 33 deletions
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/format.h b/src/libs/3rdparty/syntax-highlighting/src/lib/format.h index 24c58e73f6..397a1bab01 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/format.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/format.h @@ -1,24 +1,8 @@ /* - Copyright (C) 2016 Volker Krause <vkrause@kde.org> - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org> + SPDX-FileCopyrightText: 2020 Jonathan Poelen <jonathan.poelen@gmail.com> + + SPDX-License-Identifier: MIT */ #ifndef KSYNTAXHIGHLIGHTING_FORMAT_H @@ -28,17 +12,9 @@ #include "theme.h" #include <QExplicitlySharedDataPointer> -#include <QTypeInfo> - -QT_BEGIN_NAMESPACE -class QColor; -class QString; -class QXmlStreamReader; -QT_END_NAMESPACE - -namespace KSyntaxHighlighting { -class DefinitionRef; +namespace KSyntaxHighlighting +{ class FormatPrivate; /** Describes the format to be used for a specific text fragment. @@ -56,7 +32,7 @@ public: Format(const Format &other); ~Format(); - Format& operator=(const Format &other); + Format &operator=(const Format &other); /** Returns @c true if this is a valid format, ie. one that * was read from a syntax definition file. @@ -72,7 +48,7 @@ public: * the repository is reloaded (which also invalidatess the corresponding * Definition anyway). */ - quint16 id() const; + int id() const; /** Returns the underlying TextStyle of this Format. * Every Theme::TextStyle is visually defined by a Theme. A Format uses one @@ -139,6 +115,70 @@ public: */ bool spellCheck() const; + /** Returns @c true if the syntax definition file sets a value for the bold text + * attribute and, therefore, overrides the theme and the default formatting + * style. If the return is @p true, this value is obtained by isBold(). + * @see isBold() + * @since 5.62 + */ + bool hasBoldOverride() const; + + /** Returns @c true if the syntax definition file sets a value for the italic text + * attribute and, therefore, overrides the theme and the default formatting style. + * If the return is @p true, this value is obtained by isItalic(). + * @see isItalic() + * @since 5.62 + */ + bool hasItalicOverride() const; + + /** Returns @c true if the syntax definition file sets a value for the underlined + * text attribute and, therefore, overrides the theme and the default formatting + * style. If the return is @p true, this value is obtained by isUnderline(). + * @see isUnderline() + * @since 5.62 + */ + bool hasUnderlineOverride() const; + + /** Returns @c true if the syntax definition file specifies a value for the + * struck through text attribute. If the return is @p true, this value + * is obtained by isStrikeThrough(). + * @see isStrikeThrough() + * @since 5.62 + */ + bool hasStrikeThroughOverride() const; + + /** Returns @c true if the syntax definition file sets a value for the foreground + * text color attribute and, therefore, overrides the theme and the default formatting + * style. If the return is @p true, this value is obtained by textColor(). + * @see textColor(), hasTextColor() + * @since 5.62 + */ + bool hasTextColorOverride() const; + + /** Returns @c true if the syntax definition file sets a value for the background + * color attribute and, therefore, overrides the theme and the default formatting + * style. If the return is @p true, this value is obtained by backgroundColor(). + * @see backgroundColor(), hasBackgroundColor() + * @since 5.62 + */ + bool hasBackgroundColorOverride() const; + + /** Returns @c true if the syntax definition file specifies a value for the + * selected text color attribute. If the return is @p true, this value is + * obtained by selectedTextColor(). + * @see selectedTextColor() + * @since 5.62 + */ + bool hasSelectedTextColorOverride() const; + + /** Returns @c true if the syntax definition file specifies a value for the + * selected background color attribute. If the return is @p true, this + * value is obtained by selectedBackgroundColor(). + * @see selectedBackgroundColor() + * @since 5.62 + */ + bool hasSelectedBackgroundColorOverride() const; + private: friend class FormatPrivate; QExplicitlySharedDataPointer<FormatPrivate> d; @@ -146,7 +186,7 @@ private: } QT_BEGIN_NAMESPACE -Q_DECLARE_TYPEINFO(KSyntaxHighlighting::Format, Q_MOVABLE_TYPE); +Q_DECLARE_TYPEINFO(KSyntaxHighlighting::Format, Q_RELOCATABLE_TYPE); QT_END_NAMESPACE #endif // KSYNTAXHIGHLIGHTING_FORMAT_H |