39 #ifndef PARENMATCHERHIGHLIGHTER_H_
40 #define PARENMATCHERHIGHLIGHTER_H_
42 #include <QtGui/QSyntaxHighlighter>
43 #include <QtCore/QVector>
51 bool operator<(
const ParenInfo &info)
const {
52 return position < info.position;
57 class ParenInfoTextBlockData :
public QTextBlockUserData {
59 QVector<ParenInfo> _parenInfos;
63 ParenInfoTextBlockData();
65 QVector<ParenInfo> parens();
66 void insert(
const ParenInfo &parenInfo);
67 void sortParenInfos();
71 class ParenMatcherHighlighter :
public QSyntaxHighlighter {
73 QVector<char> _leftParensToMatch;
74 QVector<char> _rightParensToMatch;
78 explicit ParenMatcherHighlighter(QTextDocument *parent = 0);
82 void highlightBlock(
const QString &text);