\section{KURLCombo\-Box Class Reference}
\label{classKURLComboBox}\index{KURLComboBox@{KURLComboBox}}
This combobox shows a number of recent URLs/directories, as well as some default directories. A combo box showing a number of recent URLs/directories.  


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

Inheritance diagram for KURLCombo\-Box:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=111pt]{classKURLComboBox__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KURLCombo\-Box:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=277pt]{classKURLComboBox__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Mode} \{ {\bf Files} =  -1, 
{\bf Directories} =  1, 
{\bf Both} =  0
 \}
\item 
enum {\bf Over\-Load\-Resolving} \{ {\bf Remove\-Top}, 
{\bf Remove\-Bottom}
 \}
\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf url\-Activated} (const {\bf KURL} \&url)
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KURLCombo\-Box} ({\bf Mode} mode, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
{\bf KURLCombo\-Box} ({\bf Mode} mode, bool rw, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)\label{classKURLComboBox_a1}

\item 
{\bf $\sim$KURLCombo\-Box} ()
\item 
void {\bf set\-URL} (const {\bf KURL} \&url)
\item 
void {\bf set\-URLs} ({\bf QString\-List} urls)
\item 
void {\bf set\-URLs} ({\bf QString\-List} urls, {\bf Over\-Load\-Resolving} remove)
\item 
{\bf QString\-List} {\bf urls} () const 
\item 
void {\bf set\-Max\-Items} (int)
\item 
int {\bf max\-Items} () const 
\item 
void {\bf add\-Default\-URL} (const {\bf KURL} \&url, const {\bf QString} \&{\bf text}=QString::null)
\item 
void {\bf add\-Default\-URL} (const {\bf KURL} \&url, const {\bf QPixmap} \&pix, const {\bf QString} \&{\bf text}=QString::null)
\item 
void {\bf set\-Defaults} ()
\item 
void {\bf remove\-URL} (const {\bf KURL} \&url, bool check\-Default\-URLs=true)
\end{CompactItemize}
\subsection*{Protected Types}
\begin{CompactItemize}
\item 
typedef \_\-KURLCombo\-Item {\bf KURLCombo\-Item}\label{classKURLComboBox_x0}

\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
void {\bf slot\-Activated} (int)\label{classKURLComboBox_j0}

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf init} ({\bf Mode} mode)\label{classKURLComboBox_b0}

\item 
void {\bf insert\-URLItem} (const KURLCombo\-Item $\ast$)\label{classKURLComboBox_b1}

\item 
{\bf QPixmap} {\bf get\-Pixmap} (const {\bf KURL} \&url) const 
\item 
void {\bf update\-Item} (const KURLCombo\-Item $\ast$item, int index, const {\bf QPixmap} \&pix)
\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf QPtr\-List}$<$ KURLCombo\-Item $>$ {\bf item\-List}\label{classKURLComboBox_p0}

\item 
{\bf QPtr\-List}$<$ KURLCombo\-Item $>$ {\bf default\-List}\label{classKURLComboBox_p1}

\item 
{\bf QMap}$<$ int, const KURLCombo\-Item $\ast$ $>$ {\bf item\-Mapper}\label{classKURLComboBox_p2}

\item 
{\bf QPixmap} {\bf opendir\-Pix}\label{classKURLComboBox_p3}

\item 
int {\bf first\-Item\-Index}\label{classKURLComboBox_p4}

\end{CompactItemize}
\subsection*{Properties}
\begin{CompactItemize}
\item 
{\bf QString\-List} {\bf urls}\label{classKURLComboBox_00}

\item 
int {\bf max\-Items}\label{classKURLComboBox_01}

\end{CompactItemize}


\subsection{Detailed Description}
This combobox shows a number of recent URLs/directories, as well as some default directories. A combo box showing a number of recent URLs/directories. 

It will manage the default dirs root-directory, home-directory and Desktop-directory, as well as a number of URLs set via {\bf set\-URLs()}{\rm (p.\,\pageref{classKURLComboBox_a4})} and one additional entry to be set via {\bf set\-URL()}{\rm (p.\,\pageref{classKURLComboBox_a3})}.

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




Definition at line 41 of file kurlcombobox.h.

\subsection{Member Enumeration Documentation}
\index{KURLComboBox@{KURLCombo\-Box}!Mode@{Mode}}
\index{Mode@{Mode}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf enum} {\bf KURLCombo\-Box::Mode}}\label{classKURLComboBox_w5}


