summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KEditToolbar.java
blob: 52149b592eb4d85d2864fb8df1dbe20dfb96ac55 (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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
//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.TQWidget;

/**

 This dialog only works if your application uses the XML UI
 framework for creating menus and toolbars.  It depends on the XML
 files to describe the toolbar layouts and it requires the actions
 to determine which buttons are active.
 Typically, you would include the KStdAction.configureToolbars()
 standard action in your application.  In your slot to this action,
 you would have something like so:
 <pre>
 KEditToolbar dlg(actionCollection());
 if (dlg.exec())
 {
   createGUI();
 }
 </pre>
 That code snippet also takes care of redrawing the menu and
 toolbars if you have made any changes.
 If you are using KMainWindow's settings methods (either save/apply manually
 or autoSaveSettings), you should write something like:
 <pre>
 void MyClass.slotConfigureToolbars()
 {
   saveMainWindowSettings( KGlobal.config(), "MainWindow" );
   KEditToolbar dlg(actionCollection());
   connect(&dlg,SIGNAL("newToolbarConfig()"),this,SLOT("slotNewToolbarConfig()"));
   dlg.exec();
 }
 void MyClass.slotNewToolbarConfig() // This is called when OK, Apply or Defaults is clicked
 {
    ...if you use any action list, use plugActionList on each here...
    createGUI();
    applyMainWindowSettings( KGlobal.config(), "MainWindow" );
 }
 </pre>
 Note that the procedure is a bit different for KParts applications.
 In this case, you need only pass along a pointer to your
 application's KXMLGUIFactory object.  The editor will take care of
 finding all of the action collections and XML files.  The editor
 aims to be semi-intelligent about where it assigns any
 modifications.  In other words, it will not write out part specific
 changes to your shell's XML file.
 An example would be:
 <pre>
 saveMainWindowSettings( KGlobal.config(), "MainWindow" );
 KEditToolbar dlg(factory());
 connect(&dlg,SIGNAL("newToolbarConfig()"),this,SLOT("slotNewToolbarConfig()"));
 dlg.exec();
 void MyClass.slotNewToolbarConfig() // This is called when OK, Apply or Defaults is clicked
 {
    ...if you use any action list, use plugActionList on each here...
    // Do NOT call createGUI()!
    applyMainWindowSettings( KGlobal.config(), "MainWindow" );
 }
 </pre>
 See {@link KEditToolbarSignals} for signals emitted by KEditToolbar
		@author Kurt Granroth <granroth@kde.org>

		@version $Id$
 
		@short A dialog used to customize or configure toolbars.

*/
public class KEditToolbar extends KDialogBase  {
	protected KEditToolbar(Class dummy){super((Class) null);}
	public native TQMetaObject metaObject();
	public native String className();
	/**	
		 Constructor for apps that do not use components.
			 This is the
		 only entry point to this class.  You <b>must</b> pass along your
		 collection of actions (some of which appear in your toolbars).
		 The other two parameters are optional.
			 The second parameter, xmlfile(), is the name (absolute or
		 relative) of your application's UI resource file.  If it is
		 left blank, then the resource file: share/apps/appname/appnameui.rc
		 is used.  This is the same resource file that is used by the
		 default createGUI() function in KMainWindow so you're usually
		 pretty safe in leaving it blank.
			 The third parameter, global(), controls whether or not the
		 global resource file is used.  If this is <code>true</code>, then you may
		 edit all of the actions in your toolbars -- global ones and
		 local one.  If it is <code>false</code>, then you may edit only your
		 application's entries.  The only time you should set this to
		 false is if your application does not use the global resource
		 file at all (very rare).
			@param collection The collection of actions to work on.
			@param xmlfile The application's local resource file.
			@param global If <code>true</code>, then the global resource file will also
		               be parsed.
			@param parent The parent of the dialog.
			@param name An internal name.
		   		@short    Constructor for apps that do not use components.
	*/
	public KEditToolbar(KActionCollection collection, String xmlfile, boolean global, TQWidget parent, String name) {
		super((Class) null);
		newKEditToolbar(collection,xmlfile,global,parent,name);
	}
	private native void newKEditToolbar(KActionCollection collection, String xmlfile, boolean global, TQWidget parent, String name);
	public KEditToolbar(KActionCollection collection, String xmlfile, boolean global, TQWidget parent) {
		super((Class) null);
		newKEditToolbar(collection,xmlfile,global,parent);
	}
	private native void newKEditToolbar(KActionCollection collection, String xmlfile, boolean global, TQWidget parent);
	public KEditToolbar(KActionCollection collection, String xmlfile, boolean global) {
		super((Class) null);
		newKEditToolbar(collection,xmlfile,global);
	}
	private native void newKEditToolbar(KActionCollection collection, String xmlfile, boolean global);
	public KEditToolbar(KActionCollection collection, String xmlfile) {
		super((Class) null);
		newKEditToolbar(collection,xmlfile);
	}
	private native void newKEditToolbar(KActionCollection collection, String xmlfile);
	public KEditToolbar(KActionCollection collection) {
		super((Class) null);
		newKEditToolbar(collection);
	}
	private native void newKEditToolbar(KActionCollection collection);
	public KEditToolbar(String defaultToolbar, KActionCollection collection, String xmlfile, boolean global, TQWidget parent, String name) {
		super((Class) null);
		newKEditToolbar(defaultToolbar,collection,xmlfile,global,parent,name);
	}
	private native void newKEditToolbar(String defaultToolbar, KActionCollection collection, String xmlfile, boolean global, TQWidget parent, String name);
	public KEditToolbar(String defaultToolbar, KActionCollection collection, String xmlfile, boolean global, TQWidget parent) {
		super((Class) null);
		newKEditToolbar(defaultToolbar,collection,xmlfile,global,parent);
	}
	private native void newKEditToolbar(String defaultToolbar, KActionCollection collection, String xmlfile, boolean global, TQWidget parent);
	public KEditToolbar(String defaultToolbar, KActionCollection collection, String xmlfile, boolean global) {
		super((Class) null);
		newKEditToolbar(defaultToolbar,collection,xmlfile,global);
	}
	private native void newKEditToolbar(String defaultToolbar, KActionCollection collection, String xmlfile, boolean global);
	public KEditToolbar(String defaultToolbar, KActionCollection collection, String xmlfile) {
		super((Class) null);
		newKEditToolbar(defaultToolbar,collection,xmlfile);
	}
	private native void newKEditToolbar(String defaultToolbar, KActionCollection collection, String xmlfile);
	public KEditToolbar(String defaultToolbar, KActionCollection collection) {
		super((Class) null);
		newKEditToolbar(defaultToolbar,collection);
	}
	private native void newKEditToolbar(String defaultToolbar, KActionCollection collection);
	/**	
		 Constructor for KParts based apps.
			 The main parameter, factory(), is a pointer to the
		 XML GUI factory object for your application.  It contains a list
		 of all of the GUI clients (along with the action collections and
		 xml files) and the toolbar editor uses that.
			 Use this like so:
		 <pre>
		 KEditToolbar edit(factory());
		 if ( edit.exec() )
		 ...
		 </pre>
			@param factory Your application's factory object
			@param parent The usual parent for the dialog.
			@param name An internal name.
			 Some people seem tempted to use this also in non-KParts apps, using KMainWindow.guiFactory().
		 This works, but only _if_ setting conserveMemory to false when calling
		 KMainWindow.createGUI()! If not, use the other KEditToolbar constructor.
		   		@short    Constructor for KParts based apps.
	*/
	public KEditToolbar(KXMLGUIFactory factory, TQWidget parent, String name) {
		super((Class) null);
		newKEditToolbar(factory,parent,name);
	}
	private native void newKEditToolbar(KXMLGUIFactory factory, TQWidget parent, String name);
	public KEditToolbar(KXMLGUIFactory factory, TQWidget parent) {
		super((Class) null);
		newKEditToolbar(factory,parent);
	}
	private native void newKEditToolbar(KXMLGUIFactory factory, TQWidget parent);
	public KEditToolbar(KXMLGUIFactory factory) {
		super((Class) null);
		newKEditToolbar(factory);
	}
	private native void newKEditToolbar(KXMLGUIFactory factory);
	/**	 Constructor for KParts based apps, which has an extra argument
		 specifying the toolbar to be shown.
			@param defaultToolbar The toolbar with this name will appear for editing.
			@param factory Your application's factory object
			@param parent The usual parent for the dialog.
			@param name An internal name.
				@short   Constructor for KParts based apps, which has an extra argument  specifying the toolbar to be shown.
	*/
	public KEditToolbar(String defaultToolbar, KXMLGUIFactory factory, TQWidget parent, String name) {
		super((Class) null);
		newKEditToolbar(defaultToolbar,factory,parent,name);
	}
	private native void newKEditToolbar(String defaultToolbar, KXMLGUIFactory factory, TQWidget parent, String name);
	public KEditToolbar(String defaultToolbar, KXMLGUIFactory factory, TQWidget parent) {
		super((Class) null);
		newKEditToolbar(defaultToolbar,factory,parent);
	}
	private native void newKEditToolbar(String defaultToolbar, KXMLGUIFactory factory, TQWidget parent);
	public KEditToolbar(String defaultToolbar, KXMLGUIFactory factory) {
		super((Class) null);
		newKEditToolbar(defaultToolbar,factory);
	}
	private native void newKEditToolbar(String defaultToolbar, KXMLGUIFactory factory);
	/**	 Sets the default toolbar, which will be auto-selected when the constructor without the
		    defaultToolbar argument is used.
			@param toolbarName the name of the toolbar
				@short   Sets the default toolbar, which will be auto-selected when the constructor without the     defaultToolbar argument is used.
	*/
	public static native void setDefaultToolbar(String toolbarName);
	/**	
		 Overridden in order to save any changes made to the toolbars
		   		@short    Overridden in order to save any changes made to the toolbars
	*/
	protected native void slotOk();
	/**	
		 idem
		   		@short    idem
	*/
	protected native void slotApply();
	/**	 should OK really save?
				@short   should OK really save?
	*/
	protected native void acceptOK(boolean b);
	/**	
		 Set toolbars to default value
				@short    Set toolbars to default value
	*/
	protected native void slotDefault();
	/** 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();
}