\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=65pt]{classKURLRequester__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KURLRequester:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=308pt]{classKURLRequester__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
void {\bf set\-URL} (const  {\bf QString} \&url)
\begin{CompactList}\small\item\em Sets the url in the lineedit to {\tt url}. \item\end{CompactList}\item 
virtual void {\bf set\-Caption} (const  {\bf QString} \&caption)
\begin{CompactList}\small\item\em Sets the caption of the file dialog. \item\end{CompactList}\item 
void {\bf clear} ()
\begin{CompactList}\small\item\em Clears the lineedit/combobox. \item\end{CompactList}\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf text\-Changed} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Emitted when the text in the lineedit changes. \item\end{CompactList}\item 
void {\bf return\-Pressed} ()
\begin{CompactList}\small\item\em Emitted when return or enter was pressed in the lineedit. \item\end{CompactList}\item 
void {\bf return\-Pressed} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Emitted when return or enter was pressed in the lineedit. \item\end{CompactList}\item 
void {\bf open\-File\-Dialog} ({\bf KURLRequester} $\ast$)
\begin{CompactList}\small\item\em Emitted before the filedialog is going to open. \item\end{CompactList}\item 
void {\bf url\-Selected} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Emitted when the user changed the URL via the file dialog. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KURLRequester} ({\bf QWidget} $\ast$parent=0, const  char $\ast$name=0)
\begin{CompactList}\small\item\em Constructs a KURLRequester widget. \item\end{CompactList}\item 
{\bf KURLRequester} (const  {\bf QString} \&url, {\bf QWidget} $\ast$parent=0, const  char $\ast$name=0)
\begin{CompactList}\small\item\em Constructs a KURLRequester widget with the initial URL {\tt url}. \item\end{CompactList}\item 
{\bf KURLRequester} ({\bf QWidget} $\ast$edit\-Widget, {\bf QWidget} $\ast$parent, const  char $\ast$name=0)
\begin{CompactList}\small\item\em Special constructor, which creates a KURLRequester widget with a custom edit-widget. \item\end{CompactList}\item 
{\bf $\sim$KURLRequester} ()
\begin{CompactList}\small\item\em Destructs the KURLRequester. \item\end{CompactList}\item 
{\bf QString} {\bf url} () const 
\item 
void {\bf set\-Show\-Local\-Protocol} (bool b)
\begin{CompactList}\small\item\em 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})}(). \item\end{CompactList}\item 
void {\bf set\-Mode} (unsigned int m)
\begin{CompactList}\small\item\em Sets the mode of the file dialog. \item\end{CompactList}\item 
void {\bf set\-Filter} (const  {\bf QString} \&filter)
\begin{CompactList}\small\item\em Sets the filter for the file dialog. \item\end{CompactList}\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} ()
\begin{CompactList}\small\item\em Called when the button is pressed to open the filedialog. \item\end{CompactList}\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{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_a7})}().

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




Definition at line 54 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} = 0, const char $\ast$ {\em name} = 0)}\label{classKURLRequester_a0}


Constructs a KURLRequester widget. 



Definition at line 160 of file kurlrequester.cpp.

References KStd\-Accel::name().\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} = 0, const char $\ast$ {\em name} = 0)}\label{classKURLRequester_a1}


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



Definition at line 168 of file kurlrequester.cpp.

References KStd\-Accel::name(), and set\-URL().\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} = 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. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em modal}]specifies whether the filedialog should be opened as modal or not. \end{description}
\end{Desc}


Definition at line 145 of file kurlrequester.cpp.

References KStd\-Accel::name(), and QWidget::reparent().\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 178 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. \end{Desc}


Definition at line 236 of file kurlrequester.cpp.

Referenced by KOpen\-With\-Dlg::accept(), KURLProps\-Plugin::apply\-Changes(), KURLRequester\-Dlg::selected\-URL(), set\-Show\-Local\-Protocol(), slot\-Open\-Dialog(), KOpen\-With\-Dlg::text(), and KURLBar\-Item\-Dialog::url().\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_a8})} \end{Desc}


Definition at line 294 of file kurlrequester.cpp.

References set\-URL(), and url().\index{KURLRequester@{KURLRequester}!setMode@{setMode}}
\index{setMode@{setMode}!KURLRequester@{KURLRequester}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLRequester::set\-Mode (unsigned int {\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}


Definition at line 261 of file kurlrequester.cpp.

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

Referenced by KURLBar\-Item\-Dialog::KURLBar\-Item\-Dialog().\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_a7}


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 272 of file kurlrequester.cpp.

References KFile\-Dialog::set\-Filter().\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_a8}


\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 117 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_a9}


\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}


Definition at line 279 of file kurlrequester.cpp.

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

Referenced by KURLRequester\-Dlg::file\-Dialog(), set\-Caption(), 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_a10}


\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 308 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_a11}


\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 313 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_a12}


\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 325 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_a13}


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


Definition at line 150 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_a14}


\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: \small\begin{alltt}
 KURLRequester *req = new KURLRequester( someWidget );
 [...]
 {\bf KEditListBox} *editListBox = new {\bf KEditListBox}( i18n("Some Title"), req-$>${\bf customEditor()}{\rm (p.\,\pageref{classKURLRequester_a14})}, someWidget );
 \end{alltt}\normalsize 
 \end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 330 of file kurlrequester.cpp.\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_a8})}(), {\tt file:/} on local files will be shown or not. \begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 220 of file kurlrequester.cpp.

References QString::length(), QString::mid(), and QString::starts\-With().

Referenced by KOpen\-With\-Dlg::init(), KURLProps\-Plugin::KURLProps\-Plugin(), KURLRequester(), set\-Show\-Local\-Protocol(), KOpen\-With\-Dlg::slot\-Clear(), 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_i1}


Sets the caption of the file dialog. 

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


Definition at line 230 of file kurlrequester.cpp.

References file\-Dialog(), QWidget::set\-Caption(), and KDialog::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_i2}


Clears the lineedit/combobox. 



Definition at line 303 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. 

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 242 of file kurlrequester.cpp.

References QDialog::exec(), file\-Dialog(), open\-File\-Dialog(), KURL::pretty\-URL(), KURL::protocol(), KFile\-Dialog::selected\-URL(), KFile\-Dialog::set\-Selection(), set\-URL(), KProtocol\-Info::supports\-Listing(), KURL::url(), 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}