This enum describes which kind of items is shown in the combo box. 



Definition at line 51 of file kurlcombobox.h.\index{KURLComboBox@{KURLCombo\-Box}!OverLoadResolving@{OverLoadResolving}}
\index{OverLoadResolving@{OverLoadResolving}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf enum} {\bf KURLCombo\-Box::Over\-Load\-Resolving}}\label{classKURLComboBox_w6}


This Enumeration is used in {\bf set\-URL()}{\rm (p.\,\pageref{classKURLComboBox_a3})} to determine which items will be removed when the given list is larger than {\bf max\-Items()}{\rm (p.\,\pageref{classKURLComboBox_a8})}. 

\begin{itemize}
\item Remove\-Top means that items will be removed from top \item Remove\-Bottom means, that items will be removed from the bottom \end{itemize}


Definition at line 59 of file kurlcombobox.h.

\subsection{Constructor \& Destructor Documentation}
\index{KURLComboBox@{KURLCombo\-Box}!KURLComboBox@{KURLComboBox}}
\index{KURLComboBox@{KURLComboBox}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURLCombo\-Box::KURLCombo\-Box ({\bf Mode} {\em mode}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKURLComboBox_a0}


Constructs a KURLCombo\-Box. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mode}]is either Files, Directories or Both and controls the following behavior: \begin{itemize}
\item Files all inserted URLs will be treated as files, therefore the url shown in the combo will never show a trailing / the icon will be the one associated with the file's mimetype. \item Directories all inserted URLs will be treated as directories, will have a trailing slash in the combobox. The current directory will show the \char`\"{}open folder\char`\"{} icon, other directories the \char`\"{}folder\char`\"{} icon. \item Both Don't mess with anything, just show the url as given. \end{itemize}
\end{description}
\end{Desc}


Definition at line 41 of file kurlcombobox.cpp.\index{KURLComboBox@{KURLCombo\-Box}!~KURLComboBox@{$\sim$KURLComboBox}}
\index{~KURLComboBox@{$\sim$KURLComboBox}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURLCombo\-Box::$\sim${\bf KURLCombo\-Box} ()}\label{classKURLComboBox_a2}


Destructs the combo box. 



Definition at line 56 of file kurlcombobox.cpp.

\subsection{Member Function Documentation}
\index{KURLComboBox@{KURLCombo\-Box}!setURL@{setURL}}
\index{setURL@{setURL}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLCombo\-Box::set\-URL (const {\bf KURL} \& {\em url})}\label{classKURLComboBox_a3}


Sets the current url. 

This combo handles exactly one url additionally to the default items and those set via {\bf set\-URLs()}{\rm (p.\,\pageref{classKURLComboBox_a4})}. So you can call {\bf set\-URL()}{\rm (p.\,\pageref{classKURLComboBox_a3})} as often as you want, it will always replace the previous one set via {\bf set\-URL()}{\rm (p.\,\pageref{classKURLComboBox_a3})}. If {\tt url} is already in the combo, the last item will stay there and the existing item becomes the current item. The current item will always have the open-directory-pixmap as icon.

Note that you won't receive any signals, e.g. {\bf text\-Changed()}, {\bf return\-Pressed()} or {\bf activated()} upon calling this method. 

Definition at line 199 of file kurlcombobox.cpp.

References QPtr\-List::append(), QMap::begin(), QCombo\-Box::count(), QPtr\-List\-Iterator::current(), QMap::end(), endl(), get\-Pixmap(), QMap::insert(), QCombo\-Box::insert\-Item(), kd\-Debug(), QPtr\-List::remove\-Last(), KCombo\-Box::set\-Current\-Item(), set\-Defaults(), and update\-Item().

Referenced by KFile\-Dialog::read\-Config().\index{KURLComboBox@{KURLCombo\-Box}!setURLs@{setURLs}}
\index{setURLs@{setURLs}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLCombo\-Box::set\-URLs ({\bf QString\-List} {\em urls})}\label{classKURLComboBox_a4}


Inserts {\tt urls} into the combobox below the \char`\"{}default urls\char`\"{} (see add\-Default\-URL). 

If the list of urls contains more items than max\-Items, the first items will be stripped. 

Definition at line 137 of file kurlcombobox.cpp.

