org.kde.koala

Class KURLBar

public class KURLBar extends QFrame

KURLBar is a widget that displays icons together with a description. 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. See KURLBarSignals for signals emitted by KURLBar

Author: Carsten Pfeiffer

UNKNOWN: A URL-bar widget, as used in the KFileDialog.

Constructor Summary
protected KURLBar(Class dummy)
KURLBar(boolean useGlobalItems, QWidget parent, String name, int f)
Constructs a KURLBar.
KURLBar(boolean useGlobalItems, QWidget parent, String name)
KURLBar(boolean useGlobalItems, QWidget parent)
KURLBar(boolean useGlobalItems)
Method Summary
protected booleanaddNewItem()
Pops up a KURLBarItemDialog to let the user add a new item.
StringclassName()
voidclear()
Clears the view, removes all items.
KURLBarItemcurrentItem()
KURLcurrentURL()
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected booleaneditItem(KURLBarItem item)
Pops up a KURLBarItemDialog to let the user edit the properties of item. Invoked e.g. by addNewItem(), when the user drops a url onto the bar or from the contextmenu.
protected voidfinalize()
Deletes the wrapped C++ instance
inticonSize()
KURLBarIteminsertDynamicItem(KURL url, String description, String icon, int group)
Inserts a new dynamic item into the KURLBar and returns the created KURLBarItem.
KURLBarIteminsertDynamicItem(KURL url, String description, String icon)
KURLBarIteminsertDynamicItem(KURL url, String description)
KURLBarIteminsertItem(KURL url, String description, boolean applicationLocal, String icon, int group)
Inserts a new item into the KURLBar and returns the created KURLBarItem.
KURLBarIteminsertItem(KURL url, String description, boolean applicationLocal, String icon)
KURLBarIteminsertItem(KURL url, String description, boolean applicationLocal)
KURLBarIteminsertItem(KURL url, String description)
booleanisDisposed()
Has the wrapped C++ instance been deleted?
booleanisImmutable()
booleanisModified()
booleanisVertical()
KURLBarListBoxlistBox()
QMetaObjectmetaObject()
QSizeminimumSizeHint()
intorientation()
protected voidpaletteChange(QPalette arg1)
voidreadConfig(KConfig config, String itemGroup)
Call this method to read a saved configuration from config, inside the group itemGroup. All items in there will be restored.
voidreadItem(int i, KConfig config, boolean applicationLocal)
Called from readConfig() to read the i'th from config. After reading a KURLBarItem is created and initialized with the read values (as well as the given applicationLocal).
protected voidresizeEvent(QResizeEvent arg1)
voidsetCurrentItem(KURL url)
Makes the item with the url url the current item.
voidsetIconSize(int size)
Sets the default iconsize to be used for items inserted with insertItem.
voidsetListBox(KURLBarListBox arg1)
Allows to set a custom KURLBarListBox.
voidsetOrientation(int orient)
The items can be arranged either vertically in one column or horizontally in one row.
QSizesizeHint()
protected voidslotContextMenuRequested(QListBoxItem arg1, QPoint pos)
Reimplemented to show a contextmenu, allowing the user to add, edit or remove items, or change the iconsize.
protected voidslotDropped(QDropEvent arg1)
Called when a url was dropped onto the bar to show a KURLBarItemDialog.
protected voidslotSelected(QListBoxItem arg1)
Called when an item has been selected.
voidwriteConfig(KConfig config, String itemGroup)
Call this method to save the current configuration into config, inside the group iconGroup. The writeItem() method is used to save each item.
voidwriteItem(KURLBarItem item, int i, KConfig arg3, boolean global)
Called from writeConfig() to save the KURLBarItem item as the i'th entry in the config-object.

Constructor Detail

KURLBar

protected KURLBar(Class dummy)

KURLBar

public KURLBar(boolean useGlobalItems, QWidget parent, String name, int f)
Constructs a KURLBar. Set useGlobalItems to true if you want to allow global/local item separation.

UNKNOWN: Constructs a KURLBar.

KURLBar

public KURLBar(boolean useGlobalItems, QWidget parent, String name)

KURLBar

public KURLBar(boolean useGlobalItems, QWidget parent)

KURLBar

public KURLBar(boolean useGlobalItems)

Method Detail

addNewItem

protected boolean addNewItem()
Pops up a KURLBarItemDialog to let the user add a new item. Uses editItem() to do the job.

Returns: false if the user aborted the dialog and no item is added.

UNKNOWN: Pops up a KURLBarItemDialog to let the user add a new item.

className

public String className()

clear

public void clear()
Clears the view, removes all items.

UNKNOWN: Clears the view, removes all items.

currentItem

public KURLBarItem currentItem()

Returns: the current KURLBarItem, or 0L if none.

See Also: KURLBar KURLBar

UNKNOWN:

currentURL

public KURL currentURL()

Returns: the url of the current item or an invalid url, if there is no current item.

See Also: KURLBar KURLBar

UNKNOWN:

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

editItem

protected boolean editItem(KURLBarItem item)
Pops up a KURLBarItemDialog to let the user edit the properties of item. Invoked e.g. by addNewItem(), when the user drops a url onto the bar or from the contextmenu.

Returns: false if the user aborted the dialog and item is not changed.

UNKNOWN: Pops up a KURLBarItemDialog to let the user edit the properties of item.

