.TH "KURLBar" kde3 "11 Jun 2005" "Version Version 3.4.1" "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
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBactivated\fP (const \fBKURL\fP &url)"
.br
.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
.ti -1c
.RI "\fB~KURLBar\fP ()"
.br
.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=\fBKIcon::Panel\fP)"
.br
.ti -1c
.RI "virtual \fBKURLBarItem\fP * \fBinsertDynamicItem\fP (const \fBKURL\fP &url, const \fBQString\fP &description, const \fBQString\fP &icon=QString::null, \fBKIcon::Group\fP group=\fBKIcon::Panel\fP)"
.br
.ti -1c
.RI "virtual void \fBsetOrientation\fP (Qt::Orientation orient)"
.br
.ti -1c
.RI "Orientation \fBorientation\fP () const "
.br
.ti -1c
.RI "virtual void \fBsetListBox\fP (\fBKURLBarListBox\fP *)"
.br
.ti -1c
.RI "\fBKURLBarListBox\fP * \fBlistBox\fP () const "
.br
.ti -1c
.RI "virtual void \fBsetIconSize\fP (int size)"
.br
.ti -1c
.RI "int \fBiconSize\fP () const "
.br
.ti -1c
.RI "virtual void \fBclear\fP ()"
.br
.ti -1c
.RI "virtual \fBQSize\fP \fBsizeHint\fP () const "
.br
.ti -1c
.RI "virtual \fBQSize\fP \fBminimumSizeHint\fP () const "
.br
.ti -1c
.RI "virtual void \fBreadConfig\fP (\fBKConfig\fP *config, const \fBQString\fP &itemGroup)"
.br
.ti -1c
.RI "virtual void \fBwriteConfig\fP (\fBKConfig\fP *config, const \fBQString\fP &itemGroup)"
.br
.ti -1c
.RI "virtual void \fBreadItem\fP (int i, \fBKConfig\fP *config, bool applicationLocal)"
.br
.ti -1c
.RI "virtual void \fBwriteItem\fP (\fBKURLBarItem\fP *item, int i, \fBKConfig\fP *, bool global)"
.br
.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
.ti -1c
.RI "virtual void \fBslotSelected\fP (\fBQListBoxItem\fP *)"
.br
.ti -1c
.RI "virtual void \fBslotDropped\fP (\fBQDropEvent\fP *)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual bool \fBaddNewItem\fP ()"
.br
.ti -1c
.RI "virtual bool \fBeditItem\fP (\fBKURLBarItem\fP *item)"
.br
.ti -1c
.RI "virtual void \fBresizeEvent\fP (\fBQResizeEvent\fP *)"
.br
.ti -1c
.RI "virtual void \fBpaletteChange\fP (const \fBQPalette\fP &)"
.br
.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
.ti -1c
.RI "bool \fBm_useGlobal\fP:1"
.br
.ti -1c
.RI "bool \fBm_isModified\fP:1"
.br
.ti -1c
.RI "bool \fBm_isImmutable\fP:1"
.br
.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 cause the \fBactivated()\fP signal to be 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 230 of file kurlbar.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KURLBar::KURLBar (bool useGlobalItems, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP, WFlags f = \fC0\fP)"
.PP
Constructs a KURLBar. 
.PP
Set \fCuseGlobalItems\fP to true if you want to allow global/local item separation. 
.PP
Definition at line 330 of file kurlbar.cpp.
.PP
References QWhatsThis::add(), isVertical(), m_activeItem, m_isImmutable, m_isModified, m_useGlobal, and setListBox().
.SS "KURLBar::~\fBKURLBar\fP ()"
.PP
Destroys the KURLBar. 
.PP
Definition at line 353 of file kurlbar.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBKURLBarItem\fP * KURLBar::insertItem (const \fBKURL\fP & url, const \fBQString\fP & description, bool applicationLocal = \fCtrue\fP, const \fBQString\fP & icon = \fCQString::null\fP, \fBKIcon::Group\fP group = \fC\fBKIcon::Panel\fP\fP)\fC [virtual]\fP"
.PP
Inserts a new item into the KURLBar and returns the created \fBKURLBarItem\fP. 
.PP
\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 
.PP
Definition at line 358 of file kurlbar.cpp.
.PP
References QListBox::insertItem(), and KURLBarItem::setApplicationLocal().
.PP
Referenced by readItem(), and slotDropped().
.SS "\fBKURLBarItem\fP * KURLBar::insertDynamicItem (const \fBKURL\fP & url, const \fBQString\fP & description, const \fBQString\fP & icon = \fCQString::null\fP, \fBKIcon::Group\fP group = \fC\fBKIcon::Panel\fP\fP)\fC [virtual]\fP"
.PP
Inserts a new dynamic item into the KURLBar and returns the created \fBKURLBarItem\fP. 
.PP
\fCurl\fP the url of the item \fCdescription\fP the description of the item (shown in the view) \fCicon\fP an icon -- if empty, the default icon for the url will be used \fCgroup\fP the icon-group for using icon-effects 
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 368 of file kurlbar.cpp.
.PP
References QListBox::insertItem().
.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. 
.PP
\fBSee also:\fP
.RS 4
\fBorientation\fP 
.RE
.PP

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