Referenced by KFile\-Dialog::read\-Config(), and KFile\-Dialog::read\-Recent\-Files().\index{KURLComboBox@{KURLCombo\-Box}!setURLs@{setURLs}}
\index{setURLs@{setURLs}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLCombo\-Box::set\-URLs ({\bf QString\-List} {\em urls}, {\bf Over\-Load\-Resolving} {\em remove})}\label{classKURLComboBox_a5}


Inserts {\tt urls} into the combobox below the \char`\"{}default urls\char`\"{} (see add\-Default\-URL). 

If the list of urls contains more items than max\-Items, the {\tt remove} parameter determines whether the first or last items will be stripped. 

Definition at line 142 of file kurlcombobox.cpp.

References QPtr\-List::append(), QPtr\-List::clear(), QPtr\-List::count(), KURL::from\-Path\-Or\-URL(), get\-Pixmap(), KURL::is\-Local\-File(), KURL::path(), set\-Defaults(), and KURL::url().\index{KURLComboBox@{KURLCombo\-Box}!urls@{urls}}
\index{urls@{urls}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KURLCombo\-Box::urls () const}\label{classKURLComboBox_a6}


\begin{Desc}
\item[Returns:]a list of all urls currently handled. The list contains at most {\bf max\-Items()}{\rm (p.\,\pageref{classKURLComboBox_a8})} items. Use this to save the list of urls in a config-file and reinsert them via {\bf set\-URLs()}{\rm (p.\,\pageref{classKURLComboBox_a4})} next time. Note that all default urls set via {\bf add\-Default\-URL()}{\rm (p.\,\pageref{classKURLComboBox_a9})} are not returned, they will automatically be set via {\bf set\-URLs()}{\rm (p.\,\pageref{classKURLComboBox_a4})} or {\bf set\-URL()}{\rm (p.\,\pageref{classKURLComboBox_a3})}. You will always get fully qualified urls, i.e. with protocol like {\tt file:/} \end{Desc}
\index{KURLComboBox@{KURLCombo\-Box}!setMaxItems@{setMaxItems}}
\index{setMaxItems@{setMaxItems}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLCombo\-Box::set\-Max\-Items (int)}\label{classKURLComboBox_a7}


Sets how many items should be handled and displayed by the combobox. 

\begin{Desc}
\item[See also:]{\bf max\-Items}{\rm (p.\,\pageref{classKURLComboBox_a8})} \end{Desc}


Definition at line 281 of file kurlcombobox.cpp.

References QPtr\-List::count(), QCombo\-Box::count(), QPtr\-List\-Iterator::current(), QCombo\-Box::current\-Item(), KCombo\-Box::set\-Current\-Item(), and set\-Defaults().

Referenced by KFile\-Dialog::read\-Config(), and KFile\-Dialog::read\-Recent\-Files().\index{KURLComboBox@{KURLCombo\-Box}!maxItems@{maxItems}}
\index{maxItems@{maxItems}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KURLCombo\-Box::max\-Items () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURLComboBox_a8}


\begin{Desc}
\item[Returns:]the maximum of items the combobox handles. \end{Desc}
\begin{Desc}
\item[See also:]{\bf set\-Max\-Items}{\rm (p.\,\pageref{classKURLComboBox_a7})} \end{Desc}


Definition at line 135 of file kurlcombobox.h.\index{KURLComboBox@{KURLCombo\-Box}!addDefaultURL@{addDefaultURL}}
\index{addDefaultURL@{addDefaultURL}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLCombo\-Box::add\-Default\-URL (const {\bf KURL} \& {\em url}, const {\bf QString} \& {\em text} = {\tt QString::null})}\label{classKURLComboBox_a9}


Adds a url that will always be shown in the combobox, it can't be \char`\"{}rotated away\char`\"{}. 

Default urls won't be returned in {\bf urls()}{\rm (p.\,\pageref{classKURLComboBox_a6})} and don't have to be set via {\bf set\-URLs()}{\rm (p.\,\pageref{classKURLComboBox_a4})}. If you want to specify a special pixmap, use the overloaded method with the pixmap parameter. Default URLs will be inserted into the combobox by {\bf set\-Defaults()}{\rm (p.\,\pageref{classKURLComboBox_a11})} 

Definition at line 101 of file kurlcombobox.cpp.

References get\-Pixmap().\index{KURLComboBox@{KURLCombo\-Box}!addDefaultURL@{addDefaultURL}}
\index{addDefaultURL@{addDefaultURL}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLCombo\-Box::add\-Default\-URL (const {\bf KURL} \& {\em url}, const {\bf QPixmap} \& {\em pix}, const {\bf QString} \& {\em text} = {\tt QString::null})}\label{classKURLComboBox_a10}


