#ifndef SQLSYNTAXHIGHLIGHTER_H #define SQLSYNTAXHIGHLIGHTER_H #include #include #include #include "util.h" using t_SymbolSet = std::unordered_set; class PgTypeContainer; class SqlSyntaxHighlighter : public QSyntaxHighlighter { Q_OBJECT public: SqlSyntaxHighlighter(QTextDocument *parent = nullptr); ~SqlSyntaxHighlighter(); void setTypes(const PgTypeContainer *types); protected: void highlightBlock(const QString &text) override; private: QTextCharFormat m_keywordFormat; QTextCharFormat m_commentFormat; QTextCharFormat m_quotedStringFormat; QTextCharFormat m_typeFormat; QTextCharFormat m_quotedIdentifierFormat; QTextCharFormat m_parameterFormat; t_SymbolSet m_typeNames; }; #endif // SQLSYNTAXHIGHLIGHTER_H