finalize

protected void finalize()
Deletes the wrapped C++ instance

iconSize

public int iconSize()

Returns: the default iconsize used for items inserted with insertItem. By default KIcon.SizeMedium

See Also: KURLBar

UNKNOWN:

insertDynamicItem

public KURLBarItem insertDynamicItem(KURL url, String description, String icon, int group)
Inserts a new dynamic item into the KURLBar and returns the created KURLBarItem. url the url of the item description the description of the item (shown in the view) icon an icon -- if empty, the default icon for the url will be used group the icon-group for using icon-effects

UNKNOWN: Inserts a new dynamic item into the KURLBar and returns the created KURLBarItem.

insertDynamicItem

public KURLBarItem insertDynamicItem(KURL url, String description, String icon)

insertDynamicItem

public KURLBarItem insertDynamicItem(KURL url, String description)

insertItem

public KURLBarItem insertItem(KURL url, String description, boolean applicationLocal, String icon, int group)
Inserts a new item into the KURLBar and returns the created KURLBarItem. url the url of the item description the description of the item (shown in the view) applicationLocal whether this should be a global or a local item icon an icon -- if empty, the default icon for the url will be used group the icon-group for using icon-effects

UNKNOWN: Inserts a new item into the KURLBar and returns the created KURLBarItem.

insertItem

public KURLBarItem insertItem(KURL url, String description, boolean applicationLocal, String icon)

insertItem

public KURLBarItem insertItem(KURL url, String description, boolean applicationLocal)

insertItem

public KURLBarItem insertItem(KURL url, String description)

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

isImmutable

public boolean isImmutable()

Returns: true when the urlbar may not be modified by the user

UNKNOWN:

isModified

public boolean isModified()

Returns: 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 writeConfig().

UNKNOWN:

isVertical

public boolean isVertical()

Returns: true if the bar is in vertical mode.

UNKNOWN:

listBox

public KURLBarListBox listBox()

Returns: the KURLBarListBox that is used.

See Also: KURLBar

UNKNOWN:

metaObject

public QMetaObject metaObject()

minimumSizeHint

public QSize minimumSizeHint()

Returns: a proper minimum size (reimplemented)

UNKNOWN:

orientation

public int orientation()

Returns: the current orientation mode.

See Also: KURLBar

UNKNOWN:

paletteChange

protected void paletteChange(QPalette arg1)

readConfig

public void readConfig(KConfig config, String itemGroup)
Call this method to read a saved configuration from config, inside the group itemGroup. All items in there will be restored. The reading of every item is delegated to the readItem() method.

UNKNOWN: Call this method to read a saved configuration from config, inside the group itemGroup.

readItem

public void readItem(int i, KConfig config, boolean applicationLocal)
Called from readConfig() to read the i'th from config. After reading a KURLBarItem is created and initialized with the read values (as well as the given applicationLocal).

UNKNOWN: Called from readConfig() to read the i'th from config.

resizeEvent

protected void resizeEvent(QResizeEvent arg1)

setCurrentItem

public void setCurrentItem(KURL url)
Makes the item with the url url the current item. Does nothing if no item with that url is available.

See Also: KURLBar KURLBar

UNKNOWN: Makes the item with the url url the current item.

setIconSize

public void setIconSize(int size)
Sets the default iconsize to be used for items inserted with insertItem. By default KIcon.SizeMedium.

See Also: KURLBar

UNKNOWN: Sets the default iconsize to be used for items inserted with insertItem.

setListBox

public void setListBox(KURLBarListBox arg1)
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.

See Also: KURLBar

UNKNOWN: Allows to set a custom KURLBarListBox.

setOrientation

public void setOrientation(int orient)
The items can be arranged either vertically in one column or horizontally in one row.

See Also: KURLBar

UNKNOWN: The items can be arranged either vertically in one column or horizontally in one row.

sizeHint

public QSize sizeHint()

Returns: a proper sizehint, depending on the orientation and the number of items available.

UNKNOWN:

slotContextMenuRequested

protected void slotContextMenuRequested(QListBoxItem arg1, QPoint pos)
Reimplemented to show a contextmenu, allowing the user to add, edit or remove items, or change the iconsize.

UNKNOWN: Reimplemented to show a contextmenu, allowing the user to add, edit or remove items, or change the iconsize.

slotDropped

protected void slotDropped(QDropEvent arg1)
Called when a url was dropped onto the bar to show a KURLBarItemDialog.

UNKNOWN: Called when a url was dropped onto the bar to show a KURLBarItemDialog.

slotSelected

protected void slotSelected(QListBoxItem arg1)
Called when an item has been selected. Emits the activated() signal.

UNKNOWN: Called when an item has been selected.

writeConfig

public void writeConfig(KConfig config, String itemGroup)
Call this method to save the current configuration into config, inside the group iconGroup. The writeItem() method is used to save each item.

UNKNOWN: Call this method to save the current configuration into config, inside the group iconGroup.

writeItem

public void writeItem(KURLBarItem item, int i, KConfig arg3, boolean global)
Called from writeConfig() to save the KURLBarItem item as the i'th entry in the config-object. global tell whether it should be saved in the global configuration or not (using KConfig.writeEntry( key, value, true, global ) ).

UNKNOWN: Called from writeConfig() to save the KURLBarItem item as the i'th entry in the config-object.