.TH "KURLRequester" kde3 "11 Jun 2005" "Version Version 3.4.1" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KURLRequester \- This class is a widget showing a lineedit and a button, which invokes a filedialog. A widget to request a filename/url from the user.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kurlrequester.h>\fP
.PP
Inherits \fBQHBox\fP.
.PP
Inherited by KURLComboRequester.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBsetURL\fP (const \fBQString\fP &url)"
.br
.ti -1c
.RI "void \fBsetKURL\fP (const \fBKURL\fP &url)"
.br
.ti -1c
.RI "virtual void \fBsetCaption\fP (const \fBQString\fP &caption)"
.br
.ti -1c
.RI "void \fBclear\fP ()"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBtextChanged\fP (const \fBQString\fP &)"
.br
.ti -1c
.RI "void \fBreturnPressed\fP ()"
.br
.ti -1c
.RI "void \fBreturnPressed\fP (const \fBQString\fP &)"
.br
.ti -1c
.RI "void \fBopenFileDialog\fP (\fBKURLRequester\fP *)"
.br
.ti -1c
.RI "void \fBurlSelected\fP (const \fBQString\fP &)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKURLRequester\fP (\fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "\fBKURLRequester\fP (const \fBQString\fP &url, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "\fBKURLRequester\fP (\fBQWidget\fP *editWidget, \fBQWidget\fP *parent, const char *name=0)"
.br
.ti -1c
.RI "\fB~KURLRequester\fP ()"
.br
.ti -1c
.RI "\fBQString\fP \fBurl\fP () const "
.br
.ti -1c
.RI "void \fBsetShowLocalProtocol\fP (bool b)"
.br
.ti -1c
.RI "void \fBsetMode\fP (uint m)"
.br
.ti -1c
.RI "uint \fBmode\fP () const "
.br
.ti -1c
.RI "void \fBsetFilter\fP (const \fBQString\fP &filter)"
.br
.ti -1c
.RI "\fBQString\fP \fBfilter\fP () const "
.br
.ti -1c
.RI "bool \fBshowLocalProtocol\fP () const "
.br
.ti -1c
.RI "virtual \fBKFileDialog\fP * \fBfileDialog\fP () const "
.br
.ti -1c
.RI "\fBKLineEdit\fP * \fBlineEdit\fP () const "
.br
.ti -1c
.RI "\fBKComboBox\fP * \fBcomboBox\fP () const "
.br
.ti -1c
.RI "\fBKPushButton\fP * \fBbutton\fP () const "
.br
.ti -1c
.RI "\fBKURLCompletion\fP * \fBcompletionObject\fP () const "
.br
.ti -1c
.RI "\fBKEditListBox::CustomEditor\fP \fBcustomEditor\fP ()"
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "void \fBslotOpenDialog\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBinit\fP ()"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "\fBKURLCompletion\fP * \fBmyCompletion\fP"
.br
.in -1c
.SS "Properties"

.in +1c
.ti -1c
.RI "\fBQString\fP \fBurl\fP"
.br
.ti -1c
.RI "bool \fBshowLocalProtocol\fP"
.br
.ti -1c
.RI "\fBQString\fP \fBfilter\fP"
.br
.ti -1c
.RI "uint \fBmode\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
This class is a widget showing a lineedit and a button, which invokes a filedialog. A widget to request a filename/url from the user. 

File name completion is available in the lineedit.
.PP
The defaults for the filedialog are to ask for one existing local file, i.e. \fBKFileDialog::setMode\fP( 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.
.PP
You can change this behavior by using \fBsetMode()\fP or \fBsetFilter()\fP.
.PP
KDE URL Requester 
.PP
\fBAuthor:\fP
.RS 4
Carsten Pfeiffer <pfeiffer@kde.org> 
.RE
.PP

.PP
Definition at line 56 of file kurlrequester.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KURLRequester::KURLRequester (\fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructs a KURLRequester widget. 
.PP
Definition at line 173 of file kurlrequester.cpp.
.SS "KURLRequester::KURLRequester (const \fBQString\fP & url, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructs a KURLRequester widget with the initial URL \fCurl\fP. 
.PP
// TODO KDE4: Use \fBKURL\fP instead 
.PP
Definition at line 181 of file kurlrequester.cpp.
.PP
References setKURL().
.SS "KURLRequester::KURLRequester (\fBQWidget\fP * editWidget, \fBQWidget\fP * parent, const char * name = \fC0\fP)"
.PP
Special constructor, which creates a KURLRequester widget with a custom edit-widget. 
.PP
The edit-widget can be either a \fBKComboBox\fP or a \fBKLineEdit\fP (or inherited thereof). Note: for geometry management reasons, the edit-widget is reparented to have the KURLRequester as parent. 
.PP
Definition at line 158 of file kurlrequester.cpp.
.SS "KURLRequester::~\fBKURLRequester\fP ()"
.PP
Destructs the KURLRequester. 
.PP
Definition at line 191 of file kurlrequester.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBQString\fP KURLRequester::url () const"
.PP
\fBReturns:\fP
.RS 4
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 \fBKURL\fP so that the result is properly defined 
.RE
.PP

.PP
Referenced by setShowLocalProtocol(), and slotOpenDialog().
.SS "void KURLRequester::setShowLocalProtocol (bool b)"
.PP
Enables/disables showing file:/ in the lineedit, when a local file has been selected in the filedialog or was set via \fBsetURL()\fP. 
.PP
Default is false, not showing file:/ 
.PP
\fBSee also:\fP
.RS 4
\fBshowLocalProtocol\fP 
.RE
.PP

.PP
Definition at line 353 of file kurlrequester.cpp.
.PP
References setKURL(), and url().
.SS "void KURLRequester::setMode (uint m)"
.PP
Sets the mode of the file dialog. 
.PP
Note: you can only select one file with the filedialog, so KFile::Files doesn't make much sense. 
.PP
\fBSee also:\fP
.RS 4
\fBKFileDialog::setMode()\fP 
.RE
.PP

.PP
Referenced by KURLBarItemDialog::KURLBarItemDialog().
.SS "uint KURLRequester::mode () const"
.PP
Returns the current mode. 
.PP
\fBSee also:\fP
.RS 4
\fBKFileDialog::mode()\fP 
.RE
.PP
\fBSince:\fP
.RS 4
3.3 
.RE
.PP

.SS "void KURLRequester::setFilter (const \fBQString\fP & filter)"
.PP
Sets the filter for the file dialog. 
.PP
\fBSee also:\fP
.RS 4
\fBKFileDialog::setFilter()\fP 
.RE
.PP

.PP
Definition at line 325 of file kurlrequester.cpp.
.PP
References KFileDialog::setFilter().
.SS "\fBQString\fP KURLRequester::filter () const"
.PP
Returns the current filter for the file dialog. 
.PP
\fBSee also:\fP
.RS 4
KFileDialog::filter() 
.RE
.PP
\fBSince:\fP
.RS 4
3.3 
.RE
.PP

.SS "bool KURLRequester::showLocalProtocol () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
whether local files will be prefixed with file:/ in the lineedit 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetShowLocalProtocol\fP 
.RE
.PP

.PP
Definition at line 138 of file kurlrequester.h.
.SS "\fBKFileDialog\fP * KURLRequester::fileDialog () const\fC [virtual]\fP"
.PP
\fBReturns:\fP
.RS 4
a pointer to the filedialog You can use this to customize the dialog, e.g. to specify a filter. Never returns 0L.
.RE
.PP
Remove in KDE4? KURLRequester should use \fBKDirSelectDialog\fP for (mode & KFile::Directory) && !(mode & KFile::File) 
.PP
Definition at line 338 of file kurlrequester.cpp.
.PP
References KDialog::setCaption(), and KFileDialog::setMode().
.PP
Referenced by KURLRequesterDlg::fileDialog(), and slotOpenDialog().
.SS "\fBKLineEdit\fP * KURLRequester::lineEdit () const"
.PP
\fBReturns:\fP
.RS 4
a pointer to the lineedit, either the default one, or the special one, if you used the special constructor.
.RE
.PP
It is provided so that you can e.g. set an own completion object (e.g. \fBKShellCompletion\fP) into it. 
.PP
Definition at line 367 of file kurlrequester.cpp.
.PP
Referenced by KOpenWithDlg::init(), and KURLBarItemDialog::KURLBarItemDialog().
.SS "\fBKComboBox\fP * KURLRequester::comboBox () const"
.PP
\fBReturns:\fP
.RS 4
a pointer to the combobox, in case you have set one using the special constructor. Returns 0L otherwise. 
.RE
.PP

.PP
Definition at line 372 of file kurlrequester.cpp.
.PP
Referenced by KOpenWithDlg::accept(), and KOpenWithDlg::init().
.SS "\fBKPushButton\fP * KURLRequester::button () const"
.PP
\fBReturns:\fP
.RS 4
a pointer to the pushbutton. It is provided so that you can specify an own pixmap or a text, if you really need to. 
.RE
.PP

.PP
Definition at line 385 of file kurlrequester.cpp.
.PP
Referenced by KOpenWithDlg::init().
.SS "\fBKURLCompletion\fP* KURLRequester::completionObject () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the \fBKURLCompletion\fP object used in the lineedit/combobox. 
.RE
.PP

.PP
Definition at line 175 of file kurlrequester.h.
.SS "\fBKEditListBox::CustomEditor\fP KURLRequester::customEditor ()"
.PP
\fBReturns:\fP
.RS 4
an object, suitable for use with \fBKEditListBox\fP. It allows you to put this KURLRequester into a \fBKEditListBox\fP. Basically, do it like this: 
.PP
.nf
 KURLRequester *req = new KURLRequester( someWidget );
 [...]
 KEditListBox *editListBox = new KEditListBox( i18n('Some Title'), req->customEditor(), someWidget );

.fi
.PP
 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 390 of file kurlrequester.cpp.
.PP
References kdWarning().
.SS "void KURLRequester::setURL (const \fBQString\fP & url)\fC [slot]\fP"
.PP
Sets the url in the lineedit to \fCurl\fP. 
.PP
Depending on the state of \fBshowLocalProtocol()\fP, file:/ on local files will be shown or not. 
.PP
\fBSince:\fP
.RS 4
3.1 // TODO KDE4: Use \fBKURL\fP instead 
.RE
.PP

.PP
Definition at line 233 of file kurlrequester.cpp.
.PP
Referenced by KOpenWithDlg::init(), KURLPropsPlugin::KURLPropsPlugin(), and KOpenWithDlg::slotClear().
.SS "void KURLRequester::setKURL (const \fBKURL\fP & url)\fC [slot]\fP"
.PP
Sets the url in the lineedit to \fCurl\fP. 
.PP
\fBSince:\fP
.RS 4
3.4 // TODO KDE4: rename to setURL 
.RE
.PP

.PP
Definition at line 251 of file kurlrequester.cpp.
.PP
Referenced by KURLRequester(), setShowLocalProtocol(), and slotOpenDialog().
.SS "void KURLRequester::setCaption (const \fBQString\fP & caption)\fC [virtual, slot]\fP"
.PP
Sets the caption of the file dialog. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 259 of file kurlrequester.cpp.
.PP
References KDialog::setCaption(), and QWidget::setCaption().
.SS "void KURLRequester::clear ()\fC [slot]\fP"
.PP
Clears the lineedit/combobox. 
.PP
Definition at line 362 of file kurlrequester.cpp.
.SS "void KURLRequester::textChanged (const \fBQString\fP &)\fC [signal]\fP"
.PP
Emitted when the text in the lineedit changes. 
.PP
The parameter contains the contents of the lineedit. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.SS "void KURLRequester::returnPressed ()\fC [signal]\fP"
.PP
Emitted when return or enter was pressed in the lineedit. 
.PP
.SS "void KURLRequester::returnPressed (const \fBQString\fP &)\fC [signal]\fP"
.PP
Emitted when return or enter was pressed in the lineedit. 
.PP
The parameter contains the contents of the lineedit. 
.SS "void KURLRequester::openFileDialog (\fBKURLRequester\fP *)\fC [signal]\fP"
.PP
Emitted before the filedialog is going to open. 
.PP
Connect to this signal to 'configure' the filedialog, e.g. set the filefilter, the mode, a preview-widget, etc. It's usually not necessary to set a URL for the filedialog, as it will get set properly from the editfield contents.
.PP
If you use multiple KURLRequesters, you can connect all of them to the same slot and use the given KURLRequester pointer to know which one is going to open. 
.PP
Referenced by slotOpenDialog().
.SS "void KURLRequester::urlSelected (const \fBQString\fP &)\fC [signal]\fP"
.PP
Emitted when the user changed the URL via the file dialog. 
.PP
The parameter contains the contents of the lineedit. // TODO KDE4: Use \fBKURL\fP instead 
.PP
Referenced by slotOpenDialog().
.SS "void KURLRequester::slotOpenDialog ()\fC [protected, slot]\fP"
.PP
Called when the button is pressed to open the filedialog. 
.PP
Also called when KStdAccel::Open (default is Ctrl-O) is pressed. 
.PP
Definition at line 271 of file kurlrequester.cpp.
.PP
References QDialog::exec(), fileDialog(), KURL::isValid(), KFileDialog::mode(), openFileDialog(), KDirSelectDialog::selectDirectory(), KFileDialog::selectedURL(), setKURL(), KFileDialog::setSelection(), url(), and urlSelected().

.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
