Envision
A visual programming IDE for object-oriented languages
|
Public Member Functions | |
NodeOwningCommand (Node *target, const QString &text, Node *ownedIfDone, Node *ownedIfUndone) | |
virtual | ~NodeOwningCommand () |
virtual Node * | insertedNode () const override |
Returns the node that this command inserted into the tree, or nullptr if no node was inserted. More... | |
virtual Node * | owned () const override |
Returns the node owned by this command or nullptr if no node is owned. More... | |
virtual void | redo () override |
virtual Node * | removedNode () const override |
Returns the node that this command removed from the tree, or nullptr if no node was removed. More... | |
virtual void | undo () override |
Public Member Functions inherited from Model::UndoCommand | |
UndoCommand (Node *target, const QString &text) | |
virtual | ~UndoCommand () |
bool | isUndone () const |
Returns whether the command has been undone since it was applied. More... | |
Node * | target () const |
Private Member Functions | |
void | moveNodes (Node *root, NodeIdMap &source, NodeIdMap &target) |
Private Attributes | |
Node * | ownedIfDone_ {} |
Node * | ownedIfUndone_ {} |
Model::NodeOwningCommand::NodeOwningCommand | ( | Node * | target, |
const QString & | text, | ||
Node * | ownedIfDone, | ||
Node * | ownedIfUndone | ||
) |
|
virtual |
|
overridevirtual |
Returns the node that this command inserted into the tree, or nullptr if no node was inserted.
The default implementaion returns nullptr. Reimplement this in commands that own a node.
Reimplemented from Model::UndoCommand.
|
private |
|
overridevirtual |
Returns the node owned by this command or nullptr if no node is owned.
Nodes which are owned should be deleted by the command when it is deleted.
Reimplemented from Model::UndoCommand.
|
overridevirtual |
Reimplemented from Model::UndoCommand.
Reimplemented in Model::ListRemove, Model::ListPut, Model::ListInsert, and Model::CompositeNodeChangeChild.
|
overridevirtual |
Returns the node that this command removed from the tree, or nullptr if no node was removed.
The default implementaion returns nullptr. Reimplement this in commands that own a node.
Reimplemented from Model::UndoCommand.
|
overridevirtual |
Reimplemented from Model::UndoCommand.
Reimplemented in Model::ListRemove, Model::ListPut, Model::ListInsert, and Model::CompositeNodeChangeChild.
|
private |
|
private |