kio Library API Documentation

KURLBarItem Class Reference

An item to be used in KURLBar / KURLBarListBox. More...

#include <kurlbar.h>

Inheritance diagram for KURLBarItem:

Inheritance graph
[legend]
Collaboration diagram for KURLBarItem:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 KURLBarItem (KURLBar *parent, const KURL &url, bool persistent, const QString &description=QString::null, const QString &icon=QString::null, KIcon::Group group=KIcon::Panel)
 KURLBarItem (KURLBar *parent, const KURL &url, const QString &description=QString::null, const QString &icon=QString::null, KIcon::Group group=KIcon::Panel)
 ~KURLBarItem ()
void setURL (const KURL &url)
void setIcon (const QString &icon, KIcon::Group group=KIcon::Panel)
void setDescription (const QString &desc)
void setToolTip (const QString &tip)
QSize sizeHint () const
virtual int width (const QListBox *) const
virtual int height (const QListBox *) const
const KURLurl () const
const QStringdescription () const
const QStringicon () const
QString toolTip () const
KIcon::Group iconGroup () const
virtual const QPixmappixmap () const
void setApplicationLocal (bool local)
bool applicationLocal () const
bool isPersistent () const

Protected Member Functions

virtual void paint (QPainter *p)
virtual void virtual_hook (int id, void *data)

Detailed Description

An item to be used in KURLBar / KURLBarListBox.

All the properties (url, icon, description, tooltip) can be changed dynamically.

Author:
Carsten Pfeiffer <pfeiffer@kde.org>
See also:
KURLBar

KURLBarListBox

Definition at line 42 of file kurlbar.h.


Constructor & Destructor Documentation

KURLBarItem::KURLBarItem KURLBar parent,
const KURL url,
bool  persistent,
const QString description = QString::null,
const QString icon = QString::null,
KIcon::Group  group = KIcon::Panel
 

Creates a KURLBarItem to be used in the parent KURLBar.

You need to insert the item into the listbox manually, if you don't use KURLBar::insertItem().

If description is empty, it will try to use the filename/directory of url, which will be shown as text of the item. url will be used as tooltip, unless you set a different tip with setToolTip(). persistent specifies whether this item is a persistent item or a dynamic item, that is not saved with KURLBar::writeConfig().

Since:
3.2

Definition at line 88 of file kurlbar.cpp.

KURLBarItem::KURLBarItem KURLBar parent,
const KURL url,
const QString description = QString::null,
const QString icon = QString::null,
KIcon::Group  group = KIcon::Panel
 

Creates a persistent KURLBarItem to be used in the parent KURLBar.

You need to insert the item into the listbox manually, if you don't use KURLBar::insertItem().

If description is empty, it will try to use the filename/directory of url, which will be shown as text of the item. url will be used as tooltip, unless you set a different tip with setToolTip(). persistent specifies whether this item is a persistent item or a dynamic item, that is not saved with KURLBar::writeConfig().

Definition at line 100 of file kurlbar.cpp.

KURLBarItem::~KURLBarItem  ) 
 

Destroys the item.

Definition at line 123 of file kurlbar.cpp.


Member Function Documentation

void KURLBarItem::setURL const KURL url  ) 
 

Sets url for this item.

Also updates the visible text to the filename/directory of the url, if no description is set.

See also:
url

Definition at line 128 of file kurlbar.cpp.

References KURL::fileName().

Referenced by KURLBar::editItem().

void KURLBarItem::setIcon const QString icon,
KIcon::Group  group = KIcon::Panel
 

sets the icon for this item.

See KIconLoader for a description of the icon groups.

See also:
icon

Definition at line 135 of file kurlbar.cpp.

References KGlobal::iconLoader(), KIconLoader::loadIcon(), and KMimeType::pixmapForURL().

Referenced by KURLBar::editItem(), and KURLBar::setIconSize().

void KURLBarItem::setDescription const QString desc  ) 
 

Sets the description of this item that will be shown as item-text.

See also:
description

Definition at line 147 of file kurlbar.cpp.

References KURL::fileName().

Referenced by KURLBar::editItem().

void KURLBarItem::setToolTip const QString tip  ) 
 

Sets a tooltip to be used for this item.

See also:
toolTip

Definition at line 164 of file kurlbar.cpp.

QSize KURLBarItem::sizeHint  )  const
 

returns the preferred size of this item

Since:
3.1

Definition at line 269 of file kurlbar.cpp.

References KURLBar::iconSize(), KURLBarListBox::isVertical(), pixmap(), and KDialog::spacingHint().

Referenced by height(), KURLBar::sizeHint(), and width().

int KURLBarItem::width const QListBox  )  const [virtual]
 

returns the width of this item.

Definition at line 292 of file kurlbar.cpp.

References sizeHint().

int KURLBarItem::height const QListBox  )  const [virtual]
 

returns the height of this item.

Definition at line 300 of file kurlbar.cpp.

References sizeHint().

const KURL& KURLBarItem::url  )  const [inline]
 

returns the url of this item.

See also:
setURL

Definition at line 127 of file kurlbar.h.

Referenced by KURLBar::currentURL(), KURLBarListBox::dragObject(), KURLBar::editItem(), KURLBar::setCurrentItem(), KURLBar::slotContextMenuRequested(), KURLBar::slotSelected(), KFileDialog::toggleSpeedbar(), and KURLBar::writeItem().

const QString& KURLBarItem::description  )  const [inline]
 

returns the description of this item.

See also:
setDescription

Definition at line 132 of file kurlbar.h.

Referenced by KURLBar::editItem(), and KURLBar::writeItem().

const QString& KURLBarItem::icon  )  const [inline]
 

returns the icon of this item.

See also:
setIcon

Definition at line 137 of file kurlbar.h.

Referenced by KURLBar::editItem(), KURLBar::setIconSize(), and KURLBar::writeItem().

QString KURLBarItem::toolTip  )  const
 

returns the tooltip of this item.

See also:
setToolTip

Definition at line 169 of file kurlbar.cpp.

References KURL::prettyURL().

KIcon::Group KURLBarItem::iconGroup  )  const [inline]
 

returns the icon-group of this item (determines icon-effects).

See also:
setIcon

Definition at line 147 of file kurlbar.h.

Referenced by KURLBar::setIconSize(), and KURLBar::writeItem().

virtual const QPixmap* KURLBarItem::pixmap  )  const [inline, virtual]
 

returns the pixmap of this item.

Definition at line 151 of file kurlbar.h.

Referenced by sizeHint().

void KURLBarItem::setApplicationLocal bool  local  ) 
 

Makes this item a local or global one.

This has only an effect on persistent items of course.

See also:
isPersistent

applicationLocal

Definition at line 153 of file kurlbar.cpp.

References isPersistent(), and kdWarning().

Referenced by KURLBar::editItem(), and KURLBar::insertItem().

bool KURLBarItem::applicationLocal  )  const [inline]
 

returns whether this is a global item or a local one.

KURLBar can differentiate between global and local items (only for the current application) for easy extensiblity.

See also:
setApplicationLocal

Definition at line 167 of file kurlbar.h.

Referenced by KURLBar::editItem(), and KURLBar::writeConfig().

bool KURLBarItem::isPersistent  )  const
 

returns whether this item is persistent (via KURLBar::writeConfig() and KURLBar::readConfig()) or not.

Since:
3.2

Definition at line 308 of file kurlbar.cpp.

Referenced by KURLBar::editItem(), setApplicationLocal(), KURLBar::slotContextMenuRequested(), KURLBar::writeConfig(), and KURLBar::writeItem().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kio Library Version 3.4.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Apr 28 01:38:13 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003