kdeui Library API Documentation

KCommand Class Reference

The abstract base class for all Commands. More...

#include <kcommand.h>

Inheritance diagram for KCommand:

KNamedCommand KMacroCommand List of all members.

Public Methods

virtual void execute ()=0
 The main method: executes this command.

virtual void unexecute ()=0
 Unexecutes (undo) this command.

virtual QString name () const=0

Protected Methods

 KCommand ()
 Creates a command.


Detailed Description

The abstract base class for all Commands.

Commands are used to store information needed for Undo/Redo functionality...

Definition at line 36 of file kcommand.h.


Constructor & Destructor Documentation

KCommand::KCommand   [inline, protected]
 

Creates a command.

Definition at line 42 of file kcommand.h.


Member Function Documentation

virtual void KCommand::execute   [pure virtual]
 

The main method: executes this command.

Implement here what this command is about, and remember to record any information that will be helpful for unexecute.

Implemented in KMacroCommand.

Referenced by KCommandHistory::addCommand().

virtual void KCommand::unexecute   [pure virtual]
 

Unexecutes (undo) this command.

Implement here the steps to take for undoing the command. If your application uses actions for everything (it should), and if you implement unexecute correctly, the application is in the same state after unexecute as it was before execute. This means, the next call to execute will do the same thing as it did the first time.

Implemented in KMacroCommand.

virtual QString KCommand::name   [pure virtual]
 

Returns:
the name of this command, translated, since it will appear in the menus.

Implemented in KNamedCommand.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:03 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001