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

Move the caret / and selection commands. More...

#include <selectionchange.h>

+ Inheritance diagram for edbee::SelectionChange:
+ Collaboration diagram for edbee::SelectionChange:

Public Member Functions

 SelectionChange (TextEditorController *controller)
 The selection selection change constructor. More...
 
virtual ~SelectionChange ()
 destructs the textrange More...
 
virtual void giveTextRangeSet (TextRangeSet *rangeSet)
 Gives the textrange to the textchange. More...
 
virtual TextRangeSettakeRangeSet ()
 Takes ownership of the rangeset and clears the clearset. More...
 
virtual void execute (TextDocument *document)
 Executes the textchange. More...
 
virtual void revert (TextDocument *document)
 Reverts the selection change. More...
 
virtual bool giveAndMerge (TextDocument *document, Change *textChange)
 This method tries to merge the given change with the other change The textChange supplied with this method. Should NOT have been executed yet. It's the choice of this merge operation if the execution is required. More...
 
TextRangeSetrangeSet ()
 
virtual QString toString ()
 Convert this change to a string. More...
 
- Public Member Functions inherited from edbee::ControllerChange
 ControllerChange (TextEditorController *controller)
 A controller specific textcommand. Warning you should NOT modify the textdocument! 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. More...
 
virtual TextEditorControllercontroller ()
 returns the controller 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...
 
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...
 

Protected Member Functions

void notifyChange ()
 This method is called internally for notifying the control the selection has been changed Perhaps we should make e proper emit-signal for this purpose. More...
 

Detailed Description

Move the caret / and selection commands.

Constructor & Destructor Documentation

◆ SelectionChange()

edbee::SelectionChange::SelectionChange ( TextEditorController controller)

The selection selection change constructor.

Parameters
controllerthe crontroler this selection change is for

◆ ~SelectionChange()

edbee::SelectionChange::~SelectionChange ( )
virtual

destructs the textrange

Member Function Documentation

◆ execute()

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

Executes the textchange.

Parameters
documentthe textdocument to execute this change for

Implements edbee::Change.

◆ giveAndMerge()

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

This method tries to merge the given change with the other change The textChange supplied with this method. Should NOT have been executed yet. It's the choice of this merge operation if the execution is required.

Reimplemented from edbee::Change.

◆ giveTextRangeSet()

void edbee::SelectionChange::giveTextRangeSet ( TextRangeSet rangeSet)
virtual

Gives the textrange to the textchange.

◆ notifyChange()

void edbee::SelectionChange::notifyChange ( )
protected

This method is called internally for notifying the control the selection has been changed Perhaps we should make e proper emit-signal for this purpose.

Todo:
: make the controllerContext only repaint the affected areas via the TextRangeSets

◆ rangeSet()

TextRangeSet* edbee::SelectionChange::rangeSet ( )
inline

◆ revert()

void edbee::SelectionChange::revert ( TextDocument document)
virtual

Reverts the selection change.

Parameters
documentthe textdocument to revert this change for

Reimplemented from edbee::Change.

◆ takeRangeSet()

TextRangeSet * edbee::SelectionChange::takeRangeSet ( )
virtual

Takes ownership of the rangeset and clears the clearset.

Returns
the rangeset

◆ toString()

QString edbee::SelectionChange::toString ( )
virtual

Convert this change to a string.

Implements edbee::Change.


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