\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=113pt]{classKURLComboBox__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KURLCombo\-Box:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=299pt]{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
 \}
\begin{CompactList}\small\item\em This enum describes which kind of items is shown in the combo box. \item\end{CompactList}\item 
enum {\bf Over\-Load\-Resolving} \{ {\bf Remove\-Top}, 
{\bf Remove\-Bottom}
 \}
\begin{CompactList}\small\item\em 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})}(). \item\end{CompactList}\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf url\-Activated} (const  {\bf KURL} \&url)
\begin{CompactList}\small\item\em Emitted when an item was clicked at. \item\end{CompactList}\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)
\begin{CompactList}\small\item\em Constructs a KURLCombo\-Box. \item\end{CompactList}\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} ()
\begin{CompactList}\small\item\em Destructs the combo box. \item\end{CompactList}\item 
void {\bf set\-URL} (const  {\bf KURL} \&url)
\begin{CompactList}\small\item\em Sets the current url. \item\end{CompactList}\item 
void {\bf set\-URLs} ({\bf QString\-List} urls)
\begin{CompactList}\small\item\em Inserts {\tt urls} into the combobox below the \char`\"{}default urls\char`\"{} (see {\bf add\-Default\-URL}{\rm (p.\,\pageref{classKURLComboBox_a9})}). \item\end{CompactList}\item 
void {\bf set\-URLs} ({\bf QString\-List} urls, {\bf Over\-Load\-Resolving} remove)
\begin{CompactList}\small\item\em Inserts {\tt urls} into the combobox below the \char`\"{}default urls\char`\"{} (see {\bf add\-Default\-URL}{\rm (p.\,\pageref{classKURLComboBox_a9})}). \item\end{CompactList}\item 
{\bf QString\-List} {\bf urls} () const 
\item 
void {\bf set\-Max\-Items} (int)
\begin{CompactList}\small\item\em Sets how many items should be handled and displayed by the combobox. \item\end{CompactList}\item 
int {\bf max\-Items} () const 
\item 
void {\bf add\-Default\-URL} (const  {\bf KURL} \&url, const  {\bf QString} \&{\bf text}=QString::null)
\begin{CompactList}\small\item\em Adds a url that will always be shown in the combobox, it can't be \char`\"{}rotated away\char`\"{}. \item\end{CompactList}\item 
void {\bf add\-Default\-URL} (const  {\bf KURL} \&url, const  {\bf QPixmap} \&pix, const  {\bf QString} \&{\bf text}=QString::null)
\begin{CompactList}\small\item\em Adds a url that will always be shown in the combobox, it can't be \char`\"{}rotated away\char`\"{}. \item\end{CompactList}\item 
void {\bf set\-Defaults} ()
\begin{CompactList}\small\item\em Clears all items and inserts the default urls into the combo. \item\end{CompactList}\item 
void {\bf remove\-URL} (const  {\bf KURL} \&url, bool check\-Default\-URLs=true)
\begin{CompactList}\small\item\em Removes any occurence of {\tt url}. \item\end{CompactList}\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 
\begin{CompactList}\small\item\em Uses {\bf KMime\-Type::pixmap\-For\-URL()}{\rm (p.\,\pageref{classKMimeType_e0})} to return a proper pixmap for {\tt url}. \item\end{CompactList}\item 
void {\bf update\-Item} (const  KURLCombo\-Item $\ast$item, int index, const  {\bf QPixmap} \&pix)
\begin{CompactList}\small\item\em Updates {\tt item} with {\tt pixmap} and sets the url instead of the text of the KURLCombo\-Item. \item\end{CompactList}\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{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} = 0, const char $\ast$ {\em name} = 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.

References KStd\-Accel::name().\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$<$ KURLCombo\-Item $>$::append(), QCombo\-Box::count(), QPtr\-List\-Iterator::current(), get\-Pixmap(), QCombo\-Box::insert\-Item(), KURL::is\-Empty(), KURL::is\-Local\-File(), KURL::path(), KURL::pretty\-URL(), QPtr\-List$<$ KURLCombo\-Item $>$::remove\-Last(), KCombo\-Box::set\-Current\-Item(), set\-Defaults(), QCombo\-Box::text(), update\-Item(), and KURL::url().

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 {\bf add\-Default\-URL}{\rm (p.\,\pageref{classKURLComboBox_a9})}). 

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 {\bf add\-Default\-URL}{\rm (p.\,\pageref{classKURLComboBox_a9})}). 

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$<$ KURLCombo\-Item $>$::append(), QPtr\-List$<$ KURLCombo\-Item $>$::clear(), QPtr\-List$<$ KURLCombo\-Item $>$::count(), KURL::from\-Path\-Or\-URL(), get\-Pixmap(), KURL::is\-Local\-File(), KURL::path(), set\-Defaults(), and QCombo\-Box::text().\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}


Definition at line 81 of file kurlcombobox.cpp.

References QCombo\-Box::count(), QPtr\-List$<$ KURLCombo\-Item $>$::count(), QString::is\-Empty(), and QCombo\-Box::text().

Referenced by KFile\-Dialog::save\-Recent\-Files().\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$<$ KURLCombo\-Item $>$::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} = 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} = 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$<$ KURLCombo\-Item $>$::append(), QString::is\-Empty(), KURL::is\-Local\-File(), KURL::path(), and KURL::pretty\-URL().\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$<$ KURLCombo\-Item $>$::at(), QCombo\-Box::clear(), and QPtr\-List$<$ KURLCombo\-Item $>$::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} = true)}\label{classKURLComboBox_a12}


Removes any occurence 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 QPtr\-List\-Iterator::current(), QPtr\-List$<$ KURLCombo\-Item $>$::remove(), set\-Defaults(), and KURL::url().\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}
