summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KURLRequester.java
blob: f3aa6735bb5fd76b8462df74d3540d427b93092c (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
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.QMetaObject;
import org.kde.qt.QtSupport;
import org.kde.qt.QWidget;
import org.kde.qt.QHBox;

/**

 This class is a widget showing a lineedit and a button, which invokes a
 filedialog. File name completion is available in the lineedit.
 The defaults for the filedialog are to ask for one existing local file, i.e.
 KFileDialog.setMode( KFile.File | KFile.ExistingOnly | KFile.LocalOnly )
 The default filter is "*", i.e. show all files, and the start directory is
 the current working directory, or the last directory where a file has been
 selected.
 You can change this behavior by using setMode() or setFilter().
 \image html kurlrequester.png "KDE URL Requester"
 See {@link KURLRequesterSignals} for signals emitted by KURLRequester
		@author Carsten Pfeiffer <pfeiffer@kde.org>
 
		@short A widget to request a filename/url from the user.

*/
public class KURLRequester extends QHBox  {
	protected KURLRequester(Class dummy){super((Class) null);}
	public native QMetaObject metaObject();
	public native String className();
	/**	
		 Constructs a KURLRequester widget.
		     		@short    Constructs a KURLRequester widget.
	*/
	public KURLRequester(QWidget parent, String name) {
		super((Class) null);
		newKURLRequester(parent,name);
	}
	private native void newKURLRequester(QWidget parent, String name);
	public KURLRequester(QWidget parent) {
		super((Class) null);
		newKURLRequester(parent);
	}
	private native void newKURLRequester(QWidget parent);
	public KURLRequester() {
		super((Class) null);
		newKURLRequester();
	}
	private native void newKURLRequester();
	/**	
		 Constructs a KURLRequester widget with the initial URL <code>url.</code>
		 // TODO KDE4: Use KURL instead
		     		@short    Constructs a KURLRequester widget with the initial URL <code>url.</code>
	*/
	public KURLRequester(String url, QWidget parent, String name) {
		super((Class) null);
		newKURLRequester(url,parent,name);
	}
	private native void newKURLRequester(String url, QWidget parent, String name);
	public KURLRequester(String url, QWidget parent) {
		super((Class) null);
		newKURLRequester(url,parent);
	}
	private native void newKURLRequester(String url, QWidget parent);
	public KURLRequester(String url) {
		super((Class) null);
		newKURLRequester(url);
	}
	private native void newKURLRequester(String url);
	/**	
		 Special constructor, which creates a KURLRequester widget with a custom
		 edit-widget. The edit-widget can be either a KComboBox or a KLineEdit
		 (or inherited thereof). Note: for geometry management reasons, the
		 edit-widget is reparented to have the KURLRequester as parent.
		     		@short    Special constructor, which creates a KURLRequester widget with a custom  edit-widget.
	*/
	public KURLRequester(QWidget editWidget, QWidget parent, String name) {
		super((Class) null);
		newKURLRequester(editWidget,parent,name);
	}
	private native void newKURLRequester(QWidget editWidget, QWidget parent, String name);
	public KURLRequester(QWidget editWidget, QWidget parent) {
		super((Class) null);
		newKURLRequester(editWidget,parent);
	}
	private native void newKURLRequester(QWidget editWidget, QWidget parent);
	/**	
				@return the current url in the lineedit. May be malformed, if the user
 entered something weird. ~user or environment variables are substituted
 for local files.
 // TODO KDE4: Use KURL so that the result is properly defined
     
		@short
	*/
	public native String url();
	/**	
		 Enables/disables showing file:/ in the lineedit, when a local file has
		 been selected in the filedialog or was set via setURL().
		 Default is false, not showing file:/
				@short    Enables/disables showing file:/ in the lineedit, when a local file has  been selected in the filedialog or was set via setURL().
		@see #showLocalProtocol
	*/
	public native void setShowLocalProtocol(boolean b);
	/**	
		 Sets the mode of the file dialog.
		 Note: you can only select one file with the filedialog,
		 so KFile.Files doesn't make much sense.
				@short    Sets the mode of the file dialog.
		@see KFileDialog#setMode
	*/
	public native void setMode(int m);
	/**	
		 Returns the current mode
				@short    Returns the current mode 
		@see KFileDialog#mode
	*/
	public native int mode();
	/**	
		 Sets the filter for the file dialog.
				@short    Sets the filter for the file dialog.
		@see KFileDialog#setFilter
	*/
	public native void setFilter(String filter);
	/**	
		 Returns the current filter for the file dialog.
				@short    Returns the current filter for the file dialog.
		@see KFileDialog#filter
	*/
	public native String filter();
	/**	
				@return whether local files will be prefixed with file:/ in the
 lineedit

		@short   
		@see #setShowLocalProtocol
	*/
	public native boolean showLocalProtocol();
	/**	
			 Remove in KDE4? KURLRequester should use KDirSelectDialog for
		 (mode & KFile.Directory) && !(mode & KFile.File)
		     		@return a pointer to the filedialog
 You can use this to customize the dialog, e.g. to specify a filter.
 Never returns 0L.

		@short
	*/
	public native KFileDialog fileDialog();
	/**	
			 It is provided so that you can e.g. set an own completion object
		 (e.g. KShellCompletion) into it.
		     		@return a pointer to the lineedit, either the default one, or the
 special one, if you used the special constructor.

		@short
	*/
	public native KLineEdit lineEdit();
	/**	
				@return a pointer to the combobox, in case you have set one using the
 special constructor. Returns 0L otherwise.
     
		@short
	*/
	public native KComboBox comboBox();
	/**	
				@return a pointer to the pushbutton. It is provided so that you can
 specify an own pixmap or a text, if you really need to.
     
		@short
	*/
	public native KPushButton button();
	/**	
				@return the KURLCompletion object used in the lineedit/combobox.
     
		@short
	*/
	public native KURLCompletion completionObject();
	/**	
				@return an object, suitable for use with KEditListBox. It allows you
 to put this KURLRequester into a KEditListBox.
 Basically, do it like this:
 <pre>
 KURLRequester *req = new KURLRequester( someWidget );
 [...]
 KEditListBox *editListBox = new KEditListBox( i18n("Some Title"), req.customEditor(), someWidget );
 </pre>

		@short
	*/
	// KEditListBox::CustomEditor customEditor(); >>>> NOT CONVERTED
	/**	
		 Sets the url in the lineedit to <code>url.</code> Depending on the state of
		 showLocalProtocol(), file:/ on local files will be shown or not.
				@short    Sets the url in the lineedit to <code>url.</code>
	*/
	public native void setURL(String url);
	/**	
		 Sets the url in the lineedit to <code>url.</code>
				@short    Sets the url in the lineedit to <code>url.</code>
	*/
	public native void setKURL(KURL url);
	/**	
		 Sets the caption of the file dialog.
				@short    Sets the caption of the file dialog.
	*/
	public native void setCaption(String caption);
	/**	
		 Clears the lineedit/combobox.
		     		@short    Clears the lineedit/combobox.
	*/
	public native void clear();
	protected native void init();
	/**	
		 Called when the button is pressed to open the filedialog.
		 Also called when KStdAccel.Open (default is Ctrl-O) is pressed.
		     		@short    Called when the button is pressed to open the filedialog.
	*/
	protected native void slotOpenDialog();
	/** 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();
}