org.kde.koala

Class KCommandHistory

public class KCommandHistory extends QObject

The command history stores a (user) configurable amount of Commands. It keeps track of its size and deletes commands if it gets too large. The user can set a maximum undo and a maximum redo limit (e.g. max. 50 undo / 30 redo commands). The KCommandHistory keeps track of the "borders" and deletes commands, if appropriate. It also activates/deactivates the undo/redo actions in the menu and changes the text according to the name of the command. See KCommandHistorySignals for signals emitted by KCommandHistory

UNKNOWN: The command history stores a (user) configurable amount of Commands.

Constructor Summary
protected KCommandHistory(Class dummy)
KCommandHistory()
Creates a command history, to store commands.
KCommandHistory(KActionCollection actionCollection, boolean withMenus)
Creates a command history, to store commands.
KCommandHistory(KActionCollection actionCollection)
Method Summary
voidaddCommand(KCommand command, boolean execute)
Adds a command to the history.
voidaddCommand(KCommand command)
StringclassName()
voidclear()
Erases all the undo/redo history.
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
voiddocumentSaved()
Remembers when you saved the document.
protected voidfinalize()
Deletes the wrapped C++ instance
booleanisDisposed()
Has the wrapped C++ instance been deleted?
QMetaObjectmetaObject()
voidredo()
Redoes the last undone action.
intredoLimit()
voidsetRedoLimit(int limit)
Sets the maximum number of items in the redo history.
voidsetUndoLimit(int limit)
Sets the maximum number of items in the undo history.
protected voidslotRedoAboutToShow()
protected voidslotRedoActivated(int arg1)
protected voidslotUndoAboutToShow()
protected voidslotUndoActivated(int arg1)
voidundo()
Undoes the last action.
intundoLimit()
voidupdateActions()
Enable or disable the undo and redo actions.

Constructor Detail

KCommandHistory

protected KCommandHistory(Class dummy)

KCommandHistory

public KCommandHistory()
Creates a command history, to store commands. This constructor doesn't create actions, so you need to call #undo and #redo yourself.

UNKNOWN: Creates a command history, to store commands.

KCommandHistory

public KCommandHistory(KActionCollection actionCollection, boolean withMenus)
Creates a command history, to store commands. This also creates an undo and a redo action, in the actionCollection, using the standard names ("edit_undo" and "edit_redo").

Parameters: withMenus if true, the actions will display a menu when plugged into a toolbar. actionCollection the parent collection

UNKNOWN: Creates a command history, to store commands.

KCommandHistory

public KCommandHistory(KActionCollection actionCollection)

Method Detail

addCommand

public void addCommand(KCommand command, boolean execute)
Adds a command to the history. Call this for each command you create. Unless you set execute to false, this will also execute the command. This means, most of the application's code will look like MyCommand cmd = new MyCommand(i18n("Capitalized Name"), parameters); m_historyCommand.addCommand( cmd );

UNKNOWN: Adds a command to the history.

addCommand

public void addCommand(KCommand command)

className

public String className()

clear

public void clear()
Erases all the undo/redo history. Use this when reloading the data, for instance, since this invalidates all the commands.

UNKNOWN: Erases all the undo/redo history.

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

documentSaved

public void documentSaved()
Remembers when you saved the document. Call this right after saving the document. As soon as the history reaches the current index again (via some undo/redo operations) it will emit documentRestored If you implemented undo/redo properly the document is the same you saved before.

UNKNOWN: Remembers when you saved the document.

finalize

protected void finalize()
Deletes the wrapped C++ instance

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

metaObject

public QMetaObject metaObject()

redo

public void redo()
Redoes the last undone action. Call this if you don't use the builtin KActions.

UNKNOWN: Redoes the last undone action.

redoLimit

public int redoLimit()

Returns: the maximum number of items in the redo history

UNKNOWN:

setRedoLimit

public void setRedoLimit(int limit)
Sets the maximum number of items in the redo history.

UNKNOWN: Sets the maximum number of items in the redo history.

setUndoLimit

public void setUndoLimit(int limit)
Sets the maximum number of items in the undo history.

UNKNOWN: Sets the maximum number of items in the undo history.

slotRedoAboutToShow

protected void slotRedoAboutToShow()

slotRedoActivated

protected void slotRedoActivated(int arg1)

slotUndoAboutToShow

protected void slotUndoAboutToShow()

slotUndoActivated

protected void slotUndoActivated(int arg1)

undo

public void undo()
Undoes the last action. Call this if you don't use the builtin KActions.

UNKNOWN: Undoes the last action.

undoLimit

public int undoLimit()

Returns: the maximum number of items in the undo history

UNKNOWN:

updateActions

public void updateActions()
Enable or disable the undo and redo actions. This isn't usually necessary, but this method can be useful if you disable all actions (to go to a "readonly" state), and then want to come back to a readwrite mode.

UNKNOWN: Enable or disable the undo and redo actions.