edbee - Qt Editor Library
|
An undoable-command-group. More...
#include <change.h>
Public Member Functions | |
ChangeGroup (TextEditorController *controller) | |
default contructor More... | |
virtual | ~ChangeGroup () |
The destructor deletes all added textchanges. More... | |
virtual bool | isGroup () |
A group change is a group change, so this method returns true :) More... | |
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. More... | |
virtual void | groupClosed () |
This method is called if the group is closed and is added to the stack Default implementation is to do nothing. More... | |
virtual void | execute (TextDocument *document) |
executes this command group More... | |
virtual void | revert (TextDocument *document) |
Reverts the command gorup. More... | |
virtual bool | giveAndMerge (TextDocument *document, Change *textChange)=0 |
Gives the change and merges it if possible. This method should return false if the change couldn't be merged. When the method returns true the ownership of the given textchange is transfered to this class. More... | |
virtual void | flatten () |
This method flattens the undo-group by expanding all subgroups to local groups. More... | |
virtual void | giveChange (TextDocument *doc, Change *change)=0 |
virtual Change * | at (int idx)=0 |
virtual Change * | take (int idx)=0 |
virtual int | size ()=0 |
virtual void | clear (bool performDelete=true)=0 |
Change * | last () |
This method returns the last change in the change group. More... | |
Change * | takeLast () |
Takes the ownership of the last element and removes it from the stack. More... | |
int | recursiveSize () |
The total number of items in the list (excluding the group items) More... | |
virtual TextEditorController * | controllerContext () |
if this commandgroup only contains commands for a single controller context Then this context is returned else 0 is returned More... | |
virtual QString | toString () |
Converts this change group 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 TextEditorController * | controller () |
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... | |
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.
|
pure virtual |
Implemented in edbee::MergableChangeGroup.
|
pure virtual |
Implemented 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.
|
pure virtual |
Gives the change and merges it if possible. This method should return false if the change couldn't be merged. When the method returns true the ownership of the given textchange is transfered to this class.
document | the document this change is for |
textChange | the textchange |
Reimplemented from edbee::Change.
Implemented in edbee::MergableChangeGroup.
|
pure virtual |
Implemented 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.
|
pure virtual |
Implemented in edbee::MergableChangeGroup.
|
pure virtual |
Implemented 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.