karbon
VCommandHistory Class Reference
#include <vcommand.h>
Inherits QObject.
Detailed Description
Manages a set of commands.It keeps the commands in a list, commands higher in the list are older than lower commands. All commands in the list can be undone, beginning from the latest command at the end of the list. Undone commands can be redone, beginning at the oldest undone command. That makes it possible to go back and forth to a specific document state.
Definition at line 143 of file vcommand.h.
Public Slots | |
void | undo () |
void | redo () |
void | undo (VCommand *command) |
void | redo (VCommand *command) |
void | undoAllTo (VCommand *command) |
void | redoAllTo (VCommand *command) |
void | documentSaved () |
Signals | |
void | historyCleared () |
void | commandExecuted (VCommand *) |
void | commandExecuted () |
void | commandAdded (VCommand *) |
void | firstCommandRemoved () |
void | lastCommandRemoved () |
void | documentRestored () |
Public Member Functions | |
VCommandHistory (KarbonPart *part) | |
~VCommandHistory () | |
void | clear () |
void | addCommand (VCommand *command, bool execute=true) |
unsigned int | undoLimit () const |
void | setUndoLimit (unsigned int limit) |
unsigned int | redoLimit () const |
void | setRedoLimit (unsigned int limit) |
const QPtrList< VCommand > * | commands () const |
Constructor & Destructor Documentation
VCommandHistory::VCommandHistory | ( | KarbonPart * | part | ) |
Constructs a command history.
- Parameters:
-
part the part the commands are managed for
Definition at line 29 of file vcommand.cc.
VCommandHistory::~VCommandHistory | ( | ) |
Member Function Documentation
void VCommandHistory::clear | ( | ) |
Clears the command history by removing all commands.
Emits the historyCleared signal
Definition at line 45 of file vcommand.cc.
void VCommandHistory::addCommand | ( | VCommand * | command, | |
bool | execute = true | |||
) |
Adds a new command to the history.
- Parameters:
-
command the new command to add execute controls if the new command should be executed
Definition at line 70 of file vcommand.cc.
unsigned int VCommandHistory::undoLimit | ( | ) | const [inline] |
void VCommandHistory::setUndoLimit | ( | unsigned int | limit | ) |
Sets a new undo limit.
The undo limit controls how many commands are stored in the history. If the new limit is lower than the actual history size, the oldest commands are removed unitl the size matches the undo limit.
- Parameters:
-
limit the new undo limit
Definition at line 99 of file vcommand.cc.
unsigned int VCommandHistory::redoLimit | ( | ) | const [inline] |
void VCommandHistory::setRedoLimit | ( | unsigned int | limit | ) |
Sets a new redo limit.
The redo limit controls how many undone commands are stored in history. If the new limit is lower than the actual number of undone commands, the newest commands are removed until the number matches the redo limit.
- Parameters:
-
limit the new redo limit
Definition at line 106 of file vcommand.cc.
const QPtrList<VCommand>* VCommandHistory::commands | ( | ) | const [inline] |
Read only access to the command history list.
- Returns:
- pointer to the list of commands
Definition at line 222 of file vcommand.h.
void VCommandHistory::undo | ( | ) | [slot] |
void VCommandHistory::redo | ( | ) | [slot] |
void VCommandHistory::undo | ( | VCommand * | command | ) | [slot] |
Undoes the specified command.
- Parameters:
-
command the command to undo
Definition at line 177 of file vcommand.cc.
void VCommandHistory::redo | ( | VCommand * | command | ) | [slot] |
Redoes the specified command.
- Parameters:
-
command the command to redo
Definition at line 193 of file vcommand.cc.
void VCommandHistory::undoAllTo | ( | VCommand * | command | ) | [slot] |
Undoes all command up to the specified command.
- Parameters:
-
command the command up to which all later commands should be undone
Definition at line 209 of file vcommand.cc.
void VCommandHistory::redoAllTo | ( | VCommand * | command | ) | [slot] |
Redoes all command up to the specified command.
- Parameters:
-
command the command up to which all former commands should be redone
Definition at line 238 of file vcommand.cc.
void VCommandHistory::documentSaved | ( | ) | [slot] |
Marks the actual document state as saved.
The position within the list corresponding to the actual document state is saved.
Definition at line 267 of file vcommand.cc.
void VCommandHistory::historyCleared | ( | ) | [signal] |
This signal is emitted when the command history gets cleared.
void VCommandHistory::commandExecuted | ( | VCommand * | ) | [signal] |
This signal is emitted when a command is executed.
The executed command is given as the argument.
void VCommandHistory::commandExecuted | ( | ) | [signal] |
This signal is emitted when a command is executed.
void VCommandHistory::commandAdded | ( | VCommand * | ) | [signal] |
This signal is emitted when a command is added to the history.
The added command is given as the argument.
void VCommandHistory::firstCommandRemoved | ( | ) | [signal] |
This signal is emitted when the first (oldest) command is removed.
void VCommandHistory::lastCommandRemoved | ( | ) | [signal] |
This signal is emitted when the last (latest) command is removed.
void VCommandHistory::documentRestored | ( | ) | [signal] |
This signal is emitted when the actual document state matches the last saved one.
Use documentSaved to set the last saved document state.
The documentation for this class was generated from the following files: