diff options
Diffstat (limited to 'src/plugins/cpptools/cppqtstyleindenter.h')
-rw-r--r-- | src/plugins/cpptools/cppqtstyleindenter.h | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/plugins/cpptools/cppqtstyleindenter.h b/src/plugins/cpptools/cppqtstyleindenter.h index 05a36c883e..3b8fb07168 100644 --- a/src/plugins/cpptools/cppqtstyleindenter.h +++ b/src/plugins/cpptools/cppqtstyleindenter.h @@ -27,10 +27,9 @@ #include "cpptools_global.h" -#include <texteditor/indenter.h> +#include <texteditor/textindenter.h> -namespace TextEditor -{ +namespace TextEditor { class ICodeStylePreferences; } @@ -38,32 +37,30 @@ namespace CppTools { class CppCodeStyleSettings; class CppCodeStylePreferences; -class CPPTOOLS_EXPORT CppQtStyleIndenter : public TextEditor::Indenter +class CPPTOOLS_EXPORT CppQtStyleIndenter : public TextEditor::TextIndenter { public: - CppQtStyleIndenter(); + explicit CppQtStyleIndenter(QTextDocument *doc); ~CppQtStyleIndenter() override; bool isElectricCharacter(const QChar &ch) const override; - void indentBlock(QTextDocument *doc, - const QTextBlock &block, + void indentBlock(const QTextBlock &block, const QChar &typedChar, const TextEditor::TabSettings &tabSettings) override; - void indent(QTextDocument *doc, - const QTextCursor &cursor, + void indent(const QTextCursor &cursor, const QChar &typedChar, - const TextEditor::TabSettings &tabSettings, - bool autoTriggered = true) override; + const TextEditor::TabSettings &tabSettings) override; void setCodeStylePreferences(TextEditor::ICodeStylePreferences *preferences) override; - void invalidateCache(QTextDocument *doc) override; + void invalidateCache() override; int indentFor(const QTextBlock &block, const TextEditor::TabSettings &tabSettings) override; - TextEditor::IndentationForBlock indentationForBlocks(const QVector<QTextBlock> &blocks, - const TextEditor::TabSettings &tabSettings) override; + TextEditor::IndentationForBlock indentationForBlocks( + const QVector<QTextBlock> &blocks, const TextEditor::TabSettings &tabSettings) override; + private: CppCodeStyleSettings codeStyleSettings() const; CppCodeStylePreferences *m_cppCodeStylePreferences = nullptr; }; -} // CppTools +} // namespace CppTools |