CommandGroup Class Reference

A class to return a group of Command objects as one history object to the historystack. More...

Inheritance diagram for CommandGroup:

Command

List of all members.

Public Member Functions

 CommandGroup (ContextItem *parent, const QString &des, bool historable=true)
int prepare_actions ()
int do_action ()
int undo_action ()
void add_command (Command *cmd)


Detailed Description

A class to return a group of Command objects as one history object to the historystack.

Member Function Documentation

int CommandGroup::prepare_actions (  )  [virtual]

Virtual function, needs to be reimplemented for all type of Commands

Use this function to do any kind of calculation or information gathering to be able to perform the actual action in do_action()

Returns:
Return value must != -1 on success, -1 on failure

Reimplemented from Command.

References Command::prepare_actions().

int CommandGroup::do_action (  )  [virtual]

Virtual function, needs to be reimplemented for all type of Commands

This function is called after the action is finished and each time the historystack 'redoes' an action.
Normally the data created in prepare_actions() will be used here to do the actuall action, which most of the case will be one or a few functions calls.

In case of a Single fact type of Command, you should also retrieve
the 'old' state here to be able to restore it in undo_action()

Reimplemented from Command.

References Command::do_action().

int CommandGroup::undo_action (  )  [virtual]

Virtual function, needs to be reimplemented for all type of Commands

This function is called each time the historystack 'undoes' an action,
use prepare_actions(), or in case of a hold type command begin_hold() to
store the old value(s), your command will change in do_action(), and use
those here to restore the old state.

Reimplemented from Command.

References Command::undo_action().


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

Generated on Sun Mar 8 12:44:05 2009 for traverso by  doxygen 1.5.5