\section{KURLRequester Class Reference}
\label{classKURLRequester}\index{KURLRequester@{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.  


{\tt \#include $<$kurlrequester.h$>$}

Inheritance diagram for KURLRequester:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=62pt]{classKURLRequester__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KURLRequester:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=282pt]{classKURLRequester__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
void {\bf set\-URL} (const {\bf QString} \&url)
\item 
void {\bf set\-KURL} (const {\bf KURL} \&url)
\item 
virtual void {\bf set\-Caption} (const {\bf QString} \&caption)
\item 
void {\bf clear} ()
\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf text\-Changed} (const {\bf QString} \&)
\item 
void {\bf return\-Pressed} ()
\item 
void {\bf return\-Pressed} (const {\bf QString} \&)
\item 
void {\bf open\-File\-Dialog} ({\bf KURLRequester} $\ast$)
\item 
void {\bf url\-Selected} (const {\bf QString} \&)
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KURLRequester} ({\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
{\bf KURLRequester} (const {\bf QString} \&url, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
{\bf KURLRequester} ({\bf QWidget} $\ast$edit\-Widget, {\bf QWidget} $\ast$parent, const char $\ast$name=0)
\item 
{\bf $\sim$KURLRequester} ()
\item 
{\bf QString} {\bf url} () const 
\item 
void {\bf set\-Show\-Local\-Protocol} (bool b)
\item 
void {\bf set\-Mode} (uint m)
\item 
uint {\bf mode} () const 
\item 
void {\bf set\-Filter} (const {\bf QString} \&filter)
\item 
{\bf QString} {\bf filter} () const 
\item 
bool {\bf show\-Local\-Protocol} () const 
\item 
virtual {\bf KFile\-Dialog} $\ast$ {\bf file\-Dialog} () const 
\item 
{\bf KLine\-Edit} $\ast$ {\bf line\-Edit} () const 
\item 
{\bf KCombo\-Box} $\ast$ {\bf combo\-Box} () const 
\item 
{\bf KPush\-Button} $\ast$ {\bf button} () const 
\item 
{\bf KURLCompletion} $\ast$ {\bf completion\-Object} () const 
\item 
{\bf KEdit\-List\-Box::Custom\-Editor} {\bf custom\-Editor} ()
\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
void {\bf slot\-Open\-Dialog} ()
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf init} ()\label{classKURLRequester_b0}

\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKURLRequester_b1}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf KURLCompletion} $\ast$ {\bf my\-Completion}\label{classKURLRequester_p0}

\end{CompactItemize}
\subsection*{Properties}
\begin{CompactItemize}
\item 
{\bf QString} {\bf url}\label{classKURLRequester_00}

\item 
bool {\bf show\-Local\-Protocol}\label{classKURLRequester_01}

\item 
{\bf QString} {\bf filter}\label{classKURLRequester_02}

\item 
uint {\bf mode}\label{classKURLRequester_03}

\end{CompactItemize}


\subsection{Detailed Description}
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.

The defaults for the filedialog are to ask for one existing local file, i.e. {\bf KFile\-Dialog::set\-Mode}{\rm (p.\,\pageref{classKFileDialog_a24})}( KFile::File $|$ KFile::Existing\-Only $|$ KFile::Local\-Only ) The default filter is \char`\"{}$\ast$\char`\"{}, 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 {\bf set\-Mode()}{\rm (p.\,\pageref{classKURLRequester_a6})} or {\bf set\-Filter()}{\rm (p.\,\pageref{classKURLRequester_a8})}.

 

\begin{Desc}
\item[Author:]Carsten Pfeiffer $<${\tt pfeiffer@kde.org}$>$ \end{Desc}




Definition at line 56 of file kurlrequester.h.

\subsection{Constructor \& Destructor Documentation}
\index{KURLRequester@{KURLRequester}!KURLRequester@{KURLRequester}}
\index{KURLRequester@{KURLRequester}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURLRequester::KURLRequester ({\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKURLRequester_a0}


Constructs a KURLRequester widget. 



Definition at line 173 of file kurlrequester.cpp.\index{KURLRequester@{KURLRequester}!KURLRequester@{KURLRequester}}
\index{KURLRequester@{KURLRequester}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURLRequester::KURLRequester (const {\bf QString} \& {\em url}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKURLRequester_a1}


Constructs a KURLRequester widget with the initial URL {\tt url}. 

// TODO KDE4: Use {\bf KURL} instead 

Definition at line 181 of file kurlrequester.cpp.

References set\-KURL().\index{KURLRequester@{KURLRequester}!KURLRequester@{KURLRequester}}
\index{KURLRequester@{KURLRequester}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURLRequester::KURLRequester ({\bf QWidget} $\ast$ {\em edit\-Widget}, {\bf QWidget} $\ast$ {\em parent}, const char $\ast$ {\em name} = {\tt 0})}\label{classKURLRequester_a2}


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

The edit-widget can be either a {\bf KCombo\-Box} or a {\bf KLine\-Edit} (or inherited thereof). Note: for geometry management reasons, the edit-widget is reparented to have the KURLRequester as parent. 

Definition at line 158 of file kurlrequester.cpp.\index{KURLRequester@{KURLRequester}!~KURLRequester@{$\sim$KURLRequester}}
\index{~KURLRequester@{$\sim$KURLRequester}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURLRequester::$\sim${\bf KURLRequester} ()}\label{classKURLRequester_a3}


Destructs the KURLRequester. 



Definition at line 191 of file kurlrequester.cpp.

\subsection{Member Function Documentation}
\index{KURLRequester@{KURLRequester}!url@{url}}
\index{url@{url}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURLRequester::url () const}\label{classKURLRequester_a4}


\begin{Desc}
\item[Returns:]the current url in the lineedit. May be malformed, if the user entered something weird. $\sim$user or environment variables are substituted for local files. // TODO KDE4: Use {\bf KURL} so that the result is properly defined \end{Desc}


Referenced by set\-Show\-Local\-Protocol(), and slot\-Open\-Dialog().\index{KURLRequester@{KURLRequester}!setShowLocalProtocol@{setShowLocalProtocol}}
\index{setShowLocalProtocol@{setShowLocalProtocol}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLRequester::set\-Show\-Local\-Protocol (bool {\em b})}\label{classKURLRequester_a5}


Enables/disables showing {\tt file:/} in the lineedit, when a local file has been selected in the filedialog or was set via {\bf set\-URL()}{\rm (p.\,\pageref{classKURLRequester_i0})}. 

Default is false, not showing {\tt file:/} \begin{Desc}
\item[See also:]{\bf show\-Local\-Protocol}{\rm (p.\,\pageref{classKURLRequester_a10})} \end{Desc}


Definition at line 353 of file kurlrequester.cpp.

References set\-KURL(), and url().\index{KURLRequester@{KURLRequester}!setMode@{setMode}}
\index{setMode@{setMode}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLRequester::set\-Mode (uint {\em m})}\label{classKURLRequester_a6}


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. \begin{Desc}
\item[See also:]{\bf KFile\-Dialog::set\-Mode()}{\rm (p.\,\pageref{classKFileDialog_a24})} \end{Desc}


Referenced by KURLBar\-Item\-Dialog::KURLBar\-Item\-Dialog().\index{KURLRequester@{KURLRequester}!mode@{mode}}
\index{mode@{mode}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint KURLRequester::mode () const}\label{classKURLRequester_a7}


Returns the current mode. 

\begin{Desc}
\item[See also:]{\bf KFile\-Dialog::mode()}{\rm (p.\,\pageref{classKFileDialog_a26})} \end{Desc}
\begin{Desc}
\item[Since:]3.3 \end{Desc}
\index{KURLRequester@{KURLRequester}!setFilter@{setFilter}}
\index{setFilter@{setFilter}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLRequester::set\-Filter (const {\bf QString} \& {\em filter})}\label{classKURLRequester_a8}


Sets the filter for the file dialog. 

\begin{Desc}
\item[See also:]{\bf KFile\-Dialog::set\-Filter()}{\rm (p.\,\pageref{classKFileDialog_a14})} \end{Desc}


Definition at line 325 of file kurlrequester.cpp.

References KFile\-Dialog::set\-Filter().\index{KURLRequester@{KURLRequester}!filter@{filter}}
\index{filter@{filter}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURLRequester::filter () const}\label{classKURLRequester_a9}


Returns the current filter for the file dialog. 

\begin{Desc}
\item[See also:]KFile\-Dialog::filter() \end{Desc}
\begin{Desc}
\item[Since:]3.3 \end{Desc}
\index{KURLRequester@{KURLRequester}!showLocalProtocol@{showLocalProtocol}}
\index{showLocalProtocol@{showLocalProtocol}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURLRequester::show\-Local\-Protocol () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURLRequester_a10}


\begin{Desc}
\item[Returns:]whether local files will be prefixed with {\tt file:/} in the lineedit \end{Desc}
\begin{Desc}
\item[See also:]{\bf set\-Show\-Local\-Protocol}{\rm (p.\,\pageref{classKURLRequester_a5})} \end{Desc}


Definition at line 138 of file kurlrequester.h.\index{KURLRequester@{KURLRequester}!fileDialog@{fileDialog}}
\index{fileDialog@{fileDialog}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KFile\-Dialog} $\ast$ KURLRequester::file\-Dialog () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKURLRequester_a11}


\begin{Desc}
\item[Returns:]a pointer to the filedialog You can use this to customize the dialog, e.g. to specify a filter. Never returns 0L.\end{Desc}
Remove in KDE4? KURLRequester should use {\bf KDir\-Select\-Dialog}{\rm (p.\,\pageref{classKDirSelectDialog})} for (mode \& KFile::Directory) \&\& !(mode \& KFile::File) 

Definition at line 338 of file kurlrequester.cpp.

References KDialog::set\-Caption(), and KFile\-Dialog::set\-Mode().

Referenced by KURLRequester\-Dlg::file\-Dialog(), and slot\-Open\-Dialog().\index{KURLRequester@{KURLRequester}!lineEdit@{lineEdit}}
\index{lineEdit@{lineEdit}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KLine\-Edit} $\ast$ KURLRequester::line\-Edit () const}\label{classKURLRequester_a12}


\begin{Desc}
\item[Returns:]a pointer to the lineedit, either the default one, or the special one, if you used the special constructor.\end{Desc}
It is provided so that you can e.g. set an own completion object (e.g. {\bf KShell\-Completion}{\rm (p.\,\pageref{classKShellCompletion})}) into it. 

Definition at line 367 of file kurlrequester.cpp.

Referenced by KOpen\-With\-Dlg::init(), and KURLBar\-Item\-Dialog::KURLBar\-Item\-Dialog().\index{KURLRequester@{KURLRequester}!comboBox@{comboBox}}
\index{comboBox@{comboBox}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KCombo\-Box} $\ast$ KURLRequester::combo\-Box () const}\label{classKURLRequester_a13}


\begin{Desc}
\item[Returns:]a pointer to the combobox, in case you have set one using the special constructor. Returns 0L otherwise. \end{Desc}


Definition at line 372 of file kurlrequester.cpp.

Referenced by KOpen\-With\-Dlg::accept(), and KOpen\-With\-Dlg::init().\index{KURLRequester@{KURLRequester}!button@{button}}
\index{button@{button}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPush\-Button} $\ast$ KURLRequester::button () const}\label{classKURLRequester_a14}


