openshot-audio  0.1.4
Public Member Functions | List of all members
TextEditor::InsertAction Class Reference
Inheritance diagram for TextEditor::InsertAction:
UndoableAction

Public Member Functions

 InsertAction (TextEditor &ed, const String &newText, const int insertPos, const Font &newFont, const Colour newColour, const int oldCaret, const int newCaret)
 
bool perform ()
 
bool undo ()
 
int getSizeInUnits ()
 
- Public Member Functions inherited from UndoableAction
virtual ~UndoableAction ()
 
virtual UndoableActioncreateCoalescedAction (UndoableAction *nextAction)
 

Additional Inherited Members

- Protected Member Functions inherited from UndoableAction
 UndoableAction () noexcept
 

Constructor & Destructor Documentation

◆ InsertAction()

TextEditor::InsertAction::InsertAction ( TextEditor ed,
const String newText,
const int  insertPos,
const Font newFont,
const Colour  newColour,
const int  oldCaret,
const int  newCaret 
)
inline

Member Function Documentation

◆ getSizeInUnits()

int TextEditor::InsertAction::getSizeInUnits ( )
inlinevirtual

Returns a value to indicate how much memory this object takes up.

Because the UndoManager keeps a list of UndoableActions, this is used to work out how much space each one will take up, so that the UndoManager can work out how many to keep.

The default value returned here is 10 - units are arbitrary and don't have to be accurate.

See also
UndoManager::getNumberOfUnitsTakenUpByStoredCommands, UndoManager::setMaxNumberOfStoredUnits

Reimplemented from UndoableAction.

◆ perform()

bool TextEditor::InsertAction::perform ( )
inlinevirtual

Overridden by a subclass to perform the action.

This method is called by the UndoManager, and shouldn't be used directly by applications.

Be careful not to make any calls in a perform() method that could call recursively back into the UndoManager::perform() method

Returns
true if the action could be performed.
See also
UndoManager::perform

Implements UndoableAction.

◆ undo()

bool TextEditor::InsertAction::undo ( )
inlinevirtual

Overridden by a subclass to undo the action.

This method is called by the UndoManager, and shouldn't be used directly by applications.

Be careful not to make any calls in an undo() method that could call recursively back into the UndoManager::perform() method

Returns
true if the action could be undone without any errors.
See also
UndoManager::perform

Implements UndoableAction.


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