Changeset View
Changeset View
Standalone View
Standalone View
src/lib/format.h
Show All 13 Lines | 1 | /* | |||
---|---|---|---|---|---|
14 | You should have received a copy of the GNU General Public License | 14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | #ifndef KSYNTAXHIGHLIGHTING_FORMAT_H | 18 | #ifndef KSYNTAXHIGHLIGHTING_FORMAT_H | ||
19 | #define KSYNTAXHIGHLIGHTING_FORMAT_H | 19 | #define KSYNTAXHIGHLIGHTING_FORMAT_H | ||
20 | 20 | | |||
21 | #include "ksyntaxhighlighting_export.h" | 21 | #include "ksyntaxhighlighting_export.h" | ||
22 | #include "theme.h" | ||||
22 | 23 | | |||
23 | #include <QExplicitlySharedDataPointer> | 24 | #include <QExplicitlySharedDataPointer> | ||
24 | #include <QTypeInfo> | 25 | #include <QTypeInfo> | ||
25 | 26 | | |||
27 | | ||||
26 | class QColor; | 28 | class QColor; | ||
27 | class QString; | 29 | class QString; | ||
28 | class QXmlStreamReader; | 30 | class QXmlStreamReader; | ||
29 | 31 | | |||
30 | namespace KSyntaxHighlighting { | 32 | namespace KSyntaxHighlighting { | ||
31 | 33 | | |||
32 | class DefinitionRef; | 34 | class DefinitionRef; | ||
33 | class FormatPrivate; | 35 | class FormatPrivate; | ||
34 | class Theme; | | |||
35 | 36 | | |||
36 | /** Describes the format to be used for a specific text fragment. | 37 | /** Describes the format to be used for a specific text fragment. | ||
37 | * The actual format used for displaying is merged from the format information | 38 | * The actual format used for displaying is merged from the format information | ||
38 | * in the syntax definition file, and a theme. | 39 | * in the syntax definition file, and a theme. | ||
39 | * | 40 | * | ||
40 | * @see Theme | 41 | * @see Theme | ||
41 | * @since 5.28 | 42 | * @since 5.28 | ||
42 | */ | 43 | */ | ||
Show All 18 Lines | 46 | public: | |||
61 | /** Returns a unique identifier of this format. | 62 | /** Returns a unique identifier of this format. | ||
62 | * This is useful for efficient storing of formats in a text line. The | 63 | * This is useful for efficient storing of formats in a text line. The | ||
63 | * identifier is unique per Repository instance, but will change when | 64 | * identifier is unique per Repository instance, but will change when | ||
64 | * the repository is reloaded (which also invalidatess the corresponding | 65 | * the repository is reloaded (which also invalidatess the corresponding | ||
65 | * Definition anyway). | 66 | * Definition anyway). | ||
66 | */ | 67 | */ | ||
67 | quint16 id() const; | 68 | quint16 id() const; | ||
68 | 69 | | |||
70 | /** Returns the underlying TextStyle of this Format. | ||||
71 | * Every Theme::TextStyle is visually defined by a Theme. A Format uses one | ||||
72 | * of the Theme::TextStyle%s and on top allows modifications such as setting | ||||
73 | * a different foreground color etc. | ||||
74 | * @see Theme::TextStyle | ||||
75 | * @since 5.49 | ||||
76 | */ | ||||
77 | Theme::TextStyle textStyle() const; | ||||
78 | | ||||
69 | /** Returns @c true if the combination of this format and the theme @p theme | 79 | /** Returns @c true if the combination of this format and the theme @p theme | ||
70 | * do not change the default text format in any way. | 80 | * do not change the default text format in any way. | ||
71 | * This is useful for output formats where changing formatting implies cost, | 81 | * This is useful for output formats where changing formatting implies cost, | ||
72 | * and thus benefit from optimizing the default case of not having any format | 82 | * and thus benefit from optimizing the default case of not having any format | ||
73 | * applied. If you make use of this, make sure to set the default text style | 83 | * applied. If you make use of this, make sure to set the default text style | ||
74 | * to what the corresponding theme sets for Theme::Normal. | 84 | * to what the corresponding theme sets for Theme::Normal. | ||
75 | */ | 85 | */ | ||
76 | bool isDefaultTextStyle(const Theme &theme) const; | 86 | bool isDefaultTextStyle(const Theme &theme) const; | ||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |