kspread Library API Documentation

Commands

There is one command class (which will be instantiated) for every unique action. You need to reimplement the execute() and unexecute() methods of KCommand.

Each command is created from the user interface, and then added to the command history (see KSpreadDoc::commandHistory) using KSpreadDoc::addCommand method. Because the command is not immediately executed, you also need to call the execute() method of that command. This is an example of typical use of command:

KCommand* command = new RenameSheetCommand( sheet, name );
doc->addCommand( command );
command->execute();

Then whenever the user triggers an "undo", the corresponding unexecute() method of the command is called by the undo action, thereby reverting the previously executed command. Similar thing happens for the "redo".

Alphabetical list of commands:

See also:
KSpreadDoc::addCommand

KoCommandHistory

KDE Logo
This file is part of the documentation for kspread Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:43:49 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003