File indexing completed on 2024-05-12 15:50:05

0001 /*
0002     SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: MIT
0005 */
0006 
0007 #ifndef KSYNTAXHIGHLIGHTING_HTMLHIGHLIGHTER_H
0008 #define KSYNTAXHIGHLIGHTING_HTMLHIGHLIGHTER_H
0009 
0010 #include "abstracthighlighter.h"
0011 #include "ksyntaxhighlighting_export.h"
0012 
0013 #include <QIODevice>
0014 #include <QString>
0015 
0016 #include <memory>
0017 
0018 namespace KSyntaxHighlighting
0019 {
0020 class HtmlHighlighterPrivate;
0021 
0022 class KSYNTAXHIGHLIGHTING_EXPORT HtmlHighlighter : public AbstractHighlighter
0023 {
0024 public:
0025     HtmlHighlighter();
0026     ~HtmlHighlighter() override;
0027 
0028     void highlightFile(const QString &fileName, const QString &title = QString());
0029     void highlightData(QIODevice *device, const QString &title = QString());
0030 
0031     void setOutputFile(const QString &fileName);
0032     void setOutputFile(FILE *fileHandle);
0033 
0034 protected:
0035     void applyFormat(int offset, int length, const Format &format) override;
0036 
0037 private:
0038     std::unique_ptr<HtmlHighlighterPrivate> d;
0039 };
0040 }
0041 
0042 #endif // KSYNTAXHIGHLIGHTING_HTMLHIGHLIGHTER_H