\begin{Desc}
\item[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. \end{Desc}


Definition at line 385 of file kurlrequester.cpp.

Referenced by KOpen\-With\-Dlg::init().\index{KURLRequester@{KURLRequester}!completionObject@{completionObject}}
\index{completionObject@{completionObject}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KURLCompletion}$\ast$ KURLRequester::completion\-Object () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURLRequester_a15}


\begin{Desc}
\item[Returns:]the {\bf KURLCompletion}{\rm (p.\,\pageref{classKURLCompletion})} object used in the lineedit/combobox. \end{Desc}


Definition at line 175 of file kurlrequester.h.\index{KURLRequester@{KURLRequester}!customEditor@{customEditor}}
\index{customEditor@{customEditor}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KEdit\-List\-Box::Custom\-Editor} KURLRequester::custom\-Editor ()}\label{classKURLRequester_a16}


\begin{Desc}
\item[Returns:]an object, suitable for use with {\bf KEdit\-List\-Box}. It allows you to put this KURLRequester into a {\bf KEdit\-List\-Box}. Basically, do it like this: 

\footnotesize\begin{verbatim} KURLRequester *req = new KURLRequester( someWidget );
 [...]
 KEditListBox *editListBox = new KEditListBox( i18n("Some Title"), req->customEditor(), someWidget );
