Cadabra
Computer algebra system for field theory problems
Public Member Functions | Private Attributes | List of all members
cadabra::ActionEraseText Class Reference

Description

Remove a text string starting at the indicated position, and with the indicated length, from the indicated cell. This action is assumed to be triggered from a user change to the GUI cells, so will not update the GUI itself, only the underlying DTree. However, the revert method will need to update the GUI representation.

#include <Actions.hh>

Inheritance diagram for cadabra::ActionEraseText:
cadabra::ActionBase

Public Member Functions

 ActionEraseText (DataCell::id_t ref_id, int, int)
 
virtual ~ActionEraseText ()
 
virtual void execute (DocumentThread &, GUIBase &) override
 Perform the action. More...
 
virtual void revert (DocumentThread &, GUIBase &) override
 Revert the change to the DTree document and the GUI. More...
 
- Public Member Functions inherited from cadabra::ActionBase
 ActionBase (DataCell::id_t ref_id)
 
virtual bool undoable () const
 Can this action be undone? More...
 

Private Attributes

DTree::iterator this_cell
 
int from_pos
 
int to_pos
 
std::string removed_text
 

Additional Inherited Members

- Protected Attributes inherited from cadabra::ActionBase
DataCell::id_t ref_id
 
DTree::iterator ref
 

Constructor & Destructor Documentation

◆ ActionEraseText()

ActionEraseText::ActionEraseText ( DataCell::id_t  ref_id,
int  start,
int  end 
)

◆ ~ActionEraseText()

virtual cadabra::ActionEraseText::~ActionEraseText ( )
inlinevirtual

Member Function Documentation

◆ execute()

void ActionEraseText::execute ( DocumentThread cl,
GUIBase  
)
overridevirtual

Perform the action.

This should update both the document tree data structure and the GUI. The latter is updated by calling relevant methods on the GUIBase object passed in.

Reimplemented from cadabra::ActionBase.

◆ revert()

void ActionEraseText::revert ( DocumentThread ,
GUIBase  
)
overridevirtual

Revert the change to the DTree document and the GUI.

Implements cadabra::ActionBase.

Member Data Documentation

◆ from_pos

int cadabra::ActionEraseText::from_pos
private

◆ removed_text

std::string cadabra::ActionEraseText::removed_text
private

◆ this_cell

DTree::iterator cadabra::ActionEraseText::this_cell
private

◆ to_pos

int cadabra::ActionEraseText::to_pos
private

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