1
#------------------------------------------------------------------------------
2
# Copyright (c) 2008, Riverbank Computing Limited
5
# This software is provided without warranty under the terms of the BSD
6
# license included in enthought/LICENSE.txt and may be redistributed only
7
# under the conditions described in the aforementioned license. The license
8
# is also available online at http://www.enthought.com/licenses/BSD.txt
9
# Thanks for using Enthought open source!
11
# Author: Riverbank Computing Limited
12
# Description: <Enthought undo package component>
13
#------------------------------------------------------------------------------
16
# Enthought library imports.
17
from traits.api import Bool, Event, Instance, Int, Interface, Unicode
20
class IUndoManager(Interface):
21
""" The undo manager interface. An undo manager is responsible for one or
22
more command stacks. Typically an application would have a single undo
26
#### 'IUndoManager' interface #############################################
28
# This is the currently active command stack and may be None. Typically it
29
# is set when some sort of editor becomes active.
30
active_stack = Instance('apptools.undo.api.ICommandStack')
32
# This reflects the clean state of the currently active command stack. It
33
# is intended to support a "document modified" indicator in the GUI. It is
34
# maintained by the undo manager.
35
active_stack_clean = Bool
37
# This is the name of the command that can be redone. It will be empty if
38
# there is no command that can be redone. It is maintained by the undo
42
# This is the sequence number of the next command to be performed. It is
43
# incremented immediately before a command is invoked (by its 'do()'
47
# This event is fired when the index of a command stack changes. Note that
48
# it may not be the active stack.
49
stack_updated = Event(Instance('apptools.undo.api.ICommandStack'))
51
# This is the name of the command that can be undone. It will be empty if
52
# there is no command that can be undone. It is maintained by the undo
56
###########################################################################
57
# 'IUndoManager' interface.
58
###########################################################################
61
""" Redo the last undone command of the active command stack. """
64
""" Undo the last command of the active command stack. """