.TH "KURLRequester" 3 "28 Jan 2004" "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
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBsetURL\fP (const  \fBQString\fP &url)"
.br
.RI "\fISets the url in the lineedit to \fCurl\fP. \fP"
.ti -1c
.RI "virtual void \fBsetCaption\fP (const  \fBQString\fP &caption)"
.br
.RI "\fISets the caption of the file dialog. \fP"
.ti -1c
.RI "void \fBclear\fP ()"
.br
.RI "\fIClears the lineedit/combobox. \fP"
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBtextChanged\fP (const  \fBQString\fP &)"
.br
.RI "\fIEmitted when the text in the lineedit changes. \fP"
.ti -1c
.RI "void \fBreturnPressed\fP ()"
.br
.RI "\fIEmitted when return or enter was pressed in the lineedit. \fP"
.ti -1c
.RI "void \fBreturnPressed\fP (const  \fBQString\fP &)"
.br
.RI "\fIEmitted when return or enter was pressed in the lineedit. \fP"
.ti -1c
.RI "void \fBopenFileDialog\fP (\fBKURLRequester\fP *)"
.br
.RI "\fIEmitted before the filedialog is going to open. \fP"
.ti -1c
.RI "void \fBurlSelected\fP (const  \fBQString\fP &)"
.br
.RI "\fIEmitted when the user changed the URL via the file dialog. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKURLRequester\fP (\fBQWidget\fP *parent=0, const  char *name=0)"
.br
.RI "\fIConstructs a KURLRequester widget. \fP"
.ti -1c
.RI "\fBKURLRequester\fP (const  \fBQString\fP &url, \fBQWidget\fP *parent=0, const  char *name=0)"
.br
.RI "\fIConstructs a KURLRequester widget with the initial URL \fCurl\fP. \fP"
.ti -1c
.RI "\fBKURLRequester\fP (\fBQWidget\fP *editWidget, \fBQWidget\fP *parent, const  char *name=0)"
.br
.RI "\fISpecial constructor, which creates a KURLRequester widget with a custom edit-widget. \fP"
.ti -1c
.RI "\fB~KURLRequester\fP ()"
.br
.RI "\fIDestructs the KURLRequester. \fP"
.ti -1c
.RI "\fBQString\fP \fBurl\fP () const "
.br
.ti -1c
.RI "void \fBsetShowLocalProtocol\fP (bool b)"
.br
.RI "\fIEnables/disables showing file:/ in the lineedit, when a local file has been selected in the filedialog or was set via \fBsetURL\fP(). \fP"
.ti -1c
.RI "void \fBsetMode\fP (unsigned int m)"
.br
.RI "\fISets the mode of the file dialog. \fP"
.ti -1c
.RI "void \fBsetFilter\fP (const  \fBQString\fP &filter)"
.br
.RI "\fISets the filter for the file dialog. \fP"
.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
.RI "\fICalled when the button is pressed to open the filedialog. \fP"
.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
.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
\fBAuthor:\fP
.RS 4
Carsten Pfeiffer <pfeiffer@kde.org> 
.RE
.PP

