Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/QtGui/qsyntaxhighlighter.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QSYNTAXHIGHLIGHTER_H
0005 #define QSYNTAXHIGHLIGHTER_H
0006 
0007 #include <QtGui/qtguiglobal.h>
0008 
0009 #ifndef QT_NO_SYNTAXHIGHLIGHTER
0010 
0011 #include <QtCore/qobject.h>
0012 #include <QtGui/qtextobject.h>
0013 
0014 QT_BEGIN_NAMESPACE
0015 
0016 
0017 class QTextDocument;
0018 class QSyntaxHighlighterPrivate;
0019 class QTextCharFormat;
0020 class QFont;
0021 class QColor;
0022 class QTextBlockUserData;
0023 
0024 class Q_GUI_EXPORT QSyntaxHighlighter : public QObject
0025 {
0026     Q_OBJECT
0027     Q_DECLARE_PRIVATE(QSyntaxHighlighter)
0028 public:
0029     explicit QSyntaxHighlighter(QObject *parent);
0030     explicit QSyntaxHighlighter(QTextDocument *parent);
0031     ~QSyntaxHighlighter();
0032 
0033     void setDocument(QTextDocument *doc);
0034     QTextDocument *document() const;
0035 
0036 public Q_SLOTS:
0037     void rehighlight();
0038     void rehighlightBlock(const QTextBlock &block);
0039 
0040 protected:
0041     virtual void highlightBlock(const QString &text) = 0;
0042 
0043     void setFormat(int start, int count, const QTextCharFormat &format);
0044     void setFormat(int start, int count, const QColor &color);
0045     void setFormat(int start, int count, const QFont &font);
0046     QTextCharFormat format(int pos) const;
0047 
0048     int previousBlockState() const;
0049     int currentBlockState() const;
0050     void setCurrentBlockState(int newState);
0051 
0052     void setCurrentBlockUserData(QTextBlockUserData *data);
0053     QTextBlockUserData *currentBlockUserData() const;
0054 
0055     QTextBlock currentBlock() const;
0056 
0057 private:
0058     Q_DISABLE_COPY(QSyntaxHighlighter)
0059     Q_PRIVATE_SLOT(d_func(), void _q_reformatBlocks(int from, int charsRemoved, int charsAdded))
0060     Q_PRIVATE_SLOT(d_func(), void _q_delayedRehighlight())
0061 };
0062 
0063 QT_END_NAMESPACE
0064 
0065 #endif // QT_NO_SYNTAXHIGHLIGHTER
0066 
0067 #endif // QSYNTAXHIGHLIGHTER_H