.TH "KURLBar" 3 "28 Jan 2004" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KURLBar \- KURLBar is a widget that displays icons together with a description. A URL-bar widget, as used in the \fBKFileDialog\fP.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kurlbar.h>\fP
.PP
Inherits \fBQFrame\fP.
.PP
Inherited by KFileSpeedBar.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "virtual void \fBsetCurrentItem\fP (const  \fBKURL\fP &url)"
.br
.RI "\fIMakes the item with the url \fCurl\fP the current item. \fP"
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBactivated\fP (const  \fBKURL\fP &url)"
.br
.RI "\fIThis signal is emitted when the user activated an item, e.g by clicking on it. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKURLBar\fP (bool useGlobalItems, \fBQWidget\fP *parent=0, const  char *name=0, WFlags f=0)"
.br
.RI "\fIConstructs a KURLBar. \fP"
.ti -1c
.RI "\fB~KURLBar\fP ()"
.br
.RI "\fIDestroys the KURLBar. \fP"
.ti -1c
.RI "virtual \fBKURLBarItem\fP * \fBinsertItem\fP (const  \fBKURL\fP &url, const  \fBQString\fP &description, bool applicationLocal=true, const  \fBQString\fP &icon=QString::null, \fBKIcon::Group\fP group=KIcon::Panel)"
.br
.RI "\fIInserts a new item into the KURLBar and returns the created \fBKURLBarItem\fP. \fP"
.ti -1c
.RI "virtual void \fBsetOrientation\fP (Qt::Orientation orient)"
.br
.RI "\fIThe items can be arranged either vertically in one column or horizontally in one row. \fP"
.ti -1c
.RI "Orientation \fBorientation\fP () const "
.br
.ti -1c
.RI "virtual void \fBsetListBox\fP (\fBKURLBarListBox\fP *)"
.br
.RI "\fIAllows to set a custom \fBKURLBarListBox\fP. \fP"
.ti -1c
.RI "\fBKURLBarListBox\fP * \fBlistBox\fP () const "
.br
.ti -1c
.RI "virtual void \fBsetIconSize\fP (int size)"
.br
.RI "\fISets the default iconsize to be used for items inserted with \fBinsertItem\fP. \fP"
.ti -1c
.RI "int \fBiconSize\fP () const "
.br
.ti -1c
.RI "virtual void \fBclear\fP ()"
.br
.RI "\fIClears the view, removes all items. \fP"
.ti -1c
.RI "virtual \fBQSize\fP \fBsizeHint\fP () const "
.br
.ti -1c
.RI "virtual \fBQSize\fP \fBminimumSizeHint\fP () const "
.br
.RI "\fI\fP"
.ti -1c
.RI "virtual void \fBreadConfig\fP (\fBKConfig\fP *config, const  \fBQString\fP &itemGroup)"
.br
.RI "\fICall this method to read a saved configuration from \fCconfig\fP, inside the group \fCitemGroup\fP. \fP"
.ti -1c
.RI "virtual void \fBwriteConfig\fP (\fBKConfig\fP *config, const  \fBQString\fP &itemGroup)"
.br
.RI "\fICall this method to save the current configuration into \fCconfig\fP, inside the group \fCiconGroup\fP. \fP"
.ti -1c
.RI "virtual void \fBreadItem\fP (int i, \fBKConfig\fP *config, bool applicationLocal)"
.br
.RI "\fICalled from \fBreadConfig\fP() to read the i'th from \fCconfig\fP. \fP"
.ti -1c
.RI "virtual void \fBwriteItem\fP (\fBKURLBarItem\fP *item, int i, \fBKConfig\fP *, bool global)"
.br
.RI "\fICalled from \fBwriteConfig\fP() to save the \fBKURLBarItem\fP \fCitem\fP as the i'th entry in the config-object. \fP"
.ti -1c
.RI "\fBKURLBarItem\fP * \fBcurrentItem\fP () const "
.br
.ti -1c
.RI "\fBKURL\fP \fBcurrentURL\fP () const "
.br
.ti -1c
.RI "bool \fBisModified\fP () const "
.br
.ti -1c
.RI "bool \fBisImmutable\fP () const "
.br
.ti -1c
.RI "bool \fBisVertical\fP () const "
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "virtual void \fBslotContextMenuRequested\fP (\fBQListBoxItem\fP *, const  \fBQPoint\fP &pos)"
.br
.RI "\fIReimplemented to show a contextmenu, allowing the user to add, edit or remove items, or change the iconsize. \fP"
.ti -1c
.RI "virtual void \fBslotSelected\fP (\fBQListBoxItem\fP *)"
.br
.RI "\fICalled when an item has been selected. \fP"
.ti -1c
.RI "virtual void \fBslotDropped\fP (\fBQDropEvent\fP *)"
.br
.RI "\fICalled when a url was dropped onto the bar to show a \fBKURLBarItemDialog\fP. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual bool \fBaddNewItem\fP ()"
.br
.RI "\fIPops up a \fBKURLBarItemDialog\fP to let the user add a new item. \fP"
.ti -1c
.RI "virtual bool \fBeditItem\fP (\fBKURLBarItem\fP *item)"
.br
.RI "\fIPops up a \fBKURLBarItemDialog\fP to let the user edit the properties of \fCitem\fP. \fP"
.ti -1c
.RI "virtual void \fBresizeEvent\fP (\fBQResizeEvent\fP *)"
.br
.RI "\fI\fP"
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "\fBKURLBarItem\fP * \fBm_activeItem\fP"
.br
.RI "\fIThe currently active item. \fP"
.ti -1c
.RI "bool \fBm_useGlobal\fP:1"
.br
.RI "\fIWhether we support global entries or just local ones. \fP"
.ti -1c
.RI "bool \fBm_isModified\fP:1"
.br
.RI "\fIWhether the urlbar was modified by the user (e.g. \fP"
.ti -1c
.RI "bool \fBm_isImmutable\fP:1"
.br
.RI "\fIWhether the urlbar may be modified by the user. \fP"
.in -1c
.SH "Detailed Description"
.PP 
KURLBar is a widget that displays icons together with a description. A URL-bar widget, as used in the \fBKFileDialog\fP. 

