Class Index | File Index

Classes


Class gui.TrivialUndoManager


Defined in: TrivialUndoManager.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
gui.TrivialUndoManager(defaultRules)
Field Summary
Field Attributes Field Name and Description
 
 
<static>  
gui.TrivialUndoManager.signalDocumentRootReplaced
Method Summary
Method Attributes Method Name and Description
<inner>  
Pushes the currentUndoStateTransition into the undoStateTransitions if necessary
<inner>  
<inner>  
executeOperations(stateTransition)
Execute all operations in the supplied state transition
<inner>  
extractCursorStates(undoStateTransitions)
Reduce the provided undo states to just unique AddCursor followed by MoveCursor commands for each still-present cursor.
 
Returns true if there are one or more redo states available
 
Returns true if there are one or more undo states available
 
<inner>  
<inner>  
 
moveBackward(states)
Move backward the desired number of states.
 
moveForward(states)
Move forward the desired number of states.
 
Track the execution of an operation, and add it to the available undo states
 
<inner>  
<inner>  
removeNode(node)
 
setDocument(newDocument)
Set the OdtDocument to operate on
 
 
setPlaybackFunction(playback_func)
Sets the playback function to use to re-execute operations from the undo stack.
 
subscribe(signal, callback)
Subscribe to events related to the undo manager
 
unsubscribe(signal, callback)
Unsubscribe to events related to the undo manager
<inner>  
values(obj)
Converts an object hash into an unordered array of its values
Class Detail
gui.TrivialUndoManager(defaultRules)
Parameters:
{gui.UndoStateRules=} defaultRules
Field Detail
{!boolean} isDocumentModified

setInitialState

<static> gui.TrivialUndoManager.signalDocumentRootReplaced
Method Detail
<inner> completeCurrentUndoState()
Pushes the currentUndoStateTransition into the undoStateTransitions if necessary

<inner> {undefined} emitDocumentModifiedChange(oldModified)
Parameters:
{!boolean} oldModified
Returns:
{undefined}

<inner> {undefined} executeOperations(stateTransition)
Execute all operations in the supplied state transition
Parameters:
{!StateTransition} stateTransition
Returns:
{undefined}

<inner> {!StateTransition} extractCursorStates(undoStateTransitions)
Reduce the provided undo states to just unique AddCursor followed by MoveCursor commands for each still-present cursor. This is used when restoring the original document state at the start of an undo step
Parameters:
{!Array.} undoStateTransitions
Returns:
{!StateTransition}

{boolean} hasRedoStates()
Returns true if there are one or more redo states available
Returns:
{boolean}

{boolean} hasUndoStates()
Returns true if there are one or more undo states available
Returns:
{boolean}

initialize()

<inner> {!boolean} isModified()
Returns:
{!boolean}

<inner> {!StateTransition} mostRecentUndoStateTransition()
Returns:
{!StateTransition}

{!number} moveBackward(states)
Move backward the desired number of states. Will stop when the number of states is reached, or no more undo states are available.
Parameters:
{!number} states
Returns:
{!number} Returns the number of states actually moved

{!number} moveForward(states)
Move forward the desired number of states. Will stop when the number of states is reached, or no more redo states are available.
Parameters:
{!number} states
Returns:
{!number} Returns the number of states actually moved

{undefined} onOperationExecuted(op)
Track the execution of an operation, and add it to the available undo states
Parameters:
{!ops.Operation} op
Returns:
{undefined}

purgeInitialState()

<inner> removeCursors(root)
Parameters:
{!Element} root

<inner> removeNode(node)
Parameters:
{!Node} node

setDocument(newDocument)
Set the OdtDocument to operate on
Parameters:
{!ops.Document} newDocument

{undefined} setDocumentModified(modified)
Parameters:
{!boolean} modified
Returns:
{undefined}

setPlaybackFunction(playback_func)
Sets the playback function to use to re-execute operations from the undo stack.
Parameters:
{!function(!Array.)} playback_func

subscribe(signal, callback)
Subscribe to events related to the undo manager
Parameters:
{!string} signal
{!Function} callback

unsubscribe(signal, callback)
Unsubscribe to events related to the undo manager
Parameters:
{!string} signal
{!Function} callback

<inner> {!Array.} values(obj)
Converts an object hash into an unordered array of its values
Parameters:
{!Object} obj
Returns:
{!Array.}
Documentation generated by JsDoc Toolkit 2.4.0 on Thu Aug 06 2015 04:10:40 GMT+0200 (MESZ)