.PP
Definition at line 387 of file kurlbar.cpp.
.PP
References KURLBarListBox::orientation().
.SS "void KURLBar::setListBox (\fBKURLBarListBox\fP *)\fC [virtual]\fP"
.PP
Allows to set a custom \fBKURLBarListBox\fP. 
.PP
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

.PP
Definition at line 392 of file kurlbar.cpp.
.PP
References 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

.PP
Definition at line 298 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 insertItem. 
.PP
By default \fBKIcon::SizeMedium\fP. 
.PP
\fBSee also:\fP
.RS 4
iconsize 
.RE
.PP

.PP
Definition at line 422 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 insertItem. By default \fBKIcon::SizeMedium\fP 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetIconSize\fP 
.RE
.PP

.PP
Definition at line 311 of file kurlbar.h.
.PP
Referenced by KURLBarItem::sizeHint().
.SS "void KURLBar::clear ()\fC [virtual]\fP"
.PP
Clears the view, removes all items. 
.PP
Definition at line 440 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 the number of items available. 
.RE
.PP

.PP
Definition at line 467 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
\fBReturns:\fP
.RS 4
a proper minimum size (reimplemented) 
.RE
.PP

.PP
Definition at line 509 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. 
.PP
All items in there will be restored. The reading of every item is delegated to the \fBreadItem()\fP method. 
.PP
Definition at line 578 of file kurlbar.cpp.
.PP
References KGlobal::config(), 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. 
.PP
The \fBwriteItem()\fP method is used to save each item. 
.PP
Definition at line 616 of file kurlbar.cpp.
.PP
References KURLBarItem::applicationLocal(), QListBox::firstItem(), KURLBarItem::isPersistent(), m_isModified, m_useGlobal, 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. 
.PP
After reading a \fBKURLBarItem\fP is created and initialized with the read values (as well as the given \fCapplicationLocal\fP). 
.PP
Definition at line 601 of file kurlbar.cpp.
.PP
References KURL::fromPathOrURL(), insertItem(), KProtocolInfo::isKnownProtocol(), KURL::isValid(), and QString::number().
.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. 
.PP
\fCglobal\fP tell whether it should be saved in the global configuration or not (using KConfig::writeEntry( key, value, true, global ) ). 
.PP
Definition at line 675 of file kurlbar.cpp.
.PP
References QString::number().
.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

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

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

.PP
Definition at line 375 of file kurlbar.h.
.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

.PP
Definition at line 380 of file kurlbar.h.
.SS "bool KURLBar::isVertical () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
true if the bar is in vertical mode. 
.RE
.PP

.PP
Definition at line 385 of file kurlbar.h.
.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. 
.PP
Does nothing if no item with that url is available. 
.PP
\fBSee also:\fP
.RS 4
\fBcurrentItem\fP 
.PP
\fBcurrentURL\fP 
.RE
.PP

.PP
Definition at line 536 of file kurlbar.cpp.
.PP
References QListBox::clearSelection(), QListBox::firstItem(), m_activeItem, QListBox::setCurrentItem(), QListBox::setSelected(), KURL::url(), and KURLBarItem::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. 
.PP
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. 
.PP
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

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

.PP
Definition at line 786 of file kurlbar.cpp.
.PP
References m_isModified, m_useGlobal, QListBox::triggerUpdate(), and KURLBarItem::url().
.PP
Referenced by addNewItem(), and slotContextMenuRequested().
.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. 
.PP
Definition at line 713 of file kurlbar.cpp.
.PP
References addNewItem(), editItem(), QPopupMenu::exec(), QPopupMenu::insertItem(), QPopupMenu::insertSeparator(), KURLBarItem::isPersistent(), m_activeItem, m_isImmutable, m_isModified, setCurrentItem(), setIconSize(), 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. 
.PP
Emits the \fBactivated()\fP signal. 
.PP
Definition at line 525 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. 
.PP
Definition at line 695 of file kurlbar.cpp.
.PP
References QValueList::begin(), QValueList::end(), insertItem(), and m_isModified.
.PP
Referenced by setListBox().
.SH "Member Data Documentation"
.PP 
.SS "\fBKURLBarItem\fP* \fBKURLBar::m_activeItem\fP\fC [protected]\fP"
.PP
The currently active item. 
.PP
Definition at line 426 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. 
.PP
Definition at line 430 of file kurlbar.h.
.PP
Referenced by editItem(), KURLBar(), readConfig(), and writeConfig().
.SS "bool \fBKURLBar::m_isModified\fP\fC [protected]\fP"
.PP
Whether the urlbar was modified by the user (e.g. 
.PP
by editing/adding/removing an item). 
.PP
Definition at line 436 of file kurlbar.h.
.PP
Referenced by editItem(), KURLBar(), slotContextMenuRequested(), slotDropped(), and writeConfig().
.SS "bool \fBKURLBar::m_isImmutable\fP\fC [protected]\fP"
.PP
Whether the urlbar may be modified by the user. 
.PP
If immutable is true, the urlbar can not be modified. 
.PP
Definition at line 442 of file kurlbar.h.
.PP
Referenced by KURLBar(), readConfig(), and slotContextMenuRequested().

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