They can be arranged either horizontally or vertically. Clicking on an item will make the \fBactivated\fP() signal being emitted. The user can edit existing items by choosing 'Edit entry' in the contextmenu. He can also remove or add new entries (via drag&drop or the context menu).
.PP
KURLBar offers the methods \fBreadConfig\fP() and \fBwriteConfig\fP() to read and write the configuration of all the entries. It can differentiate between global and local entries -- global entries will be saved in the global configuration (kdeglobals), while local entries will be saved in your application's \fBKConfig\fP object.
.PP
Due to the configurability, you usually only insert some default entries once and then solely use the read and writeConfig methods to preserve the user's configuration.
.PP
The widget has a 'current' item, that is visualized to differentiate it from others.
.PP
\fBAuthor:\fP
.RS 4
Carsten Pfeiffer <pfeiffer@kde.org> 
.RE
.PP

.PP
Definition at line 198 of file kurlbar.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KURLBar::KURLBar (bool useGlobalItems, \fBQWidget\fP * parent = 0, const char * name = 0, WFlags f = 0)"
.PP
Constructs a KURLBar. Set \fCuseGlobalItems\fP to true if you want to allow global/local item separation. Definition at line 239 of file kurlbar.cpp.
.PP
References QWhatsThis::add(), isVertical(), m_activeItem, m_isImmutable, m_isModified, m_useGlobal, KStdAccel::name(), and setListBox().
.SS "KURLBar::~\fBKURLBar\fP ()"
.PP
Destroys the KURLBar. Definition at line 262 of file kurlbar.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBKURLBarItem\fP * KURLBar::insertItem (const \fBKURL\fP & url, const \fBQString\fP & description, bool applicationLocal = true, const \fBQString\fP & icon = QString::null, \fBKIcon::Group\fP group = KIcon::Panel)\fC [virtual]\fP"
.PP
Inserts a new item into the KURLBar and returns the created \fBKURLBarItem\fP. \fCurl\fP the url of the item \fCdescription\fP the description of the item (shown in the view) \fCapplicationLocal\fP whether this should be a global or a local item \fCicon\fP an icon -- if empty, the default icon for the url will be used \fCgroup\fP the icon-group for using icon-effects Definition at line 267 of file kurlbar.cpp.
.PP
References KStdAccel::description(), QListBox::insertItem(), and KURLBarItem::setApplicationLocal().
.PP
Referenced by readItem(), and slotDropped().
.SS "void KURLBar::setOrientation (Qt::Orientation orient)\fC [virtual]\fP"
.PP
The items can be arranged either vertically in one column or horizontally in one row. \fBSee also:\fP
.RS 4
\fBorientation\fP 
.RE
.PP
Definition at line 277 of file kurlbar.cpp.
.PP
References isVertical(), and KURLBarListBox::setOrientation().
.PP
Referenced by setListBox().
.SS "Qt::Orientation KURLBar::orientation () const"
.PP
\fBReturns:\fP
.RS 4
the current orientation mode. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetOrientation\fP 
.RE
.PP
Definition at line 288 of file kurlbar.cpp.
.PP
References KURLBarListBox::orientation().
.PP
Referenced by isVertical().
.SS "void KURLBar::setListBox (\fBKURLBarListBox\fP *)\fC [virtual]\fP"
.PP
Allows to set a custom \fBKURLBarListBox\fP. Note: The previous listbox will be deleted. Items of the previous listbox will not be moved to the new box. 
.PP
\fBSee also:\fP
.RS 4
\fBlistBox\fP 
.RE
.PP
Definition at line 293 of file kurlbar.cpp.
.PP
References QPalette::color(), QPalette::setColor(), setOrientation(), QListBox::setSelectionMode(), slotContextMenuRequested(), slotDropped(), and slotSelected().
.PP
Referenced by KURLBar().
.SS "\fBKURLBarListBox\fP* KURLBar::listBox () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the \fBKURLBarListBox\fP that is used. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetListBox\fP 
.RE
.PP
Definition at line 252 of file kurlbar.h.
.SS "void KURLBar::setIconSize (int size)\fC [virtual]\fP"
.PP
Sets the default iconsize to be used for items inserted with \fBinsertItem\fP. By default \fBKIcon::SizeMedium\fP. 
.PP
\fBSee also:\fP
.RS 4
#iconsize 
.RE
.PP
Definition at line 330 of file kurlbar.cpp.
.PP
References QListBox::firstItem(), KURLBarItem::icon(), KURLBarItem::iconGroup(), KURLBarItem::setIcon(), and sizeHint().
.PP
Referenced by slotContextMenuRequested().
.SS "int KURLBar::iconSize () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the default iconsize used for items inserted with \fBinsertItem\fP. By default \fBKIcon::SizeMedium\fP 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetIconSize\fP 
.RE
.PP
Definition at line 265 of file kurlbar.h.
.PP
Referenced by KURLBarItem::sizeHint().
.SS "void KURLBar::clear ()\fC [virtual]\fP"
.PP
Clears the view, removes all items. Definition at line 348 of file kurlbar.cpp.
.PP
References QListBox::clear().
.SS "\fBQSize\fP KURLBar::sizeHint () const\fC [virtual]\fP"
.PP
\fBReturns:\fP
.RS 4
a proper sizehint, depending on the orientation and number of items available. 
.RE
.PP
Definition at line 359 of file kurlbar.cpp.
.PP
References QListBox::firstItem(), QSize::height(), isVertical(), KURLBarItem::sizeHint(), and QSize::width().
.PP
Referenced by minimumSizeHint(), and setIconSize().
.SS "\fBQSize\fP KURLBar::minimumSizeHint () const\fC [virtual]\fP"
.PP
Definition at line 401 of file kurlbar.cpp.
.PP
References QSize::height(), sizeHint(), and QSize::width().
.SS "void KURLBar::readConfig (\fBKConfig\fP * config, const \fBQString\fP & itemGroup)\fC [virtual]\fP"
.PP
Call this method to read a saved configuration from \fCconfig\fP, inside the group \fCitemGroup\fP. All items in there will be restored. The reading of every item is delegated to the \fBreadItem\fP() method. Definition at line 470 of file kurlbar.cpp.
.PP
References KGlobal::config(), KConfigBase::groupIsImmutable(), m_isImmutable, m_useGlobal, readItem(), and KConfigBase::readNumEntry().
.SS "void KURLBar::writeConfig (\fBKConfig\fP * config, const \fBQString\fP & itemGroup)\fC [virtual]\fP"
.PP
Call this method to save the current configuration into \fCconfig\fP, inside the group \fCiconGroup\fP. The \fBwriteItem\fP() method is used to save each item. Definition at line 528 of file kurlbar.cpp.
.PP
References KURLBarItem::applicationLocal(), QListBox::firstItem(), m_isModified, m_useGlobal, KConfigBase::setGroup(), KConfigBase::writeEntry(), and writeItem().
.SS "void KURLBar::readItem (int i, \fBKConfig\fP * config, bool applicationLocal)\fC [virtual]\fP"
.PP
Called from \fBreadConfig\fP() to read the i'th from \fCconfig\fP. After reading a \fBKURLBarItem\fP is created and initialized with the read values (as well as the given \fCapplicationLocal\fP). Definition at line 513 of file kurlbar.cpp.
.PP
References insertItem(), KProtocolInfo::isKnownProtocol(), KURL::isMalformed(), QString::number(), KIO::number(), KConfigBase::readEntry(), and KConfigBase::readNumEntry().
.PP
Referenced by readConfig().
.SS "void KURLBar::writeItem (\fBKURLBarItem\fP * item, int i, \fBKConfig\fP *, bool global)\fC [virtual]\fP"
.PP
Called from \fBwriteConfig\fP() to save the \fBKURLBarItem\fP \fCitem\fP as the i'th entry in the config-object. \fCglobal\fP tell whether it should be saved in the global configuration or not (using KConfig::writeEntry( key, value, true, global ) ). Definition at line 574 of file kurlbar.cpp.
.PP
References KURLBarItem::description(), KURLBarItem::icon(), KURLBarItem::iconGroup(), KURL::isLocalFile(), QString::number(), KIO::number(), KURL::path(), KURL::prettyURL(), KURLBarItem::url(), KConfigBase::writeEntry(), and KConfigBase::writePathEntry().
.PP
Referenced by writeConfig().
.SS "\fBKURLBarItem\fP * KURLBar::currentItem () const"
.PP
\fBReturns:\fP
.RS 4
the current \fBKURLBarItem\fP, or 0L if none. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetCurrentItem\fP 
.PP
\fBcurrentURL\fP 
.RE
.PP
Definition at line 456 of file kurlbar.cpp.
.PP
References QListBox::currentItem(), and QListBox::item().
.PP
Referenced by currentURL().
.SS "\fBKURL\fP KURLBar::currentURL () const"
.PP
\fBReturns:\fP
.RS 4
the url of the current item or an invalid url, if there is no current item. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBcurrentItem\fP 
.PP
\fBsetCurrentItem\fP 
.RE
.PP
Definition at line 464 of file kurlbar.cpp.
.PP
References currentItem(), and KURLBarItem::url().
.SS "bool KURLBar::isModified () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
true when the urlbar was modified by the user (e.g. by editing/adding/removing one or more entries). Will be reset to false after calling \fBwriteConfig\fP(). 
.RE
.PP
Definition at line 328 of file kurlbar.h.
.PP
References m_isModified.
.SS "bool KURLBar::isImmutable () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
true when the urlbar may not be modified by the user 
.RE
.PP
Definition at line 333 of file kurlbar.h.
.PP
References m_isImmutable.
.SS "bool KURLBar::isVertical () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
true if the bar is in vertical mode. 
.RE
.PP
Definition at line 338 of file kurlbar.h.
.PP
References orientation().
.PP
Referenced by KURLBar(), setOrientation(), and sizeHint().
.SS "void KURLBar::setCurrentItem (const \fBKURL\fP & url)\fC [virtual, slot]\fP"
.PP
Makes the item with the url \fCurl\fP the current item. Does nothing if no item with that url is available. 
.PP
\fBSee also:\fP
.RS 4
\fBcurrentItem\fP 
.PP
\fBcurrentURL\fP 
.RE
.PP
Definition at line 428 of file kurlbar.cpp.
.PP
References QListBox::clearSelection(), QListBox::firstItem(), m_activeItem, QListBoxItem::next(), QListBox::setCurrentItem(), QListBox::setSelected(), KURLBarItem::url(), and KURL::url().
.PP
Referenced by slotContextMenuRequested().
.SS "void KURLBar::activated (const \fBKURL\fP & url)\fC [signal]\fP"
.PP
This signal is emitted when the user activated an item, e.g by clicking on it. Referenced by slotSelected().
.SS "bool KURLBar::addNewItem ()\fC [protected, virtual]\fP"
.PP
Pops up a \fBKURLBarItemDialog\fP to let the user add a new item. Uses \fBeditItem\fP() to do the job. 
.PP
\fBReturns:\fP
.RS 4
false if the user aborted the dialog and no item is added. 
.RE
.PP
Definition at line 669 of file kurlbar.cpp.
.PP
References editItem(), and QListBox::insertItem().
.PP
Referenced by slotContextMenuRequested().
.SS "bool KURLBar::editItem (\fBKURLBarItem\fP * item)\fC [protected, virtual]\fP"
.PP
Pops up a \fBKURLBarItemDialog\fP to let the user edit the properties of \fCitem\fP. Invoked e.g. by \fBaddNewItem\fP(), when the user drops a url onto the bar or from the contextmenu. 
.PP
\fBReturns:\fP
.RS 4
false if the user aborted the dialog and \fCitem\fP is not changed. 
.RE
.PP
Definition at line 682 of file kurlbar.cpp.
.PP
References KURLBarItem::applicationLocal(), KURLBarItem::description(), KStdAccel::description(), KURLBarItemDialog::getInformation(), KURLBarItem::icon(), m_isModified, m_useGlobal, KURLBarItem::setApplicationLocal(), KURLBarItem::setDescription(), KURLBarItem::setIcon(), KURLBarItem::setURL(), QListBox::triggerUpdate(), and KURLBarItem::url().
.PP
Referenced by addNewItem(), and slotContextMenuRequested().
.SS "void KURLBar::resizeEvent (\fBQResizeEvent\fP *)\fC [protected, virtual]\fP"
.PP
Reimplemented from \fBQFrame\fP.
.PP
Definition at line 353 of file kurlbar.cpp.
.PP
References QFrame::resizeEvent().
.SS "void KURLBar::slotContextMenuRequested (\fBQListBoxItem\fP *, const \fBQPoint\fP & pos)\fC [protected, virtual, slot]\fP"
.PP
Reimplemented to show a contextmenu, allowing the user to add, edit or remove items, or change the iconsize. Definition at line 618 of file kurlbar.cpp.
.PP
References addNewItem(), editItem(), QPopupMenu::exec(), QPopupMenu::insertItem(), QPopupMenu::insertSeparator(), m_activeItem, m_isImmutable, m_isModified, setCurrentItem(), setIconSize(), QPopupMenu::setItemEnabled(), KIcon::SizeMedium, KIcon::SizeSmall, QListBox::triggerUpdate(), and KURLBarItem::url().
.PP
Referenced by setListBox().
.SS "void KURLBar::slotSelected (\fBQListBoxItem\fP *)\fC [protected, virtual, slot]\fP"
.PP
Called when an item has been selected. Emits the \fBactivated\fP() signal. Definition at line 417 of file kurlbar.cpp.
.PP
References activated(), m_activeItem, QListBox::setCurrentItem(), and KURLBarItem::url().
.PP
Referenced by setListBox().
.SS "void KURLBar::slotDropped (\fBQDropEvent\fP *)\fC [protected, virtual, slot]\fP"
.PP
Called when a url was dropped onto the bar to show a \fBKURLBarItemDialog\fP. Definition at line 594 of file kurlbar.cpp.
.PP
References QValueList< KURL >::begin(), KURLDrag::decode(), KStdAccel::description(), QValueList< KURL >::end(), KURLBarItemDialog::getInformation(), insertItem(), QValueList< KURL >::Iterator(), m_isModified, and m_useGlobal.
.PP
Referenced by setListBox().
.SH "Member Data Documentation"
.PP 
.SS "\fBKURLBarItem\fP* \fBKURLBar::m_activeItem\fP\fC [protected]\fP"
.PP
The currently active item. Definition at line 379 of file kurlbar.h.
.PP
Referenced by KURLBar(), setCurrentItem(), slotContextMenuRequested(), and slotSelected().
.SS "bool \fBKURLBar::m_useGlobal\fP\fC [protected]\fP"
.PP
Whether we support global entries or just local ones. Definition at line 383 of file kurlbar.h.
.PP
Referenced by editItem(), KURLBar(), readConfig(), slotDropped(), and writeConfig().
.SS "bool \fBKURLBar::m_isModified\fP\fC [protected]\fP"
.PP
Whether the urlbar was modified by the user (e.g. by editing/adding/removing an item). Definition at line 389 of file kurlbar.h.
.PP
Referenced by editItem(), isModified(), KURLBar(), slotContextMenuRequested(), slotDropped(), and writeConfig().
.SS "bool \fBKURLBar::m_isImmutable\fP\fC [protected]\fP"
.PP
Whether the urlbar may be modified by the user. If immutable is true, the urlbar can not be modified. Definition at line 395 of file kurlbar.h.
.PP
Referenced by isImmutable(), KURLBar(), readConfig(), and slotContextMenuRequested().

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