org.kde.koala

Class KURLRequester

public class KURLRequester extends 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 KURLRequesterSignals for signals emitted by KURLRequester

Author: Carsten Pfeiffer

UNKNOWN: A widget to request a filename/url from the user.

Constructor Summary
protected KURLRequester(Class dummy)
KURLRequester(QWidget parent, String name)
Constructs a KURLRequester widget.
KURLRequester(QWidget parent)
KURLRequester()
KURLRequester(String url, QWidget parent, String name)
Constructs a KURLRequester widget with the initial URL url. // TODO KDE4: Use KURL instead
KURLRequester(String url, QWidget parent)
KURLRequester(String url)
KURLRequester(QWidget editWidget, QWidget parent, String name)
Special constructor, which creates a KURLRequester widget with a custom edit-widget.
KURLRequester(QWidget editWidget, QWidget parent)
Method Summary
KPushButtonbutton()
StringclassName()
voidclear()
Clears the lineedit/combobox.
KComboBoxcomboBox()
KURLCompletioncompletionObject()
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
KFileDialogfileDialog()
Remove in KDE4?
Stringfilter()
Returns the current filter for the file dialog.
protected voidfinalize()
Deletes the wrapped C++ instance
protected voidinit()
booleanisDisposed()
Has the wrapped C++ instance been deleted?
KLineEditlineEdit()
It is provided so that you can e.g. set an own completion object (e.g.
QMetaObjectmetaObject()
intmode()
Returns the current mode
voidsetCaption(String caption)
Sets the caption of the file dialog.
voidsetFilter(String filter)
Sets the filter for the file dialog.
voidsetKURL(KURL url)
Sets the url in the lineedit to url.
voidsetMode(int m)
Sets the mode of the file dialog.
voidsetShowLocalProtocol(boolean b)
Enables/disables showing file:/ in the lineedit, when a local file has been selected in the filedialog or was set via setURL().
voidsetURL(String url)
Sets the url in the lineedit to url. Depending on the state of showLocalProtocol(), file:/ on local files will be shown or not.
booleanshowLocalProtocol()
protected voidslotOpenDialog()
Called when the button is pressed to open the filedialog.
Stringurl()

Constructor Detail

KURLRequester

protected KURLRequester(Class dummy)

KURLRequester

public KURLRequester(QWidget parent, String name)
Constructs a KURLRequester widget.

UNKNOWN: Constructs a KURLRequester widget.

KURLRequester

public KURLRequester(QWidget parent)

KURLRequester

public KURLRequester()

KURLRequester

public KURLRequester(String url, QWidget parent, String name)
Constructs a KURLRequester widget with the initial URL url. // TODO KDE4: Use KURL instead

UNKNOWN: Constructs a KURLRequester widget with the initial URL url.

KURLRequester

public KURLRequester(String url, QWidget parent)

KURLRequester

public KURLRequester(String url)

KURLRequester

public KURLRequester(QWidget editWidget, QWidget parent, String name)
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.

UNKNOWN: Special constructor, which creates a KURLRequester widget with a custom edit-widget.

KURLRequester

public KURLRequester(QWidget editWidget, QWidget parent)

Method Detail

button

public KPushButton button()

Returns: a pointer to the pushbutton. It is provided so that you can specify an own pixmap or a text, if you really need to.

UNKNOWN:

className

public String className()

clear

public void clear()
Clears the lineedit/combobox.

UNKNOWN: Clears the lineedit/combobox.

comboBox

public KComboBox comboBox()

Returns: a pointer to the combobox, in case you have set one using the special constructor. Returns 0L otherwise.

UNKNOWN:

completionObject

public KURLCompletion completionObject()

Returns: the KURLCompletion object used in the lineedit/combobox.

UNKNOWN:

dispose

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

fileDialog

public KFileDialog fileDialog()
Remove in KDE4? KURLRequester should use KDirSelectDialog for (mode & KFile.Directory) && !(mode & KFile.File)

Returns: a pointer to the filedialog You can use this to customize the dialog, e.g. to specify a filter. Never returns 0L.

UNKNOWN:

filter

public String filter()
Returns the current filter for the file dialog.

See Also: KFileDialog

UNKNOWN: Returns the current filter for the file dialog.

finalize

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

init

protected void init()

isDisposed

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

lineEdit

public KLineEdit lineEdit()
It is provided so that you can e.g. set an own completion object (e.g. KShellCompletion) into it.

Returns: a pointer to the lineedit, either the default one, or the special one, if you used the special constructor.

UNKNOWN:

metaObject

public QMetaObject metaObject()

mode

public int mode()
Returns the current mode

See Also: KFileDialog

UNKNOWN: Returns the current mode

setCaption

public void setCaption(String caption)
Sets the caption of the file dialog.

UNKNOWN: Sets the caption of the file dialog.

setFilter

public void setFilter(String filter)
Sets the filter for the file dialog.

See Also: KFileDialog

UNKNOWN: Sets the filter for the file dialog.

setKURL

public void setKURL(KURL url)
Sets the url in the lineedit to url.

UNKNOWN: Sets the url in the lineedit to url.

setMode

public void setMode(int m)
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.

See Also: KFileDialog

UNKNOWN: Sets the mode of the file dialog.

setShowLocalProtocol

public void setShowLocalProtocol(boolean b)
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:/

See Also: KURLRequester

UNKNOWN: Enables/disables showing file:/ in the lineedit, when a local file has been selected in the filedialog or was set via setURL().

setURL

public void setURL(String url)
Sets the url in the lineedit to url. Depending on the state of showLocalProtocol(), file:/ on local files will be shown or not.

UNKNOWN: Sets the url in the lineedit to url.

showLocalProtocol

public boolean showLocalProtocol()

Returns: whether local files will be prefixed with file:/ in the lineedit

See Also: KURLRequester

UNKNOWN:

slotOpenDialog

protected void slotOpenDialog()
Called when the button is pressed to open the filedialog. Also called when KStdAccel.Open (default is Ctrl-O) is pressed.

UNKNOWN: Called when the button is pressed to open the filedialog.

url

public String url()

Returns: 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

UNKNOWN: