summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KCommandHistory.java
blob: 0e97f583246bcb62d1a49814c02adde067eb67a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.TQMetaObject;
import org.kde.qt.QtSupport;
import org.kde.qt.TQObject;

/**

 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 {@link KCommandHistorySignals} for signals emitted by KCommandHistory
		@short    The command history stores a (user) configurable amount of  Commands.

*/
public class KCommandHistory extends TQObject  {
	protected KCommandHistory(Class dummy){super((Class) null);}
	public native TQMetaObject metaObject();
	public native String className();
	/**	
		 Creates a command history, to store commands.
		 This constructor doesn't create actions, so you need to call
		 #undo and #redo yourself.
		     		@short    Creates a command history, to store commands.
	*/
	public KCommandHistory() {
		super((Class) null);
		newKCommandHistory();
	}
	private native void newKCommandHistory();
	/**	
		 Creates a command history, to store commands.
		 This also creates an undo and a redo action, in the <code>actionCollection</code>,
		 using the standard names ("edit_undo" and "edit_redo").
			@param withMenus if true, the actions will display a menu when plugged
		 into a toolbar.
			@param actionCollection the parent collection
		     		@short    Creates a command history, to store commands.
	*/
	public KCommandHistory(TDEActionCollection actionCollection, boolean withMenus) {
		super((Class) null);
		newKCommandHistory(actionCollection,withMenus);
	}
	private native void newKCommandHistory(TDEActionCollection actionCollection, boolean withMenus);
	public KCommandHistory(TDEActionCollection actionCollection) {
		super((Class) null);
		newKCommandHistory(actionCollection);
	}
	private native void newKCommandHistory(TDEActionCollection actionCollection);
	/**	
		 Erases all the undo/redo history.
		 Use this when reloading the data, for instance, since this invalidates
		 all the commands.
		     		@short    Erases all the undo/redo history.
	*/
	public native void clear();
	/**	
		 Adds a command to the history. Call this for each <code>command</code> you create.
		 Unless you set <code>execute</code> 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 );
		     		@short    Adds a command to the history.
	*/
	public native void addCommand(KCommand command, boolean execute);
	public native void addCommand(KCommand command);
	/**	
				@return the maximum number of items in the undo history
     
		@short
	*/
	public native int undoLimit();
	/**	
		 Sets the maximum number of items in the undo history.
		     		@short    Sets the maximum number of items in the undo history.
	*/
	public native void setUndoLimit(int limit);
	/**	
				@return the maximum number of items in the redo history
     
		@short
	*/
	public native int redoLimit();
	/**	
		 Sets the maximum number of items in the redo history.
		     		@short    Sets the maximum number of items in the redo history.
	*/
	public native void setRedoLimit(int limit);
	/**	
		 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.
		     		@short    Enable or disable the undo and redo actions.
	*/
	public native void updateActions();
	/**	
		 Undoes the last action.
		 Call this if you don't use the builtin TDEActions.
		     		@short    Undoes the last action.
	*/
	public native void undo();
	/**	
		 Redoes the last undone action.
		 Call this if you don't use the builtin TDEActions.
		     		@short    Redoes the last undone action.
	*/
	public native void redo();
	/**	
		 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.
		     		@short    Remembers when you saved the document.
	*/
	public native void documentSaved();
	protected native void slotUndoAboutToShow();
	protected native void slotUndoActivated(int arg1);
	protected native void slotRedoAboutToShow();
	protected native void slotRedoActivated(int arg1);
	/** Deletes the wrapped C++ instance */
	protected native void finalize() throws InternalError;
	/** Delete the wrapped C++ instance ahead of finalize() */
	public native void dispose();
	/** Has the wrapped C++ instance been deleted? */
	public native boolean isDisposed();
}