KMacroCommand class Reference (kdeui Library)

| # kdeui Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KMacroCommand Class Reference

A Macro Command is a command that holds several sub-commands. More...

`#include <kcommand.h>`

Inheritance diagram for KMacroCommand:

[legend]
Collaboration diagram for KMacroCommand:

[legend]
List of all members.

## Public Member Functions
| KMacroCommand (const QString &name)
| Creates a macro command.
void | addCommand (KCommand *command)
| Appends a command to this macro command.
virtual void | execute ()
| Executes this command, i.e.
virtual void | unexecute ()
| Undoes the execution of this command, i.e.
## Protected Member Functions
virtual void | virtual_hook (int id, void *data)
## Protected Attributes
QPtrList< KCommand > | m_commands

## Detailed Description

A Macro Command is a command that holds several sub-commands.

It will appear as one to the user and in the command history, but it can use the implementation of multiple commands internally.

Definition at line 109 of file kcommand.h.

## Constructor & Destructor Documentation

KMacroCommand::KMacroCommand | ( | const QString & | name | ) |

  | Creates a macro command. You will then need to call addCommand for each subcommand to be added to this macro command. Parameters:
  name | the name of this command, translated, since it will appear in the menus.
Definition at line 33 of file kcommand.cpp. References KStdAccel::name(), and QPtrList< KCommand >::setAutoDelete().

## Member Function Documentation

void KMacroCommand::addCommand | ( | KCommand * | command | ) |

| Appends a command to this macro command. The ownership is transfered to the macro command. Definition at line 38 of file kcommand.cpp. References QPtrList< KCommand >::append().

void KMacroCommand::execute | ( |  | ) | `[virtual]`

| Executes this command, i.e. execute all the sub-commands in the order in which they were added. Implements KCommand. Definition at line 43 of file kcommand.cpp. References QPtrListIterator::current().

void KMacroCommand::unexecute | ( |  | ) | `[virtual]`

| Undoes the execution of this command, i.e. unexecute all the sub-commands in the _reverse_ order to the one in which they were added. Implements KCommand. Definition at line 50 of file kcommand.cpp. References QPtrListIterator::current(), and QPtrListIterator::toLast().

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

- kcommand.h
- kcommand.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:02:35 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001