edbee - Qt Editor Library
selectionchange.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include "edbee/models/change.h"
9 
10 namespace edbee {
11 
12 class TextDocSelState;
13 class TextEditorController;
14 class TextRangeSet;
15 
18 {
19 public:
20 
22  virtual ~SelectionChange();
23 
24  virtual void giveTextRangeSet( TextRangeSet* rangeSet );
25  virtual TextRangeSet* takeRangeSet();
26 
27  virtual void execute(TextDocument* document);
28  virtual void revert(TextDocument* document);
29 
30  virtual bool giveAndMerge(TextDocument *document, Change* textChange );
31  TextRangeSet* rangeSet() { return rangeSet_; }
32 
33  virtual QString toString();
34 
35 protected:
36  void notifyChange();
37 
38 private:
39 
40  TextRangeSet* rangeSet_;
41 };
42 
43 
44 } // edbee
This is the base and abstract class of a text document A TextDocument is the model part of the editor...
Definition: textdocument.h:40
virtual ~SelectionChange()
destructs the textrange
Definition: selectionchange.cpp:34
virtual QString toString()
Convert this change to a string.
Definition: selectionchange.cpp:107
TextRangeSet * rangeSet()
Definition: selectionchange.h:31
virtual void giveTextRangeSet(TextRangeSet *rangeSet)
Gives the textrange to the textchange.
Definition: selectionchange.cpp:41
void notifyChange()
This method is called internally for notifying the control the selection has been changed Perhaps we ...
Definition: selectionchange.cpp:115
virtual TextRangeSet * takeRangeSet()
Takes ownership of the rangeset and clears the clearset.
Definition: selectionchange.cpp:50
SelectionChange(TextEditorController *controller)
The selection selection change constructor.
Definition: selectionchange.cpp:26
Copyright 2011-2013 - Reliable Bits Software by Blommers IT.
Definition: commentcommand.cpp:22
virtual void execute(TextDocument *document)
Executes the textchange.
Definition: selectionchange.cpp:60
virtual void revert(TextDocument *document)
Reverts the selection change.
Definition: selectionchange.cpp:76
virtual TextEditorController * controller()
returns the controller
Definition: change.cpp:128
A basic change.
Definition: change.h:18
The texteditor works via the controller. The controller is the central point/mediater which maps/cont...
Definition: texteditorcontroller.h:37
The basic textrange class. A simple class of textrange with a simple vector implementation.
Definition: textrange.h:198
A textcontroller command. This can ALSO be a document command.
Definition: change.h:68
Move the caret / and selection commands.
Definition: selectionchange.h:17
virtual bool giveAndMerge(TextDocument *document, Change *textChange)
This method tries to merge the given change with the other change The textChange supplied with this m...
Definition: selectionchange.cpp:93