FormIt C++ API v25.0.0 (2025.0.0)
Loading...
Searching...
No Matches
FormIt::UndoManagement API

Description

Classes

class  FormIt::UndoManagement::StateManager
 This class is used to merge into a single state all the WSM deltas created across all histories while the manager object is alive.<! More...
 
class  FormIt::UndoManagement::Suspend
 This suspends all update messages from WSM until either the object is destroyed, or resume is called. More...
 

Functions

FORMIT_CORE_EXPORT void FormIt::UndoManagement::BeginState ()
 Begin an undo state operation.
 
FORMIT_CORE_EXPORT size_t FormIt::UndoManagement::EndState (1::string const &name, const 1::string &userName={})
 End an undo state operation.
 
void FORMIT_CORE_EXPORT FormIt::UndoManagement::RejectState ()
 Reject the current undo state operation.
 
FORMIT_CORE_EXPORT StateID FormIt::UndoManagement::GetCurrentState (HistoryID const &id)
 Get the ID of the current state in a given history.
 
FORMIT_CORE_EXPORT ::vector< HistoryIDFormIt::UndoManagement::GetHistoryIDs ()
 Get the IDs of all histories being managed.
 
FORMIT_CORE_EXPORT ::vector< StateIDFormIt::UndoManagement::GetHistoryStates (HistoryID const &id)
 Get all the states in a given history.
 
FORMIT_CORE_EXPORT StateData FormIt::UndoManagement::GetStateData (StateID const &id)
 Get the data for a given state.
 
FORMIT_CORE_EXPORT ::vector< HistoryIDFormIt::UndoManagement::GetStateHistories (StateID const &id)
 Get the histories affected by a given state.
 
FORMIT_CORE_EXPORT bool FormIt::UndoManagement::SetStateName (StateID const &id, 1::string const &str)
 Set the name for a given state.
 
FORMIT_CORE_EXPORT bool FormIt::UndoManagement::SetLastStateName (1::string const &str)
 Set the name for the most recent state.
 
FORMIT_CORE_EXPORT StateID FormIt::UndoManagement::NoteState (1::string const &name, 1::vector< HistoryID > const &aHistories={})
 Note a state that affects the given histories.
 
FORMIT_CORE_EXPORT bool FormIt::UndoManagement::MergeStates (1::vector< StateID > const &states)
 Merge multiple existing states into a single state.
 
FORMIT_CORE_EXPORT bool FormIt::UndoManagement::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.
 
FORMIT_CORE_EXPORT bool FormIt::UndoManagement::MergeCurrentStates (1::vector< HistoryID > const &histories)
 Merge the current state of multiple existing histories into a single state.
 
FORMIT_CORE_EXPORT bool FormIt::UndoManagement::CanUndo (HistoryID const &id, size_t nStates=1)
 Can undo the given number of steps in the given history?
 
FORMIT_CORE_EXPORT bool FormIt::UndoManagement::CanRedo (HistoryID const &id, size_t nStates=1)
 Can redo the given number of steps in the given history?
 
FORMIT_CORE_EXPORT bool FormIt::UndoManagement::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.
 
FORMIT_CORE_EXPORT bool FormIt::UndoManagement::Redo (HistoryID const &id, size_t nStates=1)
 Redo the given number of steps in the given history.
 
FORMIT_CORE_EXPORT bool FormIt::UndoManagement::CanGlobalUndo ()
 Can undo one step in any history?
 
FORMIT_CORE_EXPORT bool FormIt::UndoManagement::CanGlobalRedo ()
 Can redo one step in any history?
 
FORMIT_CORE_EXPORT bool FormIt::UndoManagement::GlobalUndo (bool bAndDeleteRedo=false)
 Undo the most recent current state in any history and optionally delete redo information when undoing.
 
FORMIT_CORE_EXPORT bool FormIt::UndoManagement::GlobalRedo ()
 Redo to the oldest current state in any history.
 
FORMIT_CORE_EXPORT bool FormIt::UndoManagement::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.
 
FORMIT_CORE_EXPORT void FormIt::UndoManagement::FixStateNamesAndUsersOnJoin ()
 Fixes state names and user names when initially joining collaboration.
 
const size_t FormIt::UndoManagement::UNUSED_INDEX = size_t(-1)
 

Function Documentation

◆ BeginState()

FORMIT_CORE_EXPORT void FormIt::UndoManagement::BeginState ( )

Begin an undo state operation.

◆ CanGlobalRedo()

FORMIT_CORE_EXPORT bool FormIt::UndoManagement::CanGlobalRedo ( )

Can redo one step in any history?

◆ CanGlobalUndo()

FORMIT_CORE_EXPORT bool FormIt::UndoManagement::CanGlobalUndo ( )

Can undo one step in any history?

◆ CanRedo()

FORMIT_CORE_EXPORT bool FormIt::UndoManagement::CanRedo ( HistoryID const &  id,
size_t  nStates = 1 
)

Can redo the given number of steps in the given history?

Parameters
[in]id
[in]nStates

◆ CanUndo()

