1 | /* |
2 | SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org> |
3 | |
4 | SPDX-License-Identifier: MIT |
5 | */ |
6 | |
7 | #ifndef KSYNTAXHIGHLIGHTING_HTMLHIGHLIGHTER_H |
8 | #define KSYNTAXHIGHLIGHTING_HTMLHIGHLIGHTER_H |
9 | |
10 | #include "abstracthighlighter.h" |
11 | #include "ksyntaxhighlighting_export.h" |
12 | #include "theme.h" |
13 | |
14 | #include <QString> |
15 | |
16 | QT_BEGIN_NAMESPACE |
17 | class QIODevice; |
18 | QT_END_NAMESPACE |
19 | |
20 | namespace KSyntaxHighlighting |
21 | { |
22 | class HtmlHighlighterPrivate; |
23 | |
24 | class KSYNTAXHIGHLIGHTING_EXPORT HtmlHighlighter : public AbstractHighlighter |
25 | { |
26 | public: |
27 | HtmlHighlighter(); |
28 | ~HtmlHighlighter() override; |
29 | |
30 | void highlightFile(const QString &fileName, const QString &title = QString()); |
31 | void highlightData(QIODevice *device, const QString &title = QString()); |
32 | |
33 | void setOutputFile(const QString &fileName); |
34 | void setOutputFile(FILE *fileHandle); |
35 | |
36 | void setBackgroundRole(Theme::EditorColorRole bgRole); |
37 | |
38 | protected: |
39 | void applyFormat(int offset, int length, const Format &format) override; |
40 | |
41 | private: |
42 | Q_DECLARE_PRIVATE(HtmlHighlighter) |
43 | }; |
44 | } |
45 | |
46 | #endif // KSYNTAXHIGHLIGHTING_HTMLHIGHLIGHTER_H |
47 | |