QtNovelUI/WordsIDE/keywordshightlighter.h

43 lines
882 B
C
Raw Normal View History

2022-11-17 08:26:05 +00:00
#ifndef WORDSHIGHTLIGHTER_H
#define WORDSHIGHTLIGHTER_H
#include <QObject>
#include <QSyntaxHighlighter>
#include <libParse.h>
2023-02-26 16:22:44 +00:00
namespace Core {
class AppCore;
}
2022-11-17 08:26:05 +00:00
namespace Enhancement {
2023-02-26 16:22:44 +00:00
class HighlightDemand
{
public:
virtual ~HighlightDemand() = default;
virtual void contexBind(Core::AppCore *app, Parse::Result::DocCore *core) = 0;
virtual void reHighlighter() const = 0;
};
2022-11-17 08:26:05 +00:00
/**
* @brief
*/
2022-11-18 05:43:27 +00:00
class KeywordsHightlighter : public QSyntaxHighlighter
2022-11-17 08:26:05 +00:00
{
public:
2022-11-18 05:43:27 +00:00
KeywordsHightlighter(QObject *parent = nullptr);
2023-02-26 16:22:44 +00:00
2022-11-17 08:26:05 +00:00
void reset(Parse::Result::DocCore *base);
private:
Parse::Result::DocCore *parse_core;
// QSyntaxHighlighter interface
protected:
virtual void highlightBlock(const QString &text) override;
};
}
#endif // WORDSHIGHTLIGHTER_H