richard@brainstorm.co.uk
)Version: 1.13
Date: 2003/07/27 08:59:08
Copyright: (C) 1998 Free Software Foundation, Inc.
- Declared in:
- Foundation/NSUndoManager.h
Standards:
- MacOS-X
- OpenStep
- GNUstep
Description forthcoming.
Method summaryStarts a new grouping of undo actions which can be atomically undone by an [-undo] invovation. This method posts an NSUndoManagerCheckpointNotification unless an undo is currently in progress. It posts an NSUndoManagerDidOpenUndoGroupNotification upon creating the grouping.
Returns whether the receiver can service redo requests and posts a NSUndoManagerCheckpointNotification.
Returns whether the receiver has any action groupings on the stack to undo. It does not imply, that the receiver is currently in a state to service an undo request. Make sure [-endUndoGrouping] is invoked before requesting either an [-undo] or an -undoNestedGroup .
Disables the registration of operations with with either [-registerUndoWithTarget:selector:object:] or -forwardInvocation: . This method may be called multiple times. Each will need to be paired to a call of [-enableUndoRegistration] before registration is actually reenabled.
Matches previous calls of to -disableUndoRegistration . Only call this method to that end. Once all are matched, the registration of [-registerUndoWithTarget:selector:object:] and [-forwardInvocation:] are reenabled. If this method is called without a matching -disableUndoRegistration , it will raise an NSInternalInconsistencyException.
Matches previous calls of to [-beginUndoGrouping] and puts the group on the undo stack. This method posts an NSUndoManagerCheckpointNotification and a NSUndoManagerWillCloseUndoGroupNotification. If there was no matching call to -beginUndoGrouping , this method will raise an NSInternalInconsistencyException.
Registers the invocation with the current undo
grouping. This method is part of the
NSInvocation-based undo registration as
opposed to the simpler
[-registerUndoWithTarget:selector:object:]
technique.
You generally never invoke this method directly. Instead invoke [-prepareWithInvocationTarget:]
with the target of the undo action and then invoke the targets method to undo the action on the return value of -prepareWithInvocationTarget:
which actually is the undo manager. The runtime will then fallback to -forwardInvocation:
to do the actual registration of the invocation. The invocation will added to the current grouping.
If the registrations have been disabled through -disableUndoRegistration
, this method does nothing.
Unless the reciever implicitly groups operations by event, the this method must have been preceeded with a [-beginUndoGrouping]
message. Otherwise it will raise an NSInternalInconsistencyException.
Unless this method is invoked as part of a [-undo]
or [-undoNestedGroup]
processing, the redo stack is cleared.
If the reciever [-groupsByEvent]
and this is the first call to this method since the last run loop processing, this method sets up the reciever to process the [-endUndoGrouping]
at the end of the event loop.
Returns the current number of groupings. These are the current groupings which can be nested, not the number of of groups on either the undo or redo stack.
Returns whether the receiver currently groups undo operations by events. When it does, so it implicitly invokes [-beginUndoGrouping] upon registration of undo operations and registers an internal call to insure the invocation of [-endUndoGrouping] at the end of the run loop.
Returns whether the receiver is currently processing a redo.
Returns whether the receiver will currently register undo operations.
Returns whether the receiver is currently processing an undo.
Returns the maximium number of undo groupings the reciever will maintain. The default value is 0 meaning the number is only limited by memory availability.
Prepares the receiver to registers an
invocation-based undo operation. This
method is part of the NSInvocation-based undo
registration as opposed to the simpler
[-registerUndoWithTarget:selector:object:]
technique.
You invoke this method with the target of the undo action and then invoke the targets method to undo the action on the return value of this invocation which actually is the undo manager. The runtime will then fallback to [-forwardInvocation:]
to do the actual registration of the invocation.
Performs a redo of previous undo request by taking
the top grouping from the redo stack and invoking them.
This method posts an
NSUndoManagerCheckpointNotification
notification to allow the client to porcess
any pending changes before proceding. If there are
groupings on the redo stack, the top object is
poped of the stack and invoked within a nested
-beginUndoGrouping
/[-endUndoGrouping]. During this
pocessing, the operations registered for undo
are recorded on the undo stack again.
If the receiver can preform a redo, this method returns
the action name previously associated with the top
grouping with
-setActionName:
. This name should identify the action to be redone. If
there are no items on the redo stack this method
returns nil
. If no action name hs been
set, this method returns an empty string.
Returns the full localized title of the actions to be displayed as a menu item. This method first invokes [-redoActionName] and passes it to [-redoMenuTitleForUndoActionName:] and returns the result.
Returns the localized title of the actions to be displayed as a menu item identified by actionName, by appending a localized command string like @"Redo <localized( actionName)>".
Registers an undo operation. This method is the
simple target-action-based undo registration as
opposed to the sophisticated
[-forwardInvocation:]
mechanism.
You invoke this method with
the target of the undo action providing the
selector which can perform the undo with the
provided object. The object is often a dictionary
of the identifying the attribute and thier values before
the change. The invocation will added to the current
grouping.
If the registrations have been
disabled through
-disableUndoRegistration
, this method does nothing.
Unless the reciever
implicitly groups operations by event, the this
method must have been preceeded with a
[-beginUndoGrouping]
message. Otherwise it will raise an
NSInternalInconsistencyException.
Unless this method is invoked as part of a
[-undo]
or
[-undoNestedGroup]
processing, the redo stack is cleared.
If the reciever
[-groupsByEvent]
and this is the first call to this method since the
last run loop processing, this method sets up the
reciever to process the
[-endUndoGrouping]
at the end of the event loop.
Removes all grouping stored in the receiver. This clears the both the undo and the redo stacks. This method is if the sole client of the undo manager will be unable to service any undo or redo events. The client can call this method in its -dealloc method, unless the undo manager has several clients, in which case [-removeAllActionsWithTarget:] is more apropriate.
Removes all actions recorded for the given target. This method is is useful when a client of the undo manager will be unable to service any undo or redo events. Clients should call this method in thier dealloc method, unless they are the sole client of the undo manager in which case [-removeAllActions] is more apropriate.
Returns the run loop modes in which the receiver registers the [-endUndoGrouping] processing when it -groupsByEvent .
Sets the name associated with the actions of the current group. Typically you can call this method while registering the actions for the current group. This name will be used to determine the name in the [-undoMenuTitleForUndoActionName:] and [-redoMenuTitleForUndoActionName:] names typically displayed in the menu.
Sets whether the receiver should implicitly call [-beginUndoGrouping] when necessary and register a call to invoke [-endUndoGrouping] at the end of the current event loop. The grouping is tunred on by default.
Sets the maximum number of groups in either the undo or redo stack. Use this method to limit memory usage if you either expect very many actions to be recorded or the recorded objects require a lot of memory. When set to 0 the stack size is limited by the range of a unsigned int, available memory.
Sets the modes in which the reciever registers the calls with the current run loop to invoke [-endUndoGrouping] when it -groupsByEvent . This method first cancels any pending registrations in the old modes and registers the invokation in the new modes.
This method performs an undo by invoking -undoNestedGroup . If current group of the reciever is the top group this method first calls -endUndoGrouping . This method may only be called on the top level group, otherwise it will raise an NSInternalInconsistencyException.
If the receiver can preform an undo, this method returns
the action name previously associated with the top
grouping with
-setActionName:
. This name should identify the action to be undone. If
there are no items on the undo stack this method
returns nil
. If no action name hs been
set, this method returns an empty string.
Returns the full localized title of the actions to be displayed as a menu item. This method first invokes [-undoActionName] and passes it to [-undoMenuTitleForUndoActionName:] and returns the result.
Returns the localized title of the actions to be displayed as a menu item identified by actionName, by appending a localized command string like @"Undo <localized( actionName)>".
Performs an undo by taking the top grouping from
the undo stack and invoking them. This method posts an
NSUndoManagerCheckpointNotification
notification to allow the client to porcess
any pending changes before proceding. If there are
groupings on the undo stack, the top object is
poped of the stack and invoked within a nested
beginUndoGrouping/endUndoGrouping.
During this pocessing, the undo operations
registered for undo are recorded on the redo
stack.