KURLBar Class Reference
KURLBar is a widget that displays icons together with a description. A URL-bar widget, as used in the KFileDialog. More...
#include <kurlbar.h>
Inheritance diagram for KURLBar:

Public Slots | |
virtual void | setCurrentItem (const KURL &url) |
Signals | |
void | activated (const KURL &url) |
Public Member Functions | |
KURLBar (bool useGlobalItems, QWidget *parent=0, const char *name=0, WFlags f=0) | |
~KURLBar () | |
virtual KURLBarItem * | insertItem (const KURL &url, const QString &description, bool applicationLocal=true, const QString &icon=QString::null, KIcon::Group group=KIcon::Panel) |
virtual KURLBarItem * | insertDynamicItem (const KURL &url, const QString &description, const QString &icon=QString::null, KIcon::Group group=KIcon::Panel) |
virtual void | setOrientation (Qt::Orientation orient) |
Orientation | orientation () const |
virtual void | setListBox (KURLBarListBox *) |
KURLBarListBox * | listBox () const |
virtual void | setIconSize (int size) |
int | iconSize () const |
virtual void | clear () |
virtual QSize | sizeHint () const |
virtual QSize | minimumSizeHint () const |
virtual void | readConfig (KConfig *config, const QString &itemGroup) |
virtual void | writeConfig (KConfig *config, const QString &itemGroup) |
virtual void | readItem (int i, KConfig *config, bool applicationLocal) |
virtual void | writeItem (KURLBarItem *item, int i, KConfig *, bool global) |
KURLBarItem * | currentItem () const |
KURL | currentURL () const |
bool | isModified () const |
bool | isImmutable () const |
bool | isVertical () const |
Protected Slots | |
virtual void | slotContextMenuRequested (QListBoxItem *, const QPoint &pos) |
virtual void | slotSelected (QListBoxItem *) |
virtual void | slotDropped (QDropEvent *) |
Protected Member Functions | |
virtual bool | addNewItem () |
virtual bool | editItem (KURLBarItem *item) |
virtual void | resizeEvent (QResizeEvent *) |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
KURLBarItem * | m_activeItem |
bool | m_useGlobal:1 |
bool | m_isModified:1 |
bool | m_isImmutable:1 |
Detailed Description
KURLBar is a widget that displays icons together with a description. A URL-bar widget, as used in the KFileDialog.They can be arranged either horizontally or vertically. Clicking on an item will cause the activated() 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).
KURLBar offers the methods readConfig() and writeConfig() 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 KConfig object.
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.
The widget has a "current" item, that is visualized to differentiate it from others.
- Author:
- Carsten Pfeiffer <pfeiffer@kde.org>
Definition at line 230 of file kurlbar.h.
Constructor & Destructor Documentation
|
Constructs a KURLBar.
Set References isVertical(), m_activeItem, m_isImmutable, m_isModified, m_useGlobal, and setListBox(). |
|
Destroys the KURLBar. Definition at line 320 of file kurlbar.cpp. |
Member Function Documentation
|
Inserts a new item into the KURLBar and returns the created KURLBarItem.
References KURL::protocol(), and KURLBarItem::setApplicationLocal(). Referenced by readItem(), and slotDropped(). |
|
Inserts a new dynamic item into the KURLBar and returns the created KURLBarItem.
|
|
The items can be arranged either vertically in one column or horizontally in one row.
References isVertical(), and KURLBarListBox::setOrientation(). Referenced by setListBox(). |
|
References KURLBarListBox::orientation(). |
|
Allows to set a custom KURLBarListBox. Note: The previous listbox will be deleted. Items of the previous listbox will not be moved to the new box.
References setOrientation(), slotContextMenuRequested(), slotDropped(), and slotSelected(). Referenced by KURLBar(). |
|
|
|
Sets the default iconsize to be used for items inserted with insertItem. By default KIcon::SizeMedium.
References KURLBarItem::icon(), KURLBarItem::iconGroup(), KURLBarItem::setIcon(), and sizeHint(). Referenced by slotContextMenuRequested(). |
|
Referenced by KURLBarItem::sizeHint(). |
|
Clears the view, removes all items. Definition at line 425 of file kurlbar.cpp. |
|
References isVertical(), and KURLBarItem::sizeHint(). Referenced by minimumSizeHint(), and setIconSize(). |
|
References sizeHint(). |
|
Call this method to read a saved configuration from All items in there will be restored. The reading of every item is delegated to the readItem() method. Definition at line 547 of file kurlbar.cpp. References KGlobal::config(), KConfigBase::groupIsImmutable(), m_isImmutable, m_useGlobal, readItem(), and KConfigBase::readNumEntry(). |
|
Call this method to save the current configuration into The writeItem() method is used to save each item. Definition at line 584 of file kurlbar.cpp. References KURLBarItem::applicationLocal(), KURLBarItem::isPersistent(), m_isModified, m_useGlobal, KConfigBase::setGroup(), KConfigBase::writeEntry(), and writeItem(). |
|
Called from readConfig() to read the i'th from
After reading a KURLBarItem is created and initialized with the read values (as well as the given References KURL::fromPathOrURL(), insertItem(), KProtocolInfo::isKnownProtocol(), KURL::isValid(), KConfigBase::readEntry(), KConfigBase::readNumEntry(), and KConfigBase::readPathEntry(). Referenced by readConfig(). |
|
Called from writeConfig() to save the KURLBarItem
References KURLBarItem::description(), KURLBarItem::icon(), KURLBarItem::iconGroup(), KURLBarItem::isPersistent(), KURL::prettyURL(), KURLBarItem::url(), KConfigBase::writeEntry(), and KConfigBase::writePathEntry(). Referenced by writeConfig(). |
|
Referenced by currentURL(). |
|
References currentItem(), and KURLBarItem::url(). |
|
|
|
|
|
Referenced by KURLBar(), setOrientation(), and sizeHint(). |
|
Makes the item with the url Does nothing if no item with that url is available.
References m_activeItem, KURLBarItem::url(), and KURL::url(). Referenced by slotContextMenuRequested(). |
|
This signal is emitted when the user activated an item, e.g., by clicking on it.
Referenced by slotSelected(). |
|
Pops up a KURLBarItemDialog to let the user add a new item. Uses editItem() to do the job.
References editItem(). Referenced by slotContextMenuRequested(). |
|
Pops up a KURLBarItemDialog to let the user edit the properties of Invoked e.g. by addNewItem(), when the user drops a url onto the bar or from the contextmenu.
References KURLBarItem::applicationLocal(), KURLBarItem::description(), KURLBarItemDialog::getInformation(), KURLBarItem::icon(), KURLBarItem::isPersistent(), m_isModified, m_useGlobal, KURLBarItem::setApplicationLocal(), KURLBarItem::setDescription(), KURLBarItem::setIcon(), KURLBarItem::setURL(), and KURLBarItem::url(). Referenced by addNewItem(), and slotContextMenuRequested(). |
|
Reimplemented to show a contextmenu, allowing the user to add, edit or remove items, or change the iconsize. Definition at line 684 of file kurlbar.cpp. References addNewItem(), editItem(), KURLBarItem::isPersistent(), m_activeItem, m_isImmutable, m_isModified, setCurrentItem(), setIconSize(), and KURLBarItem::url(). Referenced by setListBox(). |
|
Called when an item has been selected. Emits the activated() signal. Definition at line 494 of file kurlbar.cpp. References activated(), m_activeItem, and KURLBarItem::url(). Referenced by setListBox(). |
|
Called when a url was dropped onto the bar to show a KURLBarItemDialog. Definition at line 660 of file kurlbar.cpp. References KURLDrag::decode(), KURLBarItemDialog::getInformation(), insertItem(), m_isModified, and m_useGlobal. Referenced by setListBox(). |
Member Data Documentation
|
The currently active item. Definition at line 424 of file kurlbar.h. Referenced by KURLBar(), setCurrentItem(), slotContextMenuRequested(), and slotSelected(). |
|
Whether we support global entries or just local ones. Definition at line 428 of file kurlbar.h. Referenced by editItem(), KURLBar(), readConfig(), slotDropped(), and writeConfig(). |
|
Whether the urlbar was modified by the user (e.g. by editing/adding/removing an item). Definition at line 434 of file kurlbar.h. Referenced by editItem(), KURLBar(), slotContextMenuRequested(), slotDropped(), and writeConfig(). |
|
Whether the urlbar may be modified by the user. If immutable is true, the urlbar can not be modified. Definition at line 440 of file kurlbar.h. Referenced by KURLBar(), readConfig(), and slotContextMenuRequested(). |
The documentation for this class was generated from the following files: