diff options
Diffstat (limited to 'Userland/Libraries/LibGUI/TextDocument.h')
-rw-r--r-- | Userland/Libraries/LibGUI/TextDocument.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/TextDocument.h b/Userland/Libraries/LibGUI/TextDocument.h index afef884465..48f569cac9 100644 --- a/Userland/Libraries/LibGUI/TextDocument.h +++ b/Userland/Libraries/LibGUI/TextDocument.h @@ -236,4 +236,20 @@ private: TextRange m_range; }; +class ReplaceAllTextCommand : public GUI::TextDocumentUndoCommand { + +public: + ReplaceAllTextCommand(GUI::TextDocument& document, String const& text, GUI::TextRange const& range); + void redo() override; + void undo() override; + bool merge_with(GUI::Command const&) override; + String action_text() const override; + String const& text() const { return m_text; } + TextRange const& range() const { return m_range; } + +private: + String m_text; + GUI::TextRange m_range; +}; + } |