KDE3Support
k3command.cpp
Go to the documentation of this file.
135 So m_current is the index of the current undo command, m_current+1 the current redo command if any.
360K3UndoRedoAction::K3UndoRedoAction( Type type, KActionCollection* actionCollection, K3CommandHistory* commandHistory )
366 setShortcut( KStandardShortcut::shortcut( type == Undo ? KStandardShortcut::Undo : KStandardShortcut::Redo ) );
373 connect( this->menu(), SIGNAL(triggered(QAction*)), this, SLOT(slotActionTriggered(QAction*)) );
375 connect( d->commandHistory, SIGNAL(commandHistoryChanged()), this, SLOT(slotCommandHistoryChanged()) );
377 actionCollection->addAction(KStandardAction::name(type == Undo ? KStandardAction::Undo : KStandardAction::Redo),
419 const bool enabled = isUndo ? d->commandHistory->isUndoAvailable() : d->commandHistory->isRedoAvailable();
The command history stores a (user) configurable amount of Commands.
Definition: k3command.h:180
void commandHistoryChanged()
Emitted whenever the command history has changed, i.e.
void documentRestored()
Emitted every time we reach the index where you saved the document for the last time.
QList< K3Command * > undoCommands(int maxCommands=0) const
Definition: k3command.cpp:312
QList< K3Command * > redoCommands(int maxCommands=0) const
Definition: k3command.cpp:323
void addCommand(K3Command *command, bool execute=true)
Adds a command to the history.
Definition: k3command.cpp:188
void setRedoLimit(int limit)
Sets the maximum number of items in the redo history.
Definition: k3command.cpp:259
void commandExecuted(K3Command *command)
Emitted every time a command is executed (whether by addCommand, undo or redo).
void setUndoLimit(int limit)
Sets the maximum number of items in the undo history.
Definition: k3command.cpp:252
virtual QString name() const =0
void addCommand(K3Command *command)
Appends a command to this macro command.
Definition: k3command.cpp:88
virtual void virtual_hook(int id, void *data)
Definition: k3command.cpp:442
virtual void virtual_hook(int id, void *data)
Definition: k3command.cpp:439
This type of action is used to show undo or redo actions in the menu or in the toolbars.
Definition: k3command.h:358
K3UndoRedoAction(Type type, KActionCollection *actionCollection, K3CommandHistory *commandHistory)
Definition: k3command.cpp:360
KAction * addAction(const QString &name, const QObject *receiver=0, const char *member=0)
void triggered(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
void setShortcut(const KShortcut &shortcut, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut))
QString i18n(const char *text)
Type
KAction * undo(const QObject *recvr, const char *slot, QObject *parent)
const char * name(StandardAction id)
KAction * redo(const QObject *recvr, const char *slot, QObject *parent)
const KShortcut & shortcut(StandardShortcut id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.