# {py:mod}`simvx.core.undo` ```{py:module} simvx.core.undo ``` ```{autodoc2-docstring} simvx.core.undo :allowtitles: ``` ## Module Contents ### Classes ````{list-table} :class: autosummary longtable :align: left * - {py:obj}`Command ` - ```{autodoc2-docstring} simvx.core.undo.Command :summary: ``` * - {py:obj}`PropertyCommand ` - ```{autodoc2-docstring} simvx.core.undo.PropertyCommand :summary: ``` * - {py:obj}`CallableCommand ` - ```{autodoc2-docstring} simvx.core.undo.CallableCommand :summary: ``` * - {py:obj}`BatchCommand ` - ```{autodoc2-docstring} simvx.core.undo.BatchCommand :summary: ``` * - {py:obj}`UndoStack ` - ```{autodoc2-docstring} simvx.core.undo.UndoStack :summary: ``` ```` ### API `````{py:class} Command :canonical: simvx.core.undo.Command Bases: {py:obj}`typing.Protocol` ```{autodoc2-docstring} simvx.core.undo.Command ``` ````{py:property} description :canonical: simvx.core.undo.Command.description :type: str ```{autodoc2-docstring} simvx.core.undo.Command.description ``` ```` ````{py:method} execute() -> None :canonical: simvx.core.undo.Command.execute ```{autodoc2-docstring} simvx.core.undo.Command.execute ``` ```` ````{py:method} undo() -> None :canonical: simvx.core.undo.Command.undo ```{autodoc2-docstring} simvx.core.undo.Command.undo ``` ```` ````{py:attribute} __slots__ :canonical: simvx.core.undo.Command.__slots__ :value: > () ```` ````{py:method} __init_subclass__(*args, **kwargs) :canonical: simvx.core.undo.Command.__init_subclass__ :classmethod: ```` ````{py:method} __class_getitem__(item) :canonical: simvx.core.undo.Command.__class_getitem__ :classmethod: ```` ````` `````{py:class} PropertyCommand(obj: typing.Any, attr: str, old_value: typing.Any, new_value: typing.Any, description: str = '') :canonical: simvx.core.undo.PropertyCommand ```{autodoc2-docstring} simvx.core.undo.PropertyCommand ``` ```{rubric} Initialization ``` ```{autodoc2-docstring} simvx.core.undo.PropertyCommand.__init__ ``` ````{py:property} description :canonical: simvx.core.undo.PropertyCommand.description :type: str ```{autodoc2-docstring} simvx.core.undo.PropertyCommand.description ``` ```` ````{py:method} execute() -> None :canonical: simvx.core.undo.PropertyCommand.execute ```{autodoc2-docstring} simvx.core.undo.PropertyCommand.execute ``` ```` ````{py:method} undo() -> None :canonical: simvx.core.undo.PropertyCommand.undo ```{autodoc2-docstring} simvx.core.undo.PropertyCommand.undo ``` ```` ````` `````{py:class} CallableCommand(do_fn: collections.abc.Callable[[], None], undo_fn: collections.abc.Callable[[], None], description: str = '') :canonical: simvx.core.undo.CallableCommand ```{autodoc2-docstring} simvx.core.undo.CallableCommand ``` ```{rubric} Initialization ``` ```{autodoc2-docstring} simvx.core.undo.CallableCommand.__init__ ``` ````{py:property} description :canonical: simvx.core.undo.CallableCommand.description :type: str ```{autodoc2-docstring} simvx.core.undo.CallableCommand.description ``` ```` ````{py:method} execute() -> None :canonical: simvx.core.undo.CallableCommand.execute ```{autodoc2-docstring} simvx.core.undo.CallableCommand.execute ``` ```` ````{py:method} undo() -> None :canonical: simvx.core.undo.CallableCommand.undo ```{autodoc2-docstring} simvx.core.undo.CallableCommand.undo ``` ```` ````` `````{py:class} BatchCommand(commands: collections.abc.Sequence[simvx.core.undo.Command], description: str = '') :canonical: simvx.core.undo.BatchCommand ```{autodoc2-docstring} simvx.core.undo.BatchCommand ``` ```{rubric} Initialization ``` ```{autodoc2-docstring} simvx.core.undo.BatchCommand.__init__ ``` ````{py:property} description :canonical: simvx.core.undo.BatchCommand.description :type: str ```{autodoc2-docstring} simvx.core.undo.BatchCommand.description ``` ```` ````{py:method} execute() -> None :canonical: simvx.core.undo.BatchCommand.execute ```{autodoc2-docstring} simvx.core.undo.BatchCommand.execute ``` ```` ````{py:method} undo() -> None :canonical: simvx.core.undo.BatchCommand.undo ```{autodoc2-docstring} simvx.core.undo.BatchCommand.undo ``` ```` ````` `````{py:class} UndoStack(max_size: int = 100) :canonical: simvx.core.undo.UndoStack ```{autodoc2-docstring} simvx.core.undo.UndoStack ``` ```{rubric} Initialization ``` ```{autodoc2-docstring} simvx.core.undo.UndoStack.__init__ ``` ````{py:method} push(command: simvx.core.undo.Command) -> None :canonical: simvx.core.undo.UndoStack.push ```{autodoc2-docstring} simvx.core.undo.UndoStack.push ``` ```` ````{py:method} undo() -> bool :canonical: simvx.core.undo.UndoStack.undo ```{autodoc2-docstring} simvx.core.undo.UndoStack.undo ``` ```` ````{py:method} redo() -> bool :canonical: simvx.core.undo.UndoStack.redo ```{autodoc2-docstring} simvx.core.undo.UndoStack.redo ``` ```` ````{py:method} clear() -> None :canonical: simvx.core.undo.UndoStack.clear ```{autodoc2-docstring} simvx.core.undo.UndoStack.clear ``` ```` ````{py:property} can_undo :canonical: simvx.core.undo.UndoStack.can_undo :type: bool ```{autodoc2-docstring} simvx.core.undo.UndoStack.can_undo ``` ```` ````{py:property} can_redo :canonical: simvx.core.undo.UndoStack.can_redo :type: bool ```{autodoc2-docstring} simvx.core.undo.UndoStack.can_redo ``` ```` ````{py:property} undo_description :canonical: simvx.core.undo.UndoStack.undo_description :type: str | None ```{autodoc2-docstring} simvx.core.undo.UndoStack.undo_description ``` ```` ````{py:property} redo_description :canonical: simvx.core.undo.UndoStack.redo_description :type: str | None ```{autodoc2-docstring} simvx.core.undo.UndoStack.redo_description ``` ```` ````{py:property} max_size :canonical: simvx.core.undo.UndoStack.max_size :type: int ```{autodoc2-docstring} simvx.core.undo.UndoStack.max_size ``` ```` `````