|
JX Application Framework
|
#include <JSTUndoTextBase.h>
Public Member Functions | |
| JSTUndoTextBase (JStyledText *text, const JStyledText::TextRange &range) | |
| ~JSTUndoTextBase () override | |
| void | SetFont (const JString &name, const JSize size) override |
Public Member Functions inherited from JSTUndoBase | |
| JSTUndoBase (JStyledText *text) | |
| ~JSTUndoBase () override | |
| virtual void | SetCount (const JStyledText::TextCount &count) |
Public Member Functions inherited from JUndo | |
| JUndo () | |
| virtual | ~JUndo () |
| virtual void | Undo ()=0 |
| bool | IsActive () const |
| void | Activate () |
| void | Deactivate () |
| bool | IsRedo () const |
| void | SetRedo (const bool isRedo) |
Protected Member Functions | |
| void | UndoText (const JStyledText::TextRange range) |
| void | PrependToSave (const JUtf8Character &c, const JIndex charIndex) |
| void | AppendToSave (const JUtf8Character &c, const JIndex charIndex) |
Protected Member Functions inherited from JSTUndoBase | |
| JStyledText * | GetText () const |
| void | SetFont (JRunArray< JFont > *styles, const JString &name, const JSize size) |
Interface for the JSTUndoTextBase class.
Base class to support undoing any operation on a JStyledText object that starts by deleting some text.
| JSTUndoTextBase::JSTUndoTextBase | ( | JStyledText * | text, |
| const JStyledText::TextRange & | range | ||
| ) |
Saves a snapshot of the specified range, to allow undo.
|
override |
|
protected |
Append the character at index to the save text.
TODO: optimize callers to avoid random access into JST style run array.
|
protected |
Prepend the character to the save text.
TODO: optimize callers to avoid random access into JST style run array.
Called by JStyledText::SetAllFontNameAndSize().
Reimplemented from JSTUndoBase.
|
protected |
Call this to put back the original text.
Does NOT take a reference because that might be an instance variable, and we are deleted part way through.