kexi
KFormDesigner::CommandGroup Class Reference
#include <commands.h>
Inheritance diagram for KFormDesigner::CommandGroup:

Detailed Description
A Command Group is a command that holds several subcommands. It will appear as one to the user and in the command history, but it can use the implementation of multiple commands internally. It extends KMacroCommand by providing the list of commands executed. Selected subcommands can be marked as nonexecutable by adding them using addCommand(KCommand *command, bool allowExecute) special method.
Definition at line 321 of file commands.h.
Public Member Functions | |
CommandGroup (const QString &name, WidgetPropertySet *propSet) | |
virtual | ~CommandGroup () |
void | addCommand (KCommand *command, bool allowExecute) |
virtual void | execute () |
virtual void | unexecute () |
virtual QString | name () const |
const QPtrList< KCommand > & | commands () const |
void | resetAllowExecuteFlags () |
virtual void | debug () |
Protected Attributes | |
SubCommands * | m_subCommands |
QPtrDict< char > | m_commandsShouldntBeExecuted |
WidgetPropertySet * | m_propSet |
Member Function Documentation
void CommandGroup::addCommand | ( | KCommand * | command, | |
bool | allowExecute | |||
) |
Like KmacroCommand::addCommand(KCommand*) but if allowExecute is false, command will not be executed as a subcommand when CommandGroup::execute() is called.
This is useful e.g. in KexiFormView::insertAutoFields(), where a number of subcommands of InsertWidgetCommand type and subcommands is groupped using CommandGroup but some of these subcommands are executed before executing CommandGroup::execute().
If allowExecute is true, this method behaves exactly like KmacroCommand::addCommand(KCommand*).
Note that unexecute() doesn't check allowExecute flag: all subcommands will be unexecuted (in reverse order to the one in which they were added).
Definition at line 1543 of file commands.cpp.
const QPtrList< KCommand > & CommandGroup::commands | ( | ) | const |
- Returns:
- a list of all subcommands of this group. Note that if a given subcommand is a group itself, it will not be expanded to subcommands on this list.
Definition at line 1538 of file commands.cpp.
void CommandGroup::execute | ( | ) | [virtual] |
Executes all subcommands added to this group in the same order as they were added. Subcommands added with addCommand(KCommand *command, bool allowExecute) where allowExecute == false, will not be executed.
Definition at line 1553 of file commands.cpp.
void CommandGroup::resetAllowExecuteFlags | ( | ) |
Resets all 'allowExecute' flags that was set in addCommand(). Call this after calling CommandGroup::execute() to ensure that in the future, when REDO is be executed, all subcommands will be executed.
Definition at line 1575 of file commands.cpp.
void CommandGroup::unexecute | ( | ) | [virtual] |
Unexecutes all subcommands added to this group, (in reversed order).
Definition at line 1563 of file commands.cpp.
Member Data Documentation
QPtrDict<char> KFormDesigner::CommandGroup::m_commandsShouldntBeExecuted [protected] |
Used to store pointers to subcommands that shouldn't be executed on CommandGroup::execute().
Definition at line 374 of file commands.h.
The documentation for this class was generated from the following files: