diff options
author | Leandro Melo <leandro.melo@nokia.com> | 2010-11-30 14:14:33 +0100 |
---|---|---|
committer | Leandro Melo <leandro.melo@nokia.com> | 2010-12-01 09:07:15 +0100 |
commit | ea8cb4764be669f72472b5f0b056e54f8075e58f (patch) | |
tree | e603b8fe375a06c9eb72c0d22f84c15b9d98a961 /src/plugins/texteditor/indenter.h | |
parent | e117f04fabde000f4c0aae7cc1a82c58da1ba4c3 (diff) | |
download | qt-creator-ea8cb4764be669f72472b5f0b056e54f8075e58f.tar.gz |
Editors: Move auto-completion code out of the editor
This is basically a continuation of the commits which
refactor code out of the base text editor. For instance,
36fa1de4c6a15b2c44736b3491679dd6cfbe27ce and
3a684586fabf103b8e09cef31a18ffae1fd9f0c7.
Also removed the doXXXX() forwarding methods.
Diffstat (limited to 'src/plugins/texteditor/indenter.h')
-rw-r--r-- | src/plugins/texteditor/indenter.h | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/src/plugins/texteditor/indenter.h b/src/plugins/texteditor/indenter.h index 22a95b888e..49e8546e7f 100644 --- a/src/plugins/texteditor/indenter.h +++ b/src/plugins/texteditor/indenter.h @@ -51,32 +51,23 @@ public: virtual ~Indenter(); // Returns true if key triggers an indent. - bool isElectricCharacter(const QChar &ch) const; + virtual bool isElectricCharacter(const QChar &ch) const; + // Indent a text block based on previous line. Default does nothing - void indentBlock(QTextDocument *doc, - const QTextBlock &block, - const QChar &typedChar, - BaseTextEditor *editor); + virtual void indentBlock(QTextDocument *doc, + const QTextBlock &block, + const QChar &typedChar, + BaseTextEditor *editor); + // Indent at cursor. Calls indentBlock for selection or current line. - void indent(QTextDocument *doc, - const QTextCursor &cursor, - const QChar &typedChar, - BaseTextEditor *editor); + virtual void indent(QTextDocument *doc, + const QTextCursor &cursor, + const QChar &typedChar, + BaseTextEditor *editor); + // Reindent at cursor. Selection will be adjusted according to the indentation // change of the first block. - void reindent(QTextDocument *doc, const QTextCursor &cursor, BaseTextEditor *editor); - -private: - virtual bool doIsElectricalCharacter(const QChar &ch) const; - virtual void doIndentBlock(QTextDocument *doc, - const QTextBlock &block, - const QChar &typedChar, - BaseTextEditor *editor); - virtual void doIndent(QTextDocument *doc, - const QTextCursor &cursor, - const QChar &typedChar, - BaseTextEditor *editor); - virtual void doReindent(QTextDocument *doc, const QTextCursor &cursor, BaseTextEditor *editor); + virtual void reindent(QTextDocument *doc, const QTextCursor &cursor, BaseTextEditor *editor); }; } // namespace TextEditor |