Undoable action for message text edits. More...
#include <message_undo_actions.h>


Public Types | |
| using | ApplyFn = std::function<void(const MessageSnapshot&)> |
Public Member Functions | |
| MessageEditAction (MessageSnapshot before, MessageSnapshot after, ApplyFn apply_fn) | |
| absl::Status | Undo () override |
| absl::Status | Redo () override |
| std::string | Description () const override |
| Human-readable description (e.g., "Paint 12 tiles on map 5") | |
| size_t | MemoryUsage () const override |
| Approximate memory footprint for budget enforcement. | |
Public Member Functions inherited from yaze::editor::UndoAction | |
| virtual | ~UndoAction ()=default |
| virtual bool | CanMergeWith (const UndoAction &) const |
| virtual void | MergeWith (UndoAction &) |
Private Attributes | |
| MessageSnapshot | before_ |
| MessageSnapshot | after_ |
| ApplyFn | apply_fn_ |
Undoable action for message text edits.
Stores before/after MessageSnapshot values and a callback that knows how to apply a snapshot back to the owning MessageEditor. The editor binds the callback at action-creation time via a lambda that calls MessageEditor::ApplySnapshot().
Definition at line 36 of file message_undo_actions.h.
| using yaze::editor::MessageEditAction::ApplyFn = std::function<void(const MessageSnapshot&)> |
Definition at line 38 of file message_undo_actions.h.
|
inline |
Definition at line 40 of file message_undo_actions.h.
|
inlineoverridevirtual |
Implements yaze::editor::UndoAction.
Definition at line 46 of file message_undo_actions.h.
|
inlineoverridevirtual |
Implements yaze::editor::UndoAction.
Definition at line 51 of file message_undo_actions.h.
|
inlineoverridevirtual |
Human-readable description (e.g., "Paint 12 tiles on map 5")
Implements yaze::editor::UndoAction.
Definition at line 56 of file message_undo_actions.h.
References before_, and yaze::editor::MessageSnapshot::message_index.
|
inlineoverridevirtual |
Approximate memory footprint for budget enforcement.
Reimplemented from yaze::editor::UndoAction.
Definition at line 60 of file message_undo_actions.h.
References after_, before_, yaze::editor::MessageData::Data, yaze::editor::MessageSnapshot::message, and yaze::editor::MessageSnapshot::parsed_text.
|
private |
Definition at line 66 of file message_undo_actions.h.
Referenced by Description(), MemoryUsage(), and Undo().
|
private |
Definition at line 67 of file message_undo_actions.h.
Referenced by MemoryUsage(), and Redo().
|
private |
Definition at line 68 of file message_undo_actions.h.