edbee - Qt Editor Library
Public Member Functions | List of all members
edbee::LineDataListChange Class Reference

A full line data text change. This means the growing or shrinking of the line data buffer It stores the old-data list that needs to be remebered for undoing. More...

#include <linedatalistchange.h>

+ Inheritance diagram for edbee::LineDataListChange:
+ Collaboration diagram for edbee::LineDataListChange:

Public Member Functions

 LineDataListChange (TextLineDataManager *manager, int offset, int lenght, int newLength)
 The line data text change constructor. More...
 
virtual ~LineDataListChange ()
 Destructs the linedata textchange. More...
 
virtual void execute (TextDocument *document)
 Executes the line data changes. More...
 
virtual void revert (TextDocument *doc)
 Reverts the line data change. More...
 
virtual void mergeStoredData (AbstractRangedChange *change)
 This method merges the old data with the new data change the data to merge with. More...
 
virtual bool giveAndMerge (TextDocument *document, Change *textChange)
 Merges mutliple textline changes together. More...
 
virtual QString toString ()
 Converts this change to a string. More...
 
int offset () const
 Returns the line. More...
 
void setOffset (int value)
 Sets the new offset. More...
 
virtual int docLength () const
 Retursn the length in the document/data. More...
 
void setDocLength (int value)
 This method sets the old length. More...
 
virtual int storedLength () const
 The lengt of the content in this object. More...
 
TextLineDataList ** oldListList ()
 returns the old list list More...
 
int oldListListLength ()
 retursn the length of th eold list list More...
 
- Public Member Functions inherited from edbee::AbstractRangedChange
virtual ~AbstractRangedChange ()
 default destructor is empty More...
 
void addOffset (int amount)
 Adds the given amount to the offset. More...
 
bool isOverlappedBy (AbstractRangedChange *secondChange)
 This method checks if this textchange is overlapped by the second text change overlapping is an exclusive overlap, which means the changes are really on top of eachother to test if the changes are touching use isTouchedBy. More...
 
bool isTouchedBy (AbstractRangedChange *secondChange)
 Touched ranges are ranges that are next to eachother Touching means the end offset of one range is the start offset of the other range. More...
 
- Public Member Functions inherited from edbee::Change
virtual ~Change ()
 a virtual empty destructor More...
 
virtual bool canUndo ()
 This method should return true if the change can be reverted. More...
 
virtual bool isPersistenceRequired ()
 This flag is used to mark this stack item as non-persistence requirable The default behaviour is that every textchange requires persistence. It is also possible to have certain changes that do not require persitence but should be placed on the undo stack. More...
 
virtual TextEditorControllercontrollerContext ()
 A text command can belong to a controller/view When it's a view only command. The undo only applies only to this view warning a DOCUMENT change may NEVER return a controllerContext!! More...
 
bool isDocumentChange ()
 this method can be used to check if the given change is a document change More...
 
virtual bool isGroup ()
 This method returns true if this change is a group change. When an object is group change it should be inherited by TextChangeGroup. More...
 

Additional Inherited Members

- Protected Member Functions inherited from edbee::AbstractRangedChange
int getMergedDocLength (AbstractRangedChange *change)
 Calculates the merged length. More...
 
int getMergedStoredLength (AbstractRangedChange *change)
 Calculates the merge data size, that's required for merging the given change. More...
 
void mergeStoredDataViaMemcopy (void *targetData, void *data, void *changeData, AbstractRangedChange *change, int itemSize)
 This method merges the data via a memcopy. I really don't like this way of merging the data. though this is a way which support all kinds of arrays. I cannot use inheritance, because the types like QString don't have a common ancestor. More...
 
bool merge (AbstractRangedChange *change)
 This method merges the change. More...
 

Detailed Description

A full line data text change. This means the growing or shrinking of the line data buffer It stores the old-data list that needs to be remebered for undoing.

Constructor & Destructor Documentation

◆ LineDataListChange()

edbee::LineDataListChange::LineDataListChange ( TextLineDataManager manager,
int  line,
int  length,
int  newLength 
)

The line data text change constructor.

Parameters
mangerthe line data manager
linethe starting line of the change
lengththe number of lines affected
newLengththe new number of lines

◆ ~LineDataListChange()

edbee::LineDataListChange::~LineDataListChange ( )
virtual

Destructs the linedata textchange.

Member Function Documentation

◆ docLength()

int edbee::LineDataListChange::docLength ( ) const
virtual

Retursn the length in the document/data.

Implements edbee::AbstractRangedChange.

◆ execute()

void edbee::LineDataListChange::execute ( TextDocument document)
virtual

Executes the line data changes.

Parameters
documentthe document to execute the change for

new X[]() => fills it with zero's

Implements edbee::Change.

◆ giveAndMerge()

bool edbee::LineDataListChange::giveAndMerge ( TextDocument document,
Change textChange 
)
virtual

Merges mutliple textline changes together.

Parameters
documentthe document the changes are fior
textChangethe other textchange
Returns
true if the merge succeed, false if not

Reimplemented from edbee::Change.

◆ mergeStoredData()

void edbee::LineDataListChange::mergeStoredData ( AbstractRangedChange change)
virtual

This method merges the old data with the new data change the data to merge with.

Todo:
: Know how and what to delete

Implements edbee::AbstractRangedChange.

◆ offset()

int edbee::LineDataListChange::offset ( ) const
virtual

Returns the line.

Implements edbee::AbstractRangedChange.

◆ oldListList()

TextLineDataList ** edbee::LineDataListChange::oldListList ( )

returns the old list list

◆ oldListListLength()

int edbee::LineDataListChange::oldListListLength ( )

retursn the length of th eold list list

◆ revert()

void edbee::LineDataListChange::revert ( TextDocument doc)
virtual

Reverts the line data change.

Parameters
docthe document to execute the change for

Reimplemented from edbee::Change.

◆ setDocLength()

void edbee::LineDataListChange::setDocLength ( int  value)
virtual

This method sets the old length.

Parameters
valuethe new old-length value

Implements edbee::AbstractRangedChange.

◆ setOffset()

void edbee::LineDataListChange::setOffset ( int  value)
virtual

Sets the new offset.

Implements edbee::AbstractRangedChange.

◆ storedLength()

int edbee::LineDataListChange::storedLength ( ) const
virtual

The lengt of the content in this object.

Implements edbee::AbstractRangedChange.

◆ toString()

QString edbee::LineDataListChange::toString ( )
virtual

Converts this change to a string.

Implements edbee::Change.


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