org.kde.koala

Class KURLComboBox

public class KURLComboBox extends KComboBox

This combobox shows a number of recent URLs/directories, as well as some default directories. It will manage the default dirs root-directory, home-directory and Desktop-directory, as well as a number of URLs set via setURLs() and one additional entry to be set via setURL(). See KURLComboBoxSignals for signals emitted by KURLComboBox

Author: Carsten Pfeiffer

UNKNOWN: A combo box showing a number of recent URLs/directories.

Field Summary
static intBoth
static intDirectories
static intFiles
This enum describes which kind of items is shown in the combo box.
static intRemoveBottom
static intRemoveTop
This Enumeration is used in setURL() to determine which items will be removed when the given list is larger than maxItems().
Constructor Summary
protected KURLComboBox(Class dummy)
KURLComboBox(int mode, QWidget parent, String name)
Constructs a KURLComboBox.
KURLComboBox(int mode, QWidget parent)
KURLComboBox(int mode)
KURLComboBox(int mode, boolean rw, QWidget parent, String name)
KURLComboBox(int mode, boolean rw, QWidget parent)
KURLComboBox(int mode, boolean rw)
Method Summary
voidaddDefaultURL(KURL url, String text)
Adds a url that will always be shown in the combobox, it can't be "rotated away".
voidaddDefaultURL(KURL url)
voidaddDefaultURL(KURL url, QPixmap pix, String text)
Adds a url that will always be shown in the combobox, it can't be "rotated away".
voidaddDefaultURL(KURL url, QPixmap pix)
StringclassName()
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected voidfinalize()
Deletes the wrapped C++ instance
protected QPixmapgetPixmap(KURL url)
Uses KMimeType.pixmapForURL() to return a proper pixmap for url. In directory mode, a folder icon is always returned.
protected voidinit(int mode)
booleanisDisposed()
Has the wrapped C++ instance been deleted?
intmaxItems()
QMetaObjectmetaObject()
voidremoveURL(KURL url, boolean checkDefaultURLs)
Removes any occurrence of url. If checkDefaultURLs is false default-urls won't be removed.
voidremoveURL(KURL url)
voidsetDefaults()
Clears all items and inserts the default urls into the combo.
voidsetMaxItems(int arg1)
Sets how many items should be handled and displayed by the combobox.
voidsetURL(KURL url)
Sets the current url.
voidsetURLs(String[] urls)
Inserts urls into the combobox below the "default urls" (see addDefaultURL).
voidsetURLs(String[] urls, int remove)
Inserts urls into the combobox below the "default urls" (see addDefaultURL).
protected voidslotActivated(int arg1)
Updates item with pixmap and sets the url instead of the text of the KURLComboItem.
ArrayListurls()

Field Detail

Both

public static final int Both

Directories

public static final int Directories

Files

public static final int Files
This enum describes which kind of items is shown in the combo box.

UNKNOWN: This enum describes which kind of items is shown in the combo box.

RemoveBottom

public static final int RemoveBottom

RemoveTop

