JX Application Framework
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
JSTUndoTextBase Class Reference

#include <JSTUndoTextBase.h>

Inheritance diagram for JSTUndoTextBase:
[legend]

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
JStyledTextGetText () const
 
void SetFont (JRunArray< JFont > *styles, const JString &name, const JSize size)
 

Detailed Description

Interface for the JSTUndoTextBase class.

Base class to support undoing any operation on a JStyledText object
that starts by deleting some text.

Constructor & Destructor Documentation

◆ JSTUndoTextBase()

JSTUndoTextBase::JSTUndoTextBase ( JStyledText text,
const JStyledText::TextRange range 
)

Saves a snapshot of the specified range, to allow undo.

◆ ~JSTUndoTextBase()

JSTUndoTextBase::~JSTUndoTextBase ( )
override

Member Function Documentation

◆ AppendToSave()

void JSTUndoTextBase::AppendToSave ( const JUtf8Character c,
const JIndex  charIndex 
)
protected

Append the character at index to the save text.

TODO: optimize callers to avoid random access into JST style run array.

◆ PrependToSave()

void JSTUndoTextBase::PrependToSave ( const JUtf8Character c,
const JIndex  charIndex 
)
protected

Prepend the character to the save text.

TODO: optimize callers to avoid random access into JST style run array.

◆ SetFont()

void JSTUndoTextBase::SetFont ( const JString name,
const JSize  size 
)
overridevirtual

Called by JStyledText::SetAllFontNameAndSize().

Reimplemented from JSTUndoBase.

◆ UndoText()

void JSTUndoTextBase::UndoText ( const JStyledText::TextRange  range)
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.


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