#include <kurlbar.h>
Inherits TQFrame.
Inherited by KFileSpeedBar.
Public Slots | |
virtual void | setCurrentItem (const KURL &url) |
Signals | |
void | activated (const KURL &url) |
Public Member Functions | |
KURLBar (bool useGlobalItems, TQWidget *parent=0, const char *name=0, WFlags f=0) | |
~KURLBar () | |
virtual KURLBarItem * | insertItem (const KURL &url, const TQString &description, bool applicationLocal=true, const TQString &icon=TQString::null, TDEIcon::Group group=TDEIcon::Panel) |
virtual KURLBarItem * | insertDynamicItem (const KURL &url, const TQString &description, const TQString &icon=TQString::null, TDEIcon::Group group=TDEIcon::Panel) |
virtual void | setOrientation (TQt::Orientation orient) |
Orientation | orientation () const |
virtual void | setListBox (KURLBarListBox *) |
KURLBarListBox * | listBox () const |
virtual void | setIconSize (int size) |
int | iconSize () const |
virtual void | clear () |
virtual TQSize | sizeHint () const |
virtual TQSize | minimumSizeHint () const |
virtual void | readConfig (TDEConfig *config, const TQString &itemGroup) |
virtual void | writeConfig (TDEConfig *config, const TQString &itemGroup) |
virtual void | readItem (int i, TDEConfig *config, bool applicationLocal) |
virtual void | writeItem (KURLBarItem *item, int i, TDEConfig *, bool global) |
KURLBarItem * | currentItem () const |
KURL | currentURL () const |
bool | isModified () const |
bool | isImmutable () const |
bool | isVertical () const |
Protected Slots | |
virtual void | slotContextMenuRequested (TQListBoxItem *, const TQPoint &pos) |
virtual void | slotSelected (TQListBoxItem *) |
virtual void | slotDropped (TQDropEvent *) |
Protected Member Functions | |
virtual bool | addNewItem () |
virtual bool | editItem (KURLBarItem *item) |
virtual void | resizeEvent (TQResizeEvent *) |
virtual void | paletteChange (const TQPalette &) |
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.
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 TDEConfig 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.
A URL-bar widget, as used in the KFileDialog
Constructor & Destructor Documentation
◆ KURLBar()
KURLBar::KURLBar | ( | bool | useGlobalItems, |
TQWidget * | parent = 0 , |
||
const char * | name = 0 , |
||
WFlags | f = 0 |
||
) |
Constructs a KURLBar.
Set useGlobalItems
to true if you want to allow global/local item separation.
Definition at line 334 of file kurlbar.cpp.
◆ ~KURLBar()
KURLBar::~KURLBar | ( | ) |
Destroys the KURLBar.
Definition at line 357 of file kurlbar.cpp.
Member Function Documentation
◆ activated
|
signal |
This signal is emitted when the user activated an item, e.g., by clicking on it.
◆ addNewItem()
|
protectedvirtual |
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.
Definition at line 779 of file kurlbar.cpp.
◆ clear()
|
virtual |
Clears the view, removes all items.
Definition at line 444 of file kurlbar.cpp.
◆ currentItem()
KURLBarItem * KURLBar::currentItem | ( | ) | const |
- Returns
- the current KURLBarItem, or 0L if none.
- See also
- setCurrentItem
- currentURL
Definition at line 568 of file kurlbar.cpp.
◆ currentURL()
KURL KURLBar::currentURL | ( | ) | const |
- Returns
- the url of the current item or an invalid url, if there is no current item.
- See also
- currentItem
- setCurrentItem
Definition at line 576 of file kurlbar.cpp.
◆ editItem()
|
protectedvirtual |
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.
Definition at line 792 of file kurlbar.cpp.
◆ iconSize()
|
inline |
- Returns
- the default iconsize used for items inserted with insertItem. By default TDEIcon::SizeMedium
- See also
- setIconSize
◆ insertDynamicItem()
|
virtual |
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
- Since
- 3.2
Definition at line 372 of file kurlbar.cpp.
◆ insertItem()
|
virtual |
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
Definition at line 362 of file kurlbar.cpp.
◆ isImmutable()
|
inline |
◆ isModified()
|
inline |
- 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().
◆ isVertical()
|
inline |
◆ listBox()
|
inline |
- Returns
- the KURLBarListBox that is used.
- See also
- setListBox
◆ minimumSizeHint()
|
virtual |
- Returns
- a proper minimum size (reimplemented)
Definition at line 513 of file kurlbar.cpp.
◆ orientation()
TQt::Orientation KURLBar::orientation | ( | ) | const |
- Returns
- the current orientation mode.
- See also
- setOrientation
Definition at line 391 of file kurlbar.cpp.
◆ readConfig()
|
virtual |
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.
Definition at line 582 of file kurlbar.cpp.
◆ readItem()
|
virtual |
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
).
Definition at line 605 of file kurlbar.cpp.
◆ setCurrentItem
|
virtualslot |
Makes the item with the url url
the current item.
Does nothing if no item with that url is available.
- See also
- currentItem
- currentURL
Definition at line 540 of file kurlbar.cpp.
◆ setIconSize()
|
virtual |
Sets the default iconsize to be used for items inserted with insertItem.
By default TDEIcon::SizeMedium.
- See also
- iconsize
Definition at line 426 of file kurlbar.cpp.
◆ setListBox()
|
virtual |
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
- listBox
Definition at line 396 of file kurlbar.cpp.
◆ setOrientation()
|
virtual |
The items can be arranged either vertically in one column or horizontally in one row.
- See also
- orientation
Definition at line 380 of file kurlbar.cpp.
◆ sizeHint()
|
virtual |
- Returns
- a proper sizehint, depending on the orientation and the number of items available.
Definition at line 471 of file kurlbar.cpp.
◆ slotContextMenuRequested
|
protectedvirtualslot |
Reimplemented to show a contextmenu, allowing the user to add, edit or remove items, or change the iconsize.
Definition at line 719 of file kurlbar.cpp.
◆ slotDropped
|
protectedvirtualslot |
Called when a url was dropped onto the bar to show a KURLBarItemDialog.
Definition at line 701 of file kurlbar.cpp.
◆ slotSelected
|
protectedvirtualslot |
Called when an item has been selected.
Emits the activated() signal.
Definition at line 529 of file kurlbar.cpp.
◆ writeConfig()
|
virtual |
Call this method to save the current configuration into config
, inside the group iconGroup
.
The writeItem() method is used to save each item.
Definition at line 622 of file kurlbar.cpp.
◆ writeItem()
|
virtual |
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 TDEConfig::writeEntry( key, value, true, global ) ).
Definition at line 681 of file kurlbar.cpp.
Member Data Documentation
◆ m_activeItem
|
protected |
◆ m_isImmutable
|
protected |
◆ m_isModified
|
protected |
◆ m_useGlobal
|
protected |
The documentation for this class was generated from the following files: