FormIt C++ API  v23.0.0 (2023.0.0)
FormIt::UndoManagement Namespace Reference

Classes

struct  HistoryID
 Simple wrappers to ensure type safety. More...
 
class  JSHistoryID
 JSHistoryID is a helper class for JS APIs to take either a HistoryID or int. More...
 
class  JSStateID
 JSStateID is a helper class for JS APIs to take either a StateID or int. More...
 
struct  StateData
 The observable data of an undo state. More...
 
struct  StateID
 FormIt::UndoManagement::StateID struct. More...
 

Functions

FORMIT_CORE_EXPORT void BeginState ()
 Begin an undo state operation. More...
 
FORMIT_CORE_EXPORT size_t EndState (1::string const &name, const 1::string &userName={})
 End an undo state operation. More...
 
void FORMIT_CORE_EXPORT RejectState ()
 Reject the current undo state operation. More...
 
FORMIT_CORE_EXPORT StateID GetCurrentState (HistoryID const &id)
 Get the ID of the current state in a given history. More...
 
FORMIT_CORE_EXPORT::vector< HistoryIDGetHistoryIDs ()
 Get the IDs of all histories being managed. More...
 
FORMIT_CORE_EXPORT::vector< StateIDGetHistoryStates (HistoryID const &id)
 Get all the states in a given history. More...
 
FORMIT_CORE_EXPORT StateData GetStateData (StateID const &id)
 Get the data for a given state. More...
 
FORMIT_CORE_EXPORT::vector< HistoryIDGetStateHistories (StateID const &id)
 Get the histories affected by a given state. More...
 
FORMIT_CORE_EXPORT bool SetStateName (StateID const &id, 1::string const &str)
 Set the name for a given state. More...
 
FORMIT_CORE_EXPORT bool SetLastStateName (1::string const &str)
 Set the name for the most recent state. More...
 
FORMIT_CORE_EXPORT StateID NoteState (1::string const &name, 1::vector< HistoryID > const &aHistories={})
 Note a state that affects the given histories. More...
 
FORMIT_CORE_EXPORT bool MergeStates (1::vector< StateID > const &states)
 Merge multiple existing states into a single state. More...
 
FORMIT_CORE_EXPORT bool MergeStateRange (StateID idFirst, StateID idLast)
 Merge states in the half-open range [idFirst, idLast), where the states in the range are in reverse order of creation. More...
 
FORMIT_CORE_EXPORT bool MergeCurrentStates (1::vector< HistoryID > const &histories)
 Merge the current state of multiple existing histories into a single state. More...
 
FORMIT_CORE_EXPORT bool CanUndo (HistoryID const &id, size_t nStates=1)
 Can undo the given number of steps in the given history? More...
 
FORMIT_CORE_EXPORT bool CanRedo (HistoryID const &id, size_t nStates=1)
 Can redo the given number of steps in the given history? More...
 
FORMIT_CORE_EXPORT bool Undo (HistoryID const &id, size_t nStates=1, bool bAndDeleteRedo=false)
 Undo the given number of steps in the given history, optionally deleting the undone states afterwards. More...
 
FORMIT_CORE_EXPORT bool Redo (HistoryID const &id, size_t nStates=1)
 Redo the given number of steps in the given history. More...
 
FORMIT_CORE_EXPORT bool CanGlobalUndo ()
 Can undo one step in any history? More...
 
FORMIT_CORE_EXPORT bool CanGlobalRedo ()
 Can redo one step in any history? More...
 
FORMIT_CORE_EXPORT bool GlobalUndo (bool bAndDeleteRedo=false)
 Undo the most recent current state in any history and optionally delete redo information when undoing. More...
 
FORMIT_CORE_EXPORT bool GlobalRedo ()
 Redo to the oldest current state in any history. More...
 
FORMIT_CORE_EXPORT bool RollTo (HistoryID const &nHistoryID, StateID const &nStateID, bool bAndDeleteRedo=false)
 Roll to a given state in the given history, optionally deleting the undone states afterwards when undoing. More...
 
FORMIT_CORE_EXPORT bool IsInRollingMultipleHistories ()
 Returns true during an undo or redo on multiple Histories. More...
 

Variables

const size_t UNUSED_INDEX = size_t(-1)