MyScript Interactive Ink SDK 4.3.0
Public Member Functions | List of all members
myscript::iink::HistoryManager Class Referenceabstract

#include <HistoryManager.h>

Public Member Functions

virtual ~HistoryManager ()=default
 
virtual void undo ()=0
 
virtual void redo ()=0
 
virtual int getUndoRedoStackIndex ()=0
 
virtual int getPossibleUndoCount ()=0
 
virtual int getPossibleRedoCount ()=0
 
virtual String getUndoRedoIdAt (int stackIndex)=0
 
virtual std::vector< ChangesetOperation > getUndoChangesetTo (const String &id)=0
 
virtual std::vector< ChangesetOperation > getRedoChangesetFrom (const String &id)=0
 

Detailed Description

A HistoryManager allows managing changesets for undo/redo. It is associated with an offscreen editor.

Since
3.0

Constructor & Destructor Documentation

◆ ~HistoryManager()

virtual myscript::iink::HistoryManager::~HistoryManager ( )
virtualdefault

Member Function Documentation

◆ undo()

virtual void myscript::iink::HistoryManager::undo ( )
pure virtual

Undo the last changeset on part.

Note
this function will wait for pending gestures recognition.
Exceptions
std::runtime_errorwhen associated editor has been destroyed.
std::runtime_errorwhen undo operations failed.

◆ redo()

virtual void myscript::iink::HistoryManager::redo ( )
pure virtual

Redo the last changeset reverted by undo on part.

Note
this function will wait for pending gestures recognition.
Exceptions
std::runtime_errorwhen associated editor has been destroyed.
std::runtime_errorwhen redo operations failed.

◆ getUndoRedoStackIndex()

virtual int myscript::iink::HistoryManager::getUndoRedoStackIndex ( )
pure virtual

Returns the number of changesets performed on the part, since content part was opened.

Note
this function will wait for pending gestures recognition.
the undo stack is partially purged from time to time to control memory consumption. The number of possible undo changesets at a given time is provided by getPossibleUndoCount(), while the total number of changesets since content part was opened is provided by getUndoStackIndex().
Returns
the number of changesets performed on the part.
Exceptions
std::runtime_errorwhen associated editor has been destroyed.
std::runtime_errorwhen editor is not associated with a part.

◆ getPossibleUndoCount()

virtual int myscript::iink::HistoryManager::getPossibleUndoCount ( )
pure virtual

Returns the number of changesets that can be undone (<= getUndoStackIndex()).

Note
this function will wait for pending gestures recognition.
Returns
the number of changesets that can be undone.
Exceptions
std::runtime_errorwhen associated editor has been destroyed.
std::runtime_errorwhen editor is not associated with a part.

◆ getPossibleRedoCount()

virtual int myscript::iink::HistoryManager::getPossibleRedoCount ( )
pure virtual

Returns the number of changesets that can be redone.

Note
this function will wait for pending gestures recognition.
Returns
the number of changesets that can be redone.
Exceptions
std::runtime_errorwhen associated editor has been destroyed.
std::runtime_errorwhen editor is not associated with a part.

◆ getUndoRedoIdAt()

virtual String myscript::iink::HistoryManager::getUndoRedoIdAt ( int  stackIndex)
pure virtual

Returns the id associated with an undo/redo stack index. Valid stack index values range from (current stack index - possible undo count) to (current stack index + possible redo count - 1).

Note
this function will wait for pending gestures recognition.
Parameters
stackIndexthe index in the undo/redo stack.
Returns
the id associated with the undo/redo stack index.
Exceptions
std::runtime_errorwhen associated editor has been destroyed.
std::runtime_errorwhen editor is not associated with a part.
std::runtime_errorwhen stackIndex is invalid.

◆ getUndoChangesetTo()

virtual std::vector< ChangesetOperation > myscript::iink::HistoryManager::getUndoChangesetTo ( const String &  id)
pure virtual

Returns the changeset corresponding to an undo to the given id.

Parameters
idthe id in the undo/redo stack.
Returns
the changeset if it exists, otherwise empty.
Exceptions
std::runtime_errorwhen associated editor has been destroyed.
std::runtime_errorwhen editor is not associated with a part.

◆ getRedoChangesetFrom()

virtual std::vector< ChangesetOperation > myscript::iink::HistoryManager::getRedoChangesetFrom ( const String &  id)
pure virtual

Returns the changeset corresponding to a redo from the given id.

Parameters
idthe id in the undo/redo stack.
Returns
the changeset if it exists, otherwise empty.
Exceptions
std::runtime_errorwhen associated editor has been destroyed.
std::runtime_errorwhen editor is not associated with a part.

The documentation for this class was generated from the following file: