This method removes the current transaction (any nested transactions) from the action history.
Signature
void AbortCurrentTransaction () |
Parameters
None.
Returns
None.
Remarks
This method aborts a transaction that is being placed in the undo stack by removing all single actions up to and including the last begin action. If there is a nested transaction in the current transaction, it is entirely removed. This method in turn calls your part's UndoAction method to give your part the opportunity to perform any reverse editing necessary to restore itself to the state it possessed before the transaction began.
Related Methods
This method pushes the action data and its associated part onto the undo stack.
Signature
void AddActionToHistory (ODPart *whichPart, ODActionData *actionData, ODActionType actionType, ODName *undoActionLabel, ODName *redoActionLabel) |
Parameters
kODBeginAction | The first action of a multistep action. |
kODEndAction | The last action of a multistep action. |
kODSingleAction | A single action. |
Returns
None.
Exception Handling
kODErrCannotAddAction | The specified action cannot be added to this undo object; an undo or redo action is in progress. |
kODErrOutOfMemory | There is not enough memory to allocate the action information. |
This method clears the undo and redo stacks.
Signature
void ClearActionHistory (ODRespectMarksChoices respectMarks) |
Parameters
kODDontRespectMarks | The stacks are cleared in their entirety. |
kODRespectMarks | The stacks are cleared only down to the specified marks. Only actions within an action subhistory are cleared. |
Returns
This method clears the redo history.
Signature
void ClearRedoHistory () |
Parameters
None.
Returns
None.
Remarks OpenDoc calls this method. If the redo stack contains a mark indicating an action subhistory, this method clears only that subhistory. Otherwise, it clears the entire redo stack.
This method marks the top of the undo and redo stacks.
Signature
void MarkActionHistory () |
Parameters
None.
Returns
None.
Remarks
The marks are used to indicate the beginning of a new action subhistory in each stack.
Exception Handling
kODErrCannotMarkAction | Failure to start an action subhistory by placing a mark at the beginning of the undo and redo stacks; the undo object was initialized properly. |
This method indicates whether there is anything on the redo stack and returns the information about the action at the top of the redo stack.
Signature
ODBoolean PeekRedoHistory (ODPart **part, ODActionData *actionData, ODActionType *actionType, ODName *actionLabel) |
Parameters
kODBeginAction | The first action of a multistep action. |
kODEndAction | The last action of a multistep action. |
kODSingleAction | A single action. |
Returns
kODTrue | There is something on the redo stack. |
kODFalse | The redo stack is empty or the top of the redo stack contains a mark indicating an action subhistory. |
Remarks
The document shell or container applications call this method to properly set up the redo item. Your part can also call this method, but it is typically unnecessary.
This method indicates whether there is anything on the undo stack and returns information about the action at the top of the undo stack.
Signature
ODBoolean PeekUndoHistory (ODPart **part, ODActionData *actionData, ODActionType *actionType, ODName *actionLabel) |
Parameters
kODBeginAction | The first action of a multistep action. |
kODEndAction | The last action of a multistep action. |
kODSingleAction | A single action. |
Returns
kODTrue | There is something on the undo stack. |
kODFalse | The undo stack is empty or the top of the undo stack contains a mark indicating an action subhistory. |
Remarks
The document shell or container applications call this method to properly set up the undo item. Your part can also call this method, but it is typically unnecessary.
This method is called by the document shell or container application to redo the top action in the redo history.
Signature
void Redo () |
Parameters
None.
Returns
None.
Exception Handling
kODErrEmptyStack | The redo stack is empty or the undo object was not initialized. |
This method may return exceptions returned by the part.
This method is called by the document shell or container application to undo the top action in the undo stack.
Signature
void Undo () |
Parameters
None.
Returns
None.
Exception Handling
kODErrEmptyStack | The undo stack is empty or the undo object was not initialized. |
This method may return exceptions returned by the part.