.TH "KURLComboBox" 3 "28 Jan 2004" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
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.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kurlcombobox.h>\fP
.PP
Inherits \fBKComboBox\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBMode\fP { \fBFiles\fP =  -1, \fBDirectories\fP =  1, \fBBoth\fP =  0 }"
.br
.RI "\fIThis enum describes which kind of items is shown in the combo box. \fP"
.ti -1c
.RI "enum \fBOverLoadResolving\fP { \fBRemoveTop\fP, \fBRemoveBottom\fP }"
.br
.RI "\fIThis Enumeration is used in \fBsetURL\fP() to determine which items will be removed when the given list is larger than \fBmaxItems\fP(). \fP"
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBurlActivated\fP (const  \fBKURL\fP &url)"
.br
.RI "\fIEmitted when an item was clicked at. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKURLComboBox\fP (\fBMode\fP mode, \fBQWidget\fP *parent=0, const  char *name=0)"
.br
.RI "\fIConstructs a KURLComboBox. \fP"
.ti -1c
.RI "\fBKURLComboBox\fP (\fBMode\fP mode, bool rw, \fBQWidget\fP *parent=0, const  char *name=0)"
.br
.ti -1c
.RI "\fB~KURLComboBox\fP ()"
.br
.RI "\fIDestructs the combo box. \fP"
.ti -1c
.RI "void \fBsetURL\fP (const  \fBKURL\fP &url)"
.br
.RI "\fISets the current url. \fP"
.ti -1c
.RI "void \fBsetURLs\fP (\fBQStringList\fP urls)"
.br
.RI "\fIInserts \fCurls\fP into the combobox below the 'default urls' (see \fBaddDefaultURL\fP). \fP"
.ti -1c
.RI "void \fBsetURLs\fP (\fBQStringList\fP urls, \fBOverLoadResolving\fP remove)"
.br
.RI "\fIInserts \fCurls\fP into the combobox below the 'default urls' (see \fBaddDefaultURL\fP). \fP"
.ti -1c
.RI "\fBQStringList\fP \fBurls\fP () const "
.br
.ti -1c
.RI "void \fBsetMaxItems\fP (int)"
.br
.RI "\fISets how many items should be handled and displayed by the combobox. \fP"
.ti -1c
.RI "int \fBmaxItems\fP () const "
.br
.ti -1c
.RI "void \fBaddDefaultURL\fP (const  \fBKURL\fP &url, const  \fBQString\fP &\fBtext\fP=QString::null)"
.br
.RI "\fIAdds a url that will always be shown in the combobox, it can't be 'rotated away'. \fP"
.ti -1c
.RI "void \fBaddDefaultURL\fP (const  \fBKURL\fP &url, const  \fBQPixmap\fP &pix, const  \fBQString\fP &\fBtext\fP=QString::null)"
.br
.RI "\fIAdds a url that will always be shown in the combobox, it can't be 'rotated away'. \fP"
.ti -1c
.RI "void \fBsetDefaults\fP ()"
.br
.RI "\fIClears all items and inserts the default urls into the combo. \fP"
.ti -1c
.RI "void \fBremoveURL\fP (const  \fBKURL\fP &url, bool checkDefaultURLs=true)"
.br
.RI "\fIRemoves any occurence of \fCurl\fP. \fP"
.in -1c
.SS "Protected Types"

.in +1c
.ti -1c
.RI "typedef _KURLComboItem \fBKURLComboItem\fP"
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "void \fBslotActivated\fP (int)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBinit\fP (\fBMode\fP mode)"
.br
.ti -1c
.RI "void \fBinsertURLItem\fP (const  KURLComboItem *)"
.br
.ti -1c
.RI "\fBQPixmap\fP \fBgetPixmap\fP (const  \fBKURL\fP &url) const "
.br
.RI "\fIUses \fBKMimeType::pixmapForURL()\fP to return a proper pixmap for \fCurl\fP. \fP"
.ti -1c
.RI "void \fBupdateItem\fP (const  KURLComboItem *item, int index, const  \fBQPixmap\fP &pix)"
.br
.RI "\fIUpdates \fCitem\fP with \fCpixmap\fP and sets the url instead of the text of the KURLComboItem. \fP"
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "\fBQPtrList\fP< KURLComboItem > \fBitemList\fP"
.br
.ti -1c
.RI "\fBQPtrList\fP< KURLComboItem > \fBdefaultList\fP"
.br
.ti -1c
.RI "\fBQMap\fP< int, const  KURLComboItem * > \fBitemMapper\fP"
.br
.ti -1c
.RI "\fBQPixmap\fP \fBopendirPix\fP"
.br
.ti -1c
.RI "int \fBfirstItemIndex\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
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 \fBsetURLs\fP() and one additional entry to be set via \fBsetURL\fP().
.PP
\fBAuthor:\fP
.RS 4
Carsten Pfeiffer <pfeiffer@kde.org> 
.RE
.PP