FORMIT_CORE_EXPORT bool FormIt::UndoManagement::CanUndo ( HistoryID const &  id,
size_t  nStates = 1 
)

Can undo the given number of steps in the given history?

Parameters
[in]id
[in]nStates

◆ EndState()

FORMIT_CORE_EXPORT size_t FormIt::UndoManagement::EndState ( 1::string const &  name,
const 1::string &  userName = {} 
)

End an undo state operation.

Parameters
[in]nameName for the Object
[in]userName

◆ FixStateNamesAndUsersOnJoin()

FORMIT_CORE_EXPORT void FormIt::UndoManagement::FixStateNamesAndUsersOnJoin ( )

Fixes state names and user names when initially joining collaboration.

For now sets the name to "Join collaboration" and the user to "Unknown".

◆ GetCurrentState()

FORMIT_CORE_EXPORT StateID FormIt::UndoManagement::GetCurrentState ( HistoryID const &  id)

Get the ID of the current state in a given history.

Parameters
[in]id

◆ GetHistoryIDs()

FORMIT_CORE_EXPORT ::vector< HistoryID > FormIt::UndoManagement::GetHistoryIDs ( )

Get the IDs of all histories being managed.

◆ GetHistoryStates()

FORMIT_CORE_EXPORT ::vector< StateID > FormIt::UndoManagement::GetHistoryStates ( HistoryID const &  id)

Get all the states in a given history.

Parameters
[in]id

◆ GetStateData()

FORMIT_CORE_EXPORT StateData FormIt::UndoManagement::GetStateData ( StateID const &  id)

Get the data for a given state.

Parameters
[in]id

◆ GetStateHistories()

FORMIT_CORE_EXPORT ::vector< HistoryID > FormIt::UndoManagement::GetStateHistories ( StateID const &  id)

Get the histories affected by a given state.

Parameters
[in]id

◆ GlobalRedo()

FORMIT_CORE_EXPORT bool FormIt::UndoManagement::GlobalRedo ( )

Redo to the oldest current state in any history.

◆ GlobalUndo()

FORMIT_CORE_EXPORT bool FormIt::UndoManagement::GlobalUndo ( bool  bAndDeleteRedo = false)

Undo the most recent current state in any history and optionally delete redo information when undoing.

Parameters
[in]bAndDeleteRedoIf true, the redo information is deleted.

◆ MergeCurrentStates()

FORMIT_CORE_EXPORT bool FormIt::UndoManagement::MergeCurrentStates ( 1::vector< HistoryID > const &  histories)

Merge the current state of multiple existing histories into a single state.

Parameters
[in]histories

◆ MergeStateRange()

FORMIT_CORE_EXPORT bool FormIt::UndoManagement::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.

This is to support an operation like this: StateID idLast = GetCurrentState(history); DoStuffHere(); MergeStates(GetCurrentState(history), idLast); Thus the states in the open range (idLast, idFirst) are merged into idFirst, and subsequently destroyed (the StateID will become invalid).

Parameters
[in]idFirst
[in]idLast

◆ MergeStates()

FORMIT_CORE_EXPORT bool FormIt::UndoManagement::MergeStates ( 1::vector< StateID > const &  states)

Merge multiple existing states into a single state.

All but the last of the listed states will be destroyed (the StateID will become invalid). The range of states must be contiguous, in the order noted. No state being destroyed may be the current state for that history.

Parameters
[in]states

◆ NoteState()

FORMIT_CORE_EXPORT StateID FormIt::UndoManagement::NoteState ( 1::string const &  name,
1::vector< HistoryID > const &  aHistories = {} 
)

Note a state that affects the given histories.

If the histories vector is empty, it affects only the currently edited history.

Parameters
[in]nameName for the Object
[in]aHistories

◆ Redo()

FORMIT_CORE_EXPORT bool FormIt::UndoManagement::Redo ( HistoryID const &  id,
size_t  nStates = 1 
)

Redo the given number of steps in the given history.

Parameters
[in]id
[in]nStates

◆ RejectState()

void FORMIT_CORE_EXPORT FormIt::UndoManagement::RejectState ( )

Reject the current undo state operation.

◆ RollTo()

FORMIT_CORE_EXPORT bool FormIt::UndoManagement::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.

Parameters
[in]nHistoryID
[in]nStateID
[in]bAndDeleteRedoIf true, the redo information is deleted.

◆ SetLastStateName()

FORMIT_CORE_EXPORT bool FormIt::UndoManagement::SetLastStateName ( 1::string const &  str)

Set the name for the most recent state.

Parameters
[in]str

◆ SetStateName()

FORMIT_CORE_EXPORT bool FormIt::UndoManagement::SetStateName ( StateID const &  id,
1::string const &  str 
)

Set the name for a given state.

Parameters
[in]id
[in]str

◆ Undo()

FORMIT_CORE_EXPORT bool FormIt::UndoManagement::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.

Parameters
[in]id
[in]nStates
[in]bAndDeleteRedoIf true, the redo information is deleted.

Variable Documentation

◆ UNUSED_INDEX

const size_t FormIt::UndoManagement::UNUSED_INDEX = size_t(-1)

Used in index values below to indicate an unused value.