.PP
Definition at line 54 of file kurlrequester.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KURLRequester::KURLRequester (\fBQWidget\fP * parent = 0, const char * name = 0)"
.PP
Constructs a KURLRequester widget. Definition at line 160 of file kurlrequester.cpp.
.PP
References KStdAccel::name().
.SS "KURLRequester::KURLRequester (const \fBQString\fP & url, \fBQWidget\fP * parent = 0, const char * name = 0)"
.PP
Constructs a KURLRequester widget with the initial URL \fCurl\fP. Definition at line 168 of file kurlrequester.cpp.
.PP
References KStdAccel::name(), and setURL().
.SS "KURLRequester::KURLRequester (\fBQWidget\fP * editWidget, \fBQWidget\fP * parent, const char * name = 0)"
.PP
Special constructor, which creates a KURLRequester widget with a custom edit-widget. 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
\fBParameters:\fP
.RS 4
\fImodal\fP specifies whether the filedialog should be opened as modal or not. 
.RE
.PP
Definition at line 145 of file kurlrequester.cpp.
.PP
References KStdAccel::name(), and QWidget::reparent().
.SS "KURLRequester::~\fBKURLRequester\fP ()"
.PP
Destructs the KURLRequester. Definition at line 178 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. 
.RE
.PP
Definition at line 236 of file kurlrequester.cpp.
.PP
Referenced by KOpenWithDlg::accept(), KURLPropsPlugin::applyChanges(), KURLRequesterDlg::selectedURL(), setShowLocalProtocol(), slotOpenDialog(), KOpenWithDlg::text(), and KURLBarItemDialog::url().
.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(). Default is false, not showing file:/ 
.PP
\fBSee also:\fP
.RS 4
\fBshowLocalProtocol\fP 
.RE
.PP
Definition at line 294 of file kurlrequester.cpp.
.PP
References setURL(), and url().
.SS "void KURLRequester::setMode (unsigned int m)"
.PP
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. 
.PP
\fBSee also:\fP
.RS 4
\fBKFileDialog::setMode()\fP 
.RE
.PP
Definition at line 261 of file kurlrequester.cpp.
.PP
References KFileDialog::setMode(), and KURLCompletion::setMode().
.PP
Referenced by KURLBarItemDialog::KURLBarItemDialog().
.SS "void KURLRequester::setFilter (const \fBQString\fP & filter)"
.PP
Sets the filter for the file dialog. \fBSee also:\fP
.RS 4
\fBKFileDialog::setFilter()\fP 
.RE
.PP
Definition at line 272 of file kurlrequester.cpp.
.PP
References KFileDialog::setFilter().
.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
Definition at line 117 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
Definition at line 279 of file kurlrequester.cpp.
.PP
References KFileDialog::setFilter(), and KFileDialog::setMode().
.PP
Referenced by KURLRequesterDlg::fileDialog(), setCaption(), 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. Definition at line 308 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
Definition at line 313 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
Definition at line 325 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
Definition at line 150 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 );
 [...]
 \fBKEditListBox\fP *editListBox = new \fBKEditListBox\fP( i18n('Some Title'), req->\fBcustomEditor()\fP, someWidget );
 
.PP
 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 330 of file kurlrequester.cpp.
.SS "void KURLRequester::setURL (const \fBQString\fP & url)\fC [slot]\fP"
.PP
Sets the url in the lineedit to \fCurl\fP. Depending on the state of \fBshowLocalProtocol\fP(), file:/ on local files will be shown or not. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 220 of file kurlrequester.cpp.
.PP
References QString::length(), QString::mid(), and QString::startsWith().
.PP
Referenced by KOpenWithDlg::init(), KURLPropsPlugin::KURLPropsPlugin(), KURLRequester(), setShowLocalProtocol(), KOpenWithDlg::slotClear(), and slotOpenDialog().
.SS "void KURLRequester::setCaption (const \fBQString\fP & caption)\fC [virtual, slot]\fP"
.PP
Sets the caption of the file dialog. \fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 230 of file kurlrequester.cpp.
.PP
References fileDialog(), QWidget::setCaption(), and KDialog::setCaption().
.SS "void KURLRequester::clear ()\fC [slot]\fP"
.PP
Clears the lineedit/combobox. Definition at line 303 of file kurlrequester.cpp.
.SS "void KURLRequester::textChanged (const \fBQString\fP &)\fC [signal]\fP"
.PP
Emitted when the text in the lineedit changes. 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. 
.SS "void KURLRequester::returnPressed (const \fBQString\fP &)\fC [signal]\fP"
.PP
Emitted when return or enter was pressed in the lineedit. 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. 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. 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. The parameter contains the contents of the lineedit. Referenced by slotOpenDialog().
.SS "void KURLRequester::slotOpenDialog ()\fC [protected, slot]\fP"
.PP
Called when the button is pressed to open the filedialog. Also called when \fBKStdAccel::Open\fP (default is Ctrl-O) is pressed. Definition at line 242 of file kurlrequester.cpp.
.PP
References QDialog::exec(), fileDialog(), openFileDialog(), KURL::prettyURL(), KURL::protocol(), KFileDialog::selectedURL(), KFileDialog::setSelection(), setURL(), KProtocolInfo::supportsListing(), KURL::url(), url(), and urlSelected().

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