.PP
Definition at line 41 of file kurlcombobox.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "\fBenum\fP \fBKURLComboBox::Mode\fP"
.PP
This enum describes which kind of items is shown in the combo box. Definition at line 51 of file kurlcombobox.h.
.SS "\fBenum\fP \fBKURLComboBox::OverLoadResolving\fP"
.PP
This Enumeration is used in \fBsetURL\fP() to determine which items will be removed when the given list is larger than \fBmaxItems\fP(). .IP "\(bu" 2
RemoveTop means that items will be removed from top 
.IP "\(bu" 2
RemoveBottom means, that items will be removed from the bottom 
.PP
Definition at line 59 of file kurlcombobox.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KURLComboBox::KURLComboBox (\fBMode\fP mode, \fBQWidget\fP * parent = 0, const char * name = 0)"
.PP
Constructs a KURLComboBox. \fBParameters:\fP
.RS 4
\fImode\fP is either Files, Directories or Both and controls the following behavior: 
.IP "\(bu" 2
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. 
.IP "\(bu" 2
Directories all inserted URLs will be treated as directories, will have a trailing slash in the combobox. The current directory will show the 'open folder' icon, other directories the 'folder' icon. 
.IP "\(bu" 2
Both Don't mess with anything, just show the url as given. 
.PP
.RE
.PP
Definition at line 41 of file kurlcombobox.cpp.
.PP
References KStdAccel::name().
.SS "KURLComboBox::~\fBKURLComboBox\fP ()"
.PP
Destructs the combo box. Definition at line 56 of file kurlcombobox.cpp.
.SH "Member Function Documentation"
.PP 
.SS "void KURLComboBox::setURL (const \fBKURL\fP & url)"
.PP
Sets the current url. This combo handles exactly one url additionally to the default items and those set via \fBsetURLs\fP(). So you can call \fBsetURL()\fP as often as you want, it will always replace the previous one set via \fBsetURL()\fP. If \fCurl\fP 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.
.PP
Note that you won't receive any signals, e.g. \fBtextChanged()\fP, \fBreturnPressed()\fP or \fBactivated()\fP upon calling this method. Definition at line 199 of file kurlcombobox.cpp.
.PP
References QPtrList< KURLComboItem >::append(), QComboBox::count(), QPtrListIterator::current(), getPixmap(), QComboBox::insertItem(), KURL::isEmpty(), KURL::isLocalFile(), KURL::path(), KURL::prettyURL(), QPtrList< KURLComboItem >::removeLast(), KComboBox::setCurrentItem(), setDefaults(), QComboBox::text(), updateItem(), and KURL::url().
.PP
Referenced by KFileDialog::readConfig().
.SS "void KURLComboBox::setURLs (\fBQStringList\fP urls)"
.PP
Inserts \fCurls\fP into the combobox below the 'default urls' (see \fBaddDefaultURL\fP). If the list of urls contains more items than maxItems, the first items will be stripped. Definition at line 137 of file kurlcombobox.cpp.
.PP
Referenced by KFileDialog::readConfig(), and KFileDialog::readRecentFiles().
.SS "void KURLComboBox::setURLs (\fBQStringList\fP urls, \fBOverLoadResolving\fP remove)"
.PP
Inserts \fCurls\fP into the combobox below the 'default urls' (see \fBaddDefaultURL\fP). If the list of urls contains more items than maxItems, the \fCremove\fP parameter determines whether the first or last items will be stripped. Definition at line 142 of file kurlcombobox.cpp.
.PP
References QPtrList< KURLComboItem >::append(), QPtrList< KURLComboItem >::clear(), QPtrList< KURLComboItem >::count(), KURL::fromPathOrURL(), getPixmap(), KURL::isLocalFile(), KURL::path(), setDefaults(), and QComboBox::text().
.SS "\fBQStringList\fP KURLComboBox::urls () const"
.PP
\fBReturns:\fP
.RS 4
a list of all urls currently handled. The list contains at most \fBmaxItems\fP() items. Use this to save the list of urls in a config-file and reinsert them via \fBsetURLs\fP() next time. Note that all default urls set via \fBaddDefaultURL\fP() are not returned, they will automatically be set via \fBsetURLs()\fP or \fBsetURL()\fP. You will always get fully qualified urls, i.e. with protocol like file:/ 
.RE
.PP
Definition at line 81 of file kurlcombobox.cpp.
.PP
References QComboBox::count(), QPtrList< KURLComboItem >::count(), QString::isEmpty(), and QComboBox::text().
.PP
Referenced by KFileDialog::saveRecentFiles().
.SS "void KURLComboBox::setMaxItems (int)"
.PP
Sets how many items should be handled and displayed by the combobox. \fBSee also:\fP
.RS 4
\fBmaxItems\fP 
.RE
.PP
Definition at line 281 of file kurlcombobox.cpp.
.PP
References QPtrList< KURLComboItem >::count(), QComboBox::count(), QPtrListIterator::current(), QComboBox::currentItem(), KComboBox::setCurrentItem(), and setDefaults().
.PP
Referenced by KFileDialog::readConfig(), and KFileDialog::readRecentFiles().
.SS "int KURLComboBox::maxItems () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the maximum of items the combobox handles. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetMaxItems\fP 
.RE
.PP
Definition at line 135 of file kurlcombobox.h.
.SS "void KURLComboBox::addDefaultURL (const \fBKURL\fP & url, const \fBQString\fP & text = QString::null)"
.PP
Adds a url that will always be shown in the combobox, it can't be 'rotated away'. Default urls won't be returned in \fBurls\fP() and don't have to be set via \fBsetURLs\fP(). 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 \fBsetDefaults\fP() Definition at line 101 of file kurlcombobox.cpp.
.PP
References getPixmap().
.SS "void KURLComboBox::addDefaultURL (const \fBKURL\fP & url, const \fBQPixmap\fP & pix, const \fBQString\fP & text = QString::null)"
.PP
Adds a url that will always be shown in the combobox, it can't be 'rotated away'. Default urls won't be returned in \fBurls\fP() and don't have to be set via \fBsetURLs\fP(). 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 \fBsetDefaults\fP() Definition at line 107 of file kurlcombobox.cpp.
.PP
References QPtrList< KURLComboItem >::append(), QString::isEmpty(), KURL::isLocalFile(), KURL::path(), and KURL::prettyURL().
.SS "void KURLComboBox::setDefaults ()"
.PP
Clears all items and inserts the default urls into the combo. Will be called implicitly upon the first call to \fBsetURLs\fP() or \fBsetURL\fP() 
.PP
\fBSee also:\fP
.RS 4
\fBaddDefaultURL\fP 
.RE
.PP
Definition at line 125 of file kurlcombobox.cpp.
.PP
References QPtrList< KURLComboItem >::at(), QComboBox::clear(), and QPtrList< KURLComboItem >::count().
.PP
Referenced by removeURL(), setMaxItems(), setURL(), and setURLs().
.SS "void KURLComboBox::removeURL (const \fBKURL\fP & url, bool checkDefaultURLs = true)"
.PP
Removes any occurence of \fCurl\fP. If \fCcheckDefaultURLs\fP is false default-urls won't be removed. Definition at line 307 of file kurlcombobox.cpp.
.PP
References QPtrListIterator::current(), QPtrList< KURLComboItem >::remove(), setDefaults(), and KURL::url().
.SS "void KURLComboBox::urlActivated (const \fBKURL\fP & url)\fC [signal]\fP"
.PP
Emitted when an item was clicked at. \fBParameters:\fP
.RS 4
\fIurl\fP is the url of the now current item. If it is a local url, it won't have a protocol (file:/), otherwise it will. 
.RE
.PP

.SS "\fBQPixmap\fP KURLComboBox::getPixmap (const \fBKURL\fP & url) const\fC [protected]\fP"
.PP
Uses \fBKMimeType::pixmapForURL()\fP to return a proper pixmap for \fCurl\fP. In directory mode, a folder icon is always returned. Definition at line 329 of file kurlcombobox.cpp.
.PP
References KMimeType::pixmapForURL().
.PP
Referenced by addDefaultURL(), setURL(), and setURLs().
.SS "void KURLComboBox::updateItem (const KURLComboItem * item, int index, const \fBQPixmap\fP & pix)\fC [protected]\fP"
.PP
Updates \fCitem\fP with \fCpixmap\fP and sets the url instead of the text of the KURLComboItem. Also works around a \fBQt\fP bug. Definition at line 340 of file kurlcombobox.cpp.
.PP
References QComboBox::changeItem(), QComboBox::editable(), QComboBox::insertItem(), and QComboBox::removeItem().
.PP
Referenced by setURL().

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