aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/textdocumentlayout.h
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2023-01-26 15:19:46 +0100
committerDavid Schulz <david.schulz@qt.io>2023-02-01 10:50:17 +0000
commit4e02fba933684b3f069b0e6a4bbaee1ac164aa15 (patch)
treeb4763ea2ed26649740992199433793c57a492782 /src/plugins/texteditor/textdocumentlayout.h
parente39a79845a623677160ac4e5728dc0c772c278d0 (diff)
TextEditor: add inline suggestions
Change-Id: I8c670a2aee17e461da1e3882d5b642da935b3d7a Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Diffstat (limited to 'src/plugins/texteditor/textdocumentlayout.h')
-rw-r--r--src/plugins/texteditor/textdocumentlayout.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/texteditor/textdocumentlayout.h b/src/plugins/texteditor/textdocumentlayout.h
index ba31398db7..5da2dd8f99 100644
--- a/src/plugins/texteditor/textdocumentlayout.h
+++ b/src/plugins/texteditor/textdocumentlayout.h
@@ -126,6 +126,10 @@ public:
QByteArray expectedRawStringSuffix() { return m_expectedRawStringSuffix; }
void setExpectedRawStringSuffix(const QByteArray &suffix) { m_expectedRawStringSuffix = suffix; }
+ void setReplacement(const QString replacement);
+ void clearReplacement() { m_replacement.reset(); }
+ QTextDocument *replacement() const { return m_replacement.get(); }
+
private:
TextMarks m_marks;
int m_foldingIndent : 16;
@@ -139,6 +143,7 @@ private:
CodeFormatterData *m_codeFormatterData;
KSyntaxHighlighting::State m_syntaxState;
QByteArray m_expectedRawStringSuffix; // A bit C++-specific, but let's be pragmatic.
+ std::unique_ptr<QTextDocument> m_replacement;
};
@@ -172,6 +177,8 @@ public:
static void setFolded(const QTextBlock &block, bool folded);
static void setExpectedRawStringSuffix(const QTextBlock &block, const QByteArray &suffix);
static QByteArray expectedRawStringSuffix(const QTextBlock &block);
+ static void updateReplacmentFormats(const QTextBlock &block, const FontSettings &fontSettings);
+ static QString replacement(const QTextBlock &block);
class TEXTEDITOR_EXPORT FoldValidator
{