An undoable-command-group. More...
#include <change.h>
Public Member Functions | |
ChangeGroup (TextEditorController *controller) | |
default contructor | |
virtual | ~ChangeGroup () |
The destructor deletes all added textchanges. | |
virtual bool | isGroup () |
A group change is a group change, so this method returns true :) | |
virtual bool | isDiscardable () |
This method is called it the group is discardable. A discardable group will be optimized away if the group is empty, or if there's a single item in the group. A none-discardable group will always remain. | |
virtual void | groupClosed () |
This method is called if the group is closed and is added to the stack Default implementation is to do nothing. | |
virtual void | execute (TextDocument *document) |
executes this command group | |
virtual void | revert (TextDocument *document) |
Reverts the command gorup. | |
virtual bool | giveAndMerge (TextDocument *document, Change *textChange) |
When another group is given, a merge is performed. | |
virtual void | flatten () |
This method flattens the undo-group by expanding all subgroups to local groups. | |
virtual void | giveChange (TextDocument *doc, Change *change) |
virtual Change * | at (int idx) |
virtual Change * | take (int idx) |
virtual int | size () |
virtual void | clear (bool performDelete=true) |
Change * | last () |
This method returns the last change in the change group. | |
Change * | takeLast () |
Takes the ownership of the last element and removes it from the stack. | |
int | recursiveSize () |
The total number of items in the list (excluding the group items) | |
virtual TextEditorController * | controllerContext () |
if this commandgroup only contains commands for a single controller context Then this context is returned else 0 is returned | |
virtual QString | toString () |
Converts this change group to a string. | |
![]() | |
ControllerChange (TextEditorController *controller) | |
A controller specific textcommand. Warning you should NOT modify the textdocument! | |
virtual TextEditorController * | controller () |
returns the controller | |
![]() | |
virtual | ~Change () |
a virtual empty destructor | |
virtual bool | canUndo () |
This method should return true if the change can be reverted. | |
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. | |
bool | isDocumentChange () |
this method can be used to check if the given change is a document change | |
An undoable-command-group.
edbee::ChangeGroup::ChangeGroup | ( | TextEditorController * | controller | ) |
default contructor
controller | the controller this groups belongs to |
|
virtual |
The destructor deletes all added textchanges.
|
virtual |
Reimplemented in edbee::MergableChangeGroup.
|
virtual |
Reimplemented in edbee::MergableChangeGroup.
|
virtual |
if this commandgroup only contains commands for a single controller context Then this context is returned else 0 is returned
0 is always 0!
Reimplemented from edbee::ControllerChange.
|
virtual |
executes this command group
document | the document the document to execute this for |
Implements edbee::Change.
Reimplemented in edbee::MergableChangeGroup.
|
virtual |
This method flattens the undo-group by expanding all subgroups to local groups.
|
virtual |
When another group is given, a merge is performed.
Reimplemented from edbee::Change.
Reimplemented in edbee::MergableChangeGroup.
|
virtual |
Reimplemented in edbee::MergableChangeGroup.
|
virtual |
This method is called if the group is closed and is added to the stack Default implementation is to do nothing.
Reimplemented in edbee::MergableChangeGroup.
|
virtual |
This method is called it the group is discardable. A discardable group will be optimized away if the group is empty, or if there's a single item in the group. A none-discardable group will always remain.
Reimplemented in edbee::MergableChangeGroup.
|
virtual |
A group change is a group change, so this method returns true :)
Reimplemented from edbee::Change.
Change * edbee::ChangeGroup::last | ( | ) |
This method returns the last change in the change group.
int edbee::ChangeGroup::recursiveSize | ( | ) |
The total number of items in the list (excluding the group items)
|
virtual |
Reverts the command gorup.
Reimplemented from edbee::Change.
Reimplemented in edbee::MergableChangeGroup.
|
virtual |
Reimplemented in edbee::MergableChangeGroup.
|
virtual |
Reimplemented in edbee::MergableChangeGroup.
Change * edbee::ChangeGroup::takeLast | ( | ) |
Takes the ownership of the last element and removes it from the stack.
|
virtual |
Converts this change group to a string.
Implements edbee::Change.
Reimplemented in edbee::MergableChangeGroup.