KSyntaxHighlighting

format.h
1 /*
2  Copyright (C) 2016 Volker Krause <[email protected]>
3 
4  Permission is hereby granted, free of charge, to any person obtaining
5  a copy of this software and associated documentation files (the
6  "Software"), to deal in the Software without restriction, including
7  without limitation the rights to use, copy, modify, merge, publish,
8  distribute, sublicense, and/or sell copies of the Software, and to
9  permit persons to whom the Software is furnished to do so, subject to
10  the following conditions:
11 
12  The above copyright notice and this permission notice shall be included
13  in all copies or substantial portions of the Software.
14 
15  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23 
24 #ifndef KSYNTAXHIGHLIGHTING_FORMAT_H
25 #define KSYNTAXHIGHLIGHTING_FORMAT_H
26 
27 #include "ksyntaxhighlighting_export.h"
28 #include "theme.h"
29 
30 #include <QExplicitlySharedDataPointer>
31 
32 QT_BEGIN_NAMESPACE
33 class QColor;
34 class QString;
35 class QXmlStreamReader;
36 QT_END_NAMESPACE
37 
38 namespace KSyntaxHighlighting
39 {
40 class DefinitionRef;
41 class FormatPrivate;
42 
50 class KSYNTAXHIGHLIGHTING_EXPORT Format
51 {
52 public:
54  Format();
55  Format(const Format &other);
56  ~Format();
57 
58  Format &operator=(const Format &other);
59 
63  bool isValid() const;
64 
66  QString name() const;
67 
74  quint16 id() const;
75 
83  Theme::TextStyle textStyle() const;
84 
92  bool isDefaultTextStyle(const Theme &theme) const;
93 
97  bool hasTextColor(const Theme &theme) const;
101  QColor textColor(const Theme &theme) const;
105  QColor selectedTextColor(const Theme &theme) const;
109  bool hasBackgroundColor(const Theme &theme) const;
113  QColor backgroundColor(const Theme &theme) const;
117  QColor selectedBackgroundColor(const Theme &theme) const;
118 
122  bool isBold(const Theme &theme) const;
126  bool isItalic(const Theme &theme) const;
130  bool isUnderline(const Theme &theme) const;
134  bool isStrikeThrough(const Theme &theme) const;
135 
139  bool spellCheck() const;
140 
147  bool hasBoldOverride() const;
148 
155  bool hasItalicOverride() const;
156 
163  bool hasUnderlineOverride() const;
164 
171  bool hasStrikeThroughOverride() const;
172 
179  bool hasTextColorOverride() const;
180 
187  bool hasBackgroundColorOverride() const;
188 
195  bool hasSelectedTextColorOverride() const;
196 
203  bool hasSelectedBackgroundColorOverride() const;
204 
205 private:
206  friend class FormatPrivate;
208 };
209 }
210 
211 QT_BEGIN_NAMESPACE
212 Q_DECLARE_TYPEINFO(KSyntaxHighlighting::Format, Q_MOVABLE_TYPE);
213 QT_END_NAMESPACE
214 
215 #endif // KSYNTAXHIGHLIGHTING_FORMAT_H
Syntax highlighting engine for Kate syntax definitions.
Color theme definition used for highlighting.
Definition: theme.h:81
TextStyle
Default styles that can be referenced from syntax definition XML files.
Definition: theme.h:95
Describes the format to be used for a specific text fragment.
Definition: format.h:50
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jul 9 2020 22:58:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.