Kexi API Documentation (2.0 alpha)

KFormDesigner::CommandGroup Class Reference

#include <commands.h>

Inheritance diagram for KFormDesigner::CommandGroup:

KFormDesigner::Command KCommand List of all members.

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
 Used to store pointers to subcommands that shouldn't be executed on CommandGroup::execute().
WidgetPropertySetm_propSet


Constructor & Destructor Documentation

CommandGroup::CommandGroup const QString name,
WidgetPropertySet propSet
 

Definition at line 1531 of file commands.cpp.

CommandGroup::~CommandGroup  )  [virtual]
 

Definition at line 1538 of file commands.cpp.

References m_subCommands.


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 1548 of file commands.cpp.

References m_commandsShouldntBeExecuted, and m_subCommands.

Referenced by KFormDesigner::WidgetPropertySet::createPropertyCommandsInDesignMode(), and KexiFormView::insertAutoFields().

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 1543 of file commands.cpp.

References m_subCommands.

Referenced by KexiFormManager::slotHistoryCommandExecuted().

void CommandGroup::debug  )  [virtual]
 

Implements KFormDesigner::Command.

Definition at line 1586 of file commands.cpp.

References m_commandsShouldntBeExecuted, m_subCommands, and name().

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 1558 of file commands.cpp.

References m_commandsShouldntBeExecuted, m_propSet, m_subCommands, and KFormDesigner::FormManager::self().

Referenced by KexiFormView::insertAutoFields().

QString CommandGroup::name  )  const [virtual]
 

Definition at line 1575 of file commands.cpp.

References m_subCommands.

Referenced by debug().

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 1580 of file commands.cpp.

References m_commandsShouldntBeExecuted.

Referenced by KexiFormView::insertAutoFields().

void CommandGroup::unexecute  )  [virtual]
 

Unexecutes all subcommands added to this group, (in reversed order).

Definition at line 1568 of file commands.cpp.

References m_propSet, m_subCommands, and KFormDesigner::FormManager::self().


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.

Referenced by addCommand(), debug(), execute(), and resetAllowExecuteFlags().

WidgetPropertySet* KFormDesigner::CommandGroup::m_propSet [protected]
 

Definition at line 375 of file commands.h.

Referenced by execute(), and unexecute().

SubCommands* KFormDesigner::CommandGroup::m_subCommands [protected]
 

Definition at line 370 of file commands.h.

Referenced by addCommand(), commands(), debug(), execute(), name(), unexecute(), and ~CommandGroup().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:50:57 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003