Adds a url that will always be shown in the combobox, it can't be \char`\"{}rotated away\char`\"{}. 

Default urls won't be returned in {\bf urls()}{\rm (p.\,\pageref{classKURLComboBox_a6})} and don't have to be set via {\bf set\-URLs()}{\rm (p.\,\pageref{classKURLComboBox_a4})}. If you don't need to specify a pixmap, use the overloaded method without the pixmap parameter. Default URLs will be inserted into the combobox by {\bf set\-Defaults()}{\rm (p.\,\pageref{classKURLComboBox_a11})} 

Definition at line 107 of file kurlcombobox.cpp.

References QPtr\-List::append().\index{KURLComboBox@{KURLCombo\-Box}!setDefaults@{setDefaults}}
\index{setDefaults@{setDefaults}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLCombo\-Box::set\-Defaults ()}\label{classKURLComboBox_a11}


Clears all items and inserts the default urls into the combo. 

Will be called implicitly upon the first call to {\bf set\-URLs()}{\rm (p.\,\pageref{classKURLComboBox_a4})} or {\bf set\-URL()}{\rm (p.\,\pageref{classKURLComboBox_a3})} \begin{Desc}
\item[See also:]{\bf add\-Default\-URL}{\rm (p.\,\pageref{classKURLComboBox_a9})} \end{Desc}


Definition at line 125 of file kurlcombobox.cpp.

References QPtr\-List::at(), QMap::clear(), QCombo\-Box::clear(), and QPtr\-List::count().

Referenced by remove\-URL(), set\-Max\-Items(), set\-URL(), and set\-URLs().\index{KURLComboBox@{KURLCombo\-Box}!removeURL@{removeURL}}
\index{removeURL@{removeURL}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLCombo\-Box::remove\-URL (const {\bf KURL} \& {\em url}, bool {\em check\-Default\-URLs} = {\tt true})}\label{classKURLComboBox_a12}


Removes any occurrence of {\tt url}. 

If {\tt check\-Default\-URLs} is false default-urls won't be removed. 

Definition at line 307 of file kurlcombobox.cpp.

References QMap::begin(), QPtr\-List\-Iterator::current(), QMap::end(), QPtr\-List::remove(), and set\-Defaults().\index{KURLComboBox@{KURLCombo\-Box}!urlActivated@{urlActivated}}
\index{urlActivated@{urlActivated}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLCombo\-Box::url\-Activated (const {\bf KURL} \& {\em url})\hspace{0.3cm}{\tt  [signal]}}\label{classKURLComboBox_l0}


Emitted when an item was clicked at. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]is the url of the now current item. If it is a local url, it won't have a protocol ({\tt file:/}), otherwise it will. \end{description}
\end{Desc}
\index{KURLComboBox@{KURLCombo\-Box}!getPixmap@{getPixmap}}
\index{getPixmap@{getPixmap}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPixmap} KURLCombo\-Box::get\-Pixmap (const {\bf KURL} \& {\em url}) const\hspace{0.3cm}{\tt  [protected]}}\label{classKURLComboBox_b2}


Uses {\bf KMime\-Type::pixmap\-For\-URL()}{\rm (p.\,\pageref{classKMimeType_e0})} to return a proper pixmap for {\tt url}. 

In directory mode, a folder icon is always returned. 

Definition at line 329 of file kurlcombobox.cpp.

References KMime\-Type::pixmap\-For\-URL().

Referenced by add\-Default\-URL(), set\-URL(), and set\-URLs().\index{KURLComboBox@{KURLCombo\-Box}!updateItem@{updateItem}}
\index{updateItem@{updateItem}!KURLComboBox@{KURLCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLCombo\-Box::update\-Item (const KURLCombo\-Item $\ast$ {\em item}, int {\em index}, const {\bf QPixmap} \& {\em pix})\hspace{0.3cm}{\tt  [protected]}}\label{classKURLComboBox_b3}


Updates {\tt item} with {\tt pixmap} and sets the url instead of the text of the KURLCombo\-Item. 

Also works around a {\bf Qt} bug. 

Definition at line 340 of file kurlcombobox.cpp.

References QCombo\-Box::change\-Item(), QCombo\-Box::editable(), QCombo\-Box::insert\-Item(), and QCombo\-Box::remove\-Item().

Referenced by set\-URL().

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