diff --git a/src/lib/format.h b/src/lib/format.h --- a/src/lib/format.h +++ b/src/lib/format.h @@ -138,6 +138,63 @@ */ bool spellCheck() const; + /** Returns @c true if the syntax definition file specifies a value for the + * bold text attribute. If the return is @c true, this value is + * obtained by isBold(). + * @see isBold() + * @since 5.62 + */ + bool definitionHasBold() const; + /** Returns @c true if the syntax definition file specifies a value for the + * italic text attribute. If the return is @c true, this value is + * obtained by isItalic(). + * @see isItalic() + * @since 5.62 + */ + bool definitionHasItalic() const; + /** Returns @c true if the syntax definition file specifies a value for the + * underlined text attribute. If the return is @c true, this value is + * obtained by isUnderline(). + * @see isUnderline() + * @since 5.62 + */ + bool definitionHasUnderline() const; + /** Returns @c true if the syntax definition file specifies a value for the + * struck through text attribute. If the return is @c true, this value is + * obtained by isStrikeThrough(). + * @see isStrikeThrough() + * @since 5.62 + */ + bool definitionHasStrikeThrough() const; + /** Returns @c true if the syntax definition file specifies a value for the + * foreground text color attribute. If the return is @c true, this + * value is obtained by textColor(). + * @see textColor(), hasTextColor() + * @since 5.62 + */ + bool definitionHasTextColor() const; + /** Returns @c true if the syntax definition file specifies a value for the + * background color attribute. If the return is @c true, this value is + * obtained by backgroundColor(). + * @see backgroundColor(), hasBackgroundColor() + * @since 5.62 + */ + bool definitionHasBackgroundColor() const; + /** Returns @c true if the syntax definition file specifies a value for the + * selected text color attribute. If the return is @c true, this value is + * obtained by selectedTextColor(). + * @see selectedTextColor() + * @since 5.62 + */ + bool definitionHasSelectedTextColor() const; + /** Returns @c true if the syntax definition file specifies a value for the + * selected background color attribute. If the return is @c true, this + * value is obtained by selectedBackgroundColor(). + * @see selectedBackgroundColor() + * @since 5.62 + */ + bool definitionHasSelectedBackgroundColor() const; + private: friend class FormatPrivate; QExplicitlySharedDataPointer d; diff --git a/src/lib/format.cpp b/src/lib/format.cpp --- a/src/lib/format.cpp +++ b/src/lib/format.cpp @@ -206,6 +206,46 @@ return d->spellCheck; } +bool Format::definitionHasBold() const +{ + return d->style.hasBold; +} + +bool Format::definitionHasItalic() const +{ + return d->style.hasItalic; +} + +bool Format::definitionHasUnderline() const +{ + return d->style.hasUnderline; +} + +bool Format::definitionHasStrikeThrough() const +{ + return d->style.hasStrikeThrough; +} + +bool Format::definitionHasTextColor() const +{ + return d->style.textColor; +} + +bool Format::definitionHasBackgroundColor() const +{ + return d->style.backgroundColor; +} + +bool Format::definitionHasSelectedTextColor() const +{ + return d->style.selectedTextColor; +} + +bool Format::definitionHasSelectedBackgroundColor() const +{ + return d->style.selectedBackgroundColor; +} + void FormatPrivate::load(QXmlStreamReader& reader) {