File indexing completed on 2024-05-12 15:50:04
0001 /* 0002 SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: MIT 0005 */ 0006 0007 #ifndef KSYNTAXHIGHLIGHTING_FORMAT_P_H 0008 #define KSYNTAXHIGHLIGHTING_FORMAT_P_H 0009 0010 #include "textstyledata_p.h" 0011 #include "theme.h" 0012 0013 #include <QSharedData> 0014 #include <QString> 0015 0016 namespace KSyntaxHighlighting 0017 { 0018 class FormatPrivate : public QSharedData 0019 { 0020 public: 0021 FormatPrivate() = default; 0022 static FormatPrivate *detachAndGet(Format &format); 0023 0024 TextStyleData styleOverride(const Theme &theme) const; 0025 void load(QXmlStreamReader &reader); 0026 0027 using StyleColor = QRgb(TextStyleData::*); 0028 using ThemeColor = QRgb (Theme::*)(Theme::TextStyle) const; 0029 bool hasColor(const Theme &theme, StyleColor styleColor, ThemeColor themeColor) const; 0030 QColor color(const Theme &theme, StyleColor styleColor, ThemeColor themeColor) const; 0031 0032 QString definitionName; 0033 QString name; 0034 TextStyleData style; 0035 Theme::TextStyle defaultStyle = Theme::Normal; 0036 quint16 id = 0; 0037 bool spellCheck = true; 0038 }; 0039 0040 } 0041 0042 #endif