\end{verbatim}
\normalsize
 \end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 390 of file kurlrequester.cpp.

References kd\-Warning().\index{KURLRequester@{KURLRequester}!setURL@{setURL}}
\index{setURL@{setURL}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLRequester::set\-URL (const {\bf QString} \& {\em url})\hspace{0.3cm}{\tt  [slot]}}\label{classKURLRequester_i0}


Sets the url in the lineedit to {\tt url}. 

Depending on the state of {\bf show\-Local\-Protocol()}{\rm (p.\,\pageref{classKURLRequester_a10})}, {\tt file:/} on local files will be shown or not. \begin{Desc}
\item[Since:]3.1 // TODO KDE4: Use {\bf KURL} instead \end{Desc}


Definition at line 233 of file kurlrequester.cpp.

Referenced by KOpen\-With\-Dlg::init(), KURLProps\-Plugin::KURLProps\-Plugin(), and KOpen\-With\-Dlg::slot\-Clear().\index{KURLRequester@{KURLRequester}!setKURL@{setKURL}}
\index{setKURL@{setKURL}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLRequester::set\-KURL (const {\bf KURL} \& {\em url})\hspace{0.3cm}{\tt  [slot]}}\label{classKURLRequester_i1}


Sets the url in the lineedit to {\tt url}. 

\begin{Desc}
\item[Since:]3.4 // TODO KDE4: rename to set\-URL \end{Desc}


Definition at line 251 of file kurlrequester.cpp.

Referenced by KURLRequester(), set\-Show\-Local\-Protocol(), and slot\-Open\-Dialog().\index{KURLRequester@{KURLRequester}!setCaption@{setCaption}}
\index{setCaption@{setCaption}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLRequester::set\-Caption (const {\bf QString} \& {\em caption})\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKURLRequester_i2}


Sets the caption of the file dialog. 

\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 259 of file kurlrequester.cpp.

References KDialog::set\-Caption(), and QWidget::set\-Caption().\index{KURLRequester@{KURLRequester}!clear@{clear}}
\index{clear@{clear}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLRequester::clear ()\hspace{0.3cm}{\tt  [slot]}}\label{classKURLRequester_i3}


Clears the lineedit/combobox. 



Definition at line 362 of file kurlrequester.cpp.\index{KURLRequester@{KURLRequester}!textChanged@{textChanged}}
\index{textChanged@{textChanged}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLRequester::text\-Changed (const {\bf QString} \&)\hspace{0.3cm}{\tt  [signal]}}\label{classKURLRequester_l0}


Emitted when the text in the lineedit changes. 

The parameter contains the contents of the lineedit. \begin{Desc}
\item[Since:]3.1 \end{Desc}
\index{KURLRequester@{KURLRequester}!returnPressed@{returnPressed}}
\index{returnPressed@{returnPressed}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLRequester::return\-Pressed ()\hspace{0.3cm}{\tt  [signal]}}\label{classKURLRequester_l1}


Emitted when return or enter was pressed in the lineedit. 

\index{KURLRequester@{KURLRequester}!returnPressed@{returnPressed}}
\index{returnPressed@{returnPressed}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLRequester::return\-Pressed (const {\bf QString} \&)\hspace{0.3cm}{\tt  [signal]}}\label{classKURLRequester_l2}


Emitted when return or enter was pressed in the lineedit. 

The parameter contains the contents of the lineedit. \index{KURLRequester@{KURLRequester}!openFileDialog@{openFileDialog}}
\index{openFileDialog@{openFileDialog}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLRequester::open\-File\-Dialog ({\bf KURLRequester} $\ast$)\hspace{0.3cm}{\tt  [signal]}}\label{classKURLRequester_l3}


Emitted before the filedialog is going to open. 

Connect to this signal to \char`\"{}configure\char`\"{} 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.

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 slot\-Open\-Dialog().\index{KURLRequester@{KURLRequester}!urlSelected@{urlSelected}}
\index{urlSelected@{urlSelected}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLRequester::url\-Selected (const {\bf QString} \&)\hspace{0.3cm}{\tt  [signal]}}\label{classKURLRequester_l4}


Emitted when the user changed the URL via the file dialog. 

The parameter contains the contents of the lineedit. // TODO KDE4: Use {\bf KURL} instead 

Referenced by slot\-Open\-Dialog().\index{KURLRequester@{KURLRequester}!slotOpenDialog@{slotOpenDialog}}
\index{slotOpenDialog@{slotOpenDialog}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLRequester::slot\-Open\-Dialog ()\hspace{0.3cm}{\tt  [protected, slot]}}\label{classKURLRequester_j0}


Called when the button is pressed to open the filedialog. 

Also called when KStd\-Accel::Open (default is Ctrl-O) is pressed. 

Definition at line 271 of file kurlrequester.cpp.

References QDialog::exec(), file\-Dialog(), KURL::is\-Valid(), KFile\-Dialog::mode(), open\-File\-Dialog(), KDir\-Select\-Dialog::select\-Directory(), KFile\-Dialog::selected\-URL(), set\-KURL(), KFile\-Dialog::set\-Selection(), url(), and url\-Selected().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kurlrequester.h\item 
kurlrequester.cpp\end{CompactItemize}