public static final int RemoveTop
This Enumeration is used in setURL() to determine which items will be removed when the given list is larger than maxItems().
  • RemoveTop means that items will be removed from top
  • RemoveBottom means, that items will be removed from the bottom
  • @short This Enumeration is used in setURL() to determine which items will be removed when the given list is larger than maxItems().

    Constructor Detail

    KURLComboBox

    protected KURLComboBox(Class dummy)

    KURLComboBox

    public KURLComboBox(int mode, QWidget parent, String name)
    Constructs a KURLComboBox.

    Parameters: mode is either Files, Directories or Both and controls the following behavior:

  • Files all inserted URLs will be treated as files, therefore the url shown in the combo will never show a trailing / the icon will be the one associated with the file's mimetype.
  • Directories all inserted URLs will be treated as directories, will have a trailing slash in the combobox. The current directory will show the "open folder" icon, other directories the "folder" icon.
  • Both Don't mess with anything, just show the url as given.
  • parent The parent object of this widget. name The name of this widget.

    UNKNOWN: Constructs a KURLComboBox.

    KURLComboBox

    public KURLComboBox(int mode, QWidget parent)

    KURLComboBox

    public KURLComboBox(int mode)

    KURLComboBox

    public KURLComboBox(int mode, boolean rw, QWidget parent, String name)

    KURLComboBox

    public KURLComboBox(int mode, boolean rw, QWidget parent)

    KURLComboBox

    public KURLComboBox(int mode, boolean rw)

    Method Detail

    addDefaultURL

    public void addDefaultURL(KURL url, String text)
    Adds a url that will always be shown in the combobox, it can't be "rotated away". Default urls won't be returned in urls() and don't have to be set via setURLs(). If you want to specify a special pixmap, use the overloaded method with the pixmap parameter. Default URLs will be inserted into the combobox by setDefaults()

    UNKNOWN: Adds a url that will always be shown in the combobox, it can't be "rotated away".

    addDefaultURL

    public void addDefaultURL(KURL url)

    addDefaultURL

    public void addDefaultURL(KURL url, QPixmap pix, String text)
    Adds a url that will always be shown in the combobox, it can't be "rotated away". Default urls won't be returned in urls() and don't have to be set via setURLs(). If you don't need to specify a pixmap, use the overloaded method without the pixmap parameter. Default URLs will be inserted into the combobox by setDefaults()

    UNKNOWN: Adds a url that will always be shown in the combobox, it can't be "rotated away".

    addDefaultURL

    public void addDefaultURL(KURL url, QPixmap pix)

    className

    public String className()

    dispose

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

    finalize

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

    getPixmap

    protected QPixmap getPixmap(KURL url)
    Uses KMimeType.pixmapForURL() to return a proper pixmap for url. In directory mode, a folder icon is always returned.

    UNKNOWN: Uses KMimeType.pixmapForURL() to return a proper pixmap for url.

    init

    protected void init(int mode)

    isDisposed

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

    maxItems

    public int maxItems()

    Returns: the maximum of items the combobox handles.

    See Also: KURLComboBox

    UNKNOWN:

    metaObject

    public QMetaObject metaObject()

    removeURL

    public void removeURL(KURL url, boolean checkDefaultURLs)
    Removes any occurrence of url. If checkDefaultURLs is false default-urls won't be removed.

    UNKNOWN: Removes any occurrence of url.

    removeURL

    public void removeURL(KURL url)

    setDefaults

    public void setDefaults()
    Clears all items and inserts the default urls into the combo. Will be called implicitly upon the first call to setURLs() or setURL()

    See Also: KURLComboBox

    UNKNOWN: Clears all items and inserts the default urls into the combo.

    setMaxItems

    public void setMaxItems(int arg1)
    Sets how many items should be handled and displayed by the combobox.

    See Also: KURLComboBox

    UNKNOWN: Sets how many items should be handled and displayed by the combobox.

    setURL

    public void setURL(KURL url)
    Sets the current url. This combo handles exactly one url additionally to the default items and those set via setURLs(). So you can call setURL() as often as you want, it will always replace the previous one set via setURL(). If url is already in the combo, the last item will stay there and the existing item becomes the current item. The current item will always have the open-directory-pixmap as icon. Note that you won't receive any signals, e.g. textChanged(), returnPressed() or activated() upon calling this method.

    UNKNOWN: Sets the current url.

    setURLs

    public void setURLs(String[] urls)
    Inserts urls into the combobox below the "default urls" (see addDefaultURL). If the list of urls contains more items than maxItems, the first items will be stripped.

    UNKNOWN: Inserts urls into the combobox below the "default urls" (see addDefaultURL).

    setURLs

    public void setURLs(String[] urls, int remove)
    Inserts urls into the combobox below the "default urls" (see addDefaultURL). If the list of urls contains more items than maxItems, the remove parameter determines whether the first or last items will be stripped.

    UNKNOWN: Inserts urls into the combobox below the "default urls" (see addDefaultURL).

    slotActivated

    protected void slotActivated(int arg1)
    Updates item with pixmap and sets the url instead of the text of the KURLComboItem. Also works around a Qt bug.

    UNKNOWN: Updates item with pixmap and sets the url instead of the text of the KURLComboItem.

    urls

    public ArrayList urls()

    Returns: a list of all urls currently handled. The list contains at most maxItems() items. Use this to save the list of urls in a config-file and reinsert them via setURLs() next time. Note that all default urls set via addDefaultURL() are not returned, they will automatically be set via setURLs() or setURL(). You will always get fully qualified urls, i.e. with protocol like file:/

    UNKNOWN: