# kio Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KBookmarkGroup Class Reference

A group of bookmarks. More...

`#include <kbookmark.h>`

Collaboration diagram for KBookmarkGroup:

[legend]
List of all members.

## Public Member Functions

| KBookmarkGroup ()
| Create an invalid group.
| KBookmarkGroup (QDomElement elem)
| Create a bookmark group as specified by the given element.
QString | groupAddress () const
| Much like KBookmark::address, but caches the address into m_address.
bool | isOpen () const
KBookmark | first () const
| Return the first child bookmark of this group.
KBookmark | previous (const KBookmark &current) const
| Return the prevous sibling of a child bookmark of this group.
KBookmark | next (const KBookmark &current) const
| Return the next sibling of a child bookmark of this group.
KBookmarkGroup | createNewFolder (KBookmarkManager *mgr, const QString &text=QString::null, bool emitSignal=true)
| Create a new bookmark folder, as the last child of this group `text` for the folder.
KBookmark | createNewSeparator ()
| Create a new bookmark separator.
KBookmark | addBookmark (KBookmarkManager *mgr, const QString &text, const KURL &url, const QString &icon=QString::null, bool emitSignal=true)
| Create a new bookmark, as the last child of this group Don't forget to use KBookmarkManager::self()->emitChanged( parentBookmark ); if this bookmark was added interactively.
bool | moveItem (const KBookmark &item, const KBookmark &after)
| Moves `item` after `after` (which should be a child of ours).
void | deleteBookmark (KBookmark bk)
| Delete a bookmark - it has to be one of our children !
bool | isToolbarGroup () const
QDomElement | findToolbar () const

## Protected Member Functions

QDomElement | nextKnownTag (QDomElement start, bool goNext) const

## Detailed Description

A group of bookmarks.

Definition at line 147 of file kbookmark.h.

## Constructor & Destructor Documentation

KBookmarkGroup::KBookmarkGroup | ( |  | ) |

| Create an invalid group. This is mostly for use in QValueList, and other places where we need a null group. Also used as a parent for a bookmark that doesn't have one (e.g. Netscape bookmarks) Definition at line 31 of file kbookmark.cc. Referenced by createNewFolder().

KBookmarkGroup::KBookmarkGroup | ( | QDomElement | elem | ) |

| Create a bookmark group as specified by the given element. Definition at line 36 of file kbookmark.cc.

## Member Function Documentation

QString KBookmarkGroup::groupAddress | ( |  | ) | const

| Much like KBookmark::address, but caches the address into m_address. Definition at line 41 of file kbookmark.cc. References QString::isEmpty().

bool KBookmarkGroup::isOpen | ( |  | ) | const

Returns:
  true if the bookmark folder is opened in the bookmark editor

Definition at line 48 of file kbookmark.cc.

KBookmark KBookmarkGroup::first | ( |  | ) | const

| Return the first child bookmark of this group. Definition at line 53 of file kbookmark.cc. Referenced by KBookmarkMenu::fillBookmarkMenu(), and KBookmarkManager::findByAddress().

KBookmark KBookmarkGroup::previous | ( | const KBookmark & | current | ) | const

Return the prevous sibling of a child bookmark of this group.

Parameters:

  current | has to be one of our child bookmarks.

Definition at line 58 of file kbookmark.cc.

KBookmark KBookmarkGroup::next | ( | const KBookmark & | current | ) | const

Return the next sibling of a child bookmark of this group.

Parameters:

  current | has to be one of our child bookmarks.

Definition at line 63 of file kbookmark.cc.

Referenced by KBookmarkMenu::fillBookmarkMenu(), and KBookmarkManager::findByAddress().

KBookmarkGroup KBookmarkGroup::createNewFolder | ( | KBookmarkManager * | mgr,
|  | const QString & | text = QString::null,
|  | bool | emitSignal = true
| ) |

Create a new bookmark folder, as the last child of this group `text` for the folder.

If empty, the user will be queried for it.

Definition at line 87 of file kbookmark.cc.

References KBookmarkNotifier::createdNewFolder(), QDomDocument::createElement(), QDomDocument::createTextNode(), KDialogBase::enableButtonOK(), QDialog::exec(), QString::isEmpty(), KBookmarkGroup(), KBookmarkManager::notifier(), KBookmarkManager::path(), KDialog::setCaption(), and KLineEditDlg::text().

KBookmark KBookmarkGroup::createNewSeparator | ( |  | ) |

| Create a new bookmark separator. Definition at line 122 of file kbookmark.cc. References QDomDocument::createElement().

KBookmark KBookmarkGroup::addBookmark | ( | KBookmarkManager * | mgr,
|  | const QString & | text,
|  | const KURL & | url,
|  | const QString & | icon = QString::null,
|  | bool | emitSignal = true
| ) |

Create a new bookmark, as the last child of this group Don't forget to use KBookmarkManager::self()->emitChanged( parentBookmark ); if this bookmark was added interactively.

Definition at line 155 of file kbookmark.cc.

References QDomDocument::createElement(), QDomDocument::createTextNode(), KMimeType::iconForURL(), QString::isEmpty(), KBookmarkManager::notifier(), KBookmarkManager::path(), QDomElement::setAttribute(), and KURL::url().

bool KBookmarkGroup::moveItem | ( | const KBookmark & | item,
|  | const KBookmark & | after
| ) |

| Moves `item` after `after` (which should be a child of ours). If item is null, `item` is moved as the first child. Definition at line 132 of file kbookmark.cc. References QDomNode::appendChild(), QDomNode::insertAfter(), QDomNode::insertBefore(), and QDomNode::isNull().

void KBookmarkGroup::deleteBookmark | ( | KBookmark | bk | ) |

| Delete a bookmark - it has to be one of our children ! Definition at line 180 of file kbookmark.cc.

bool KBookmarkGroup::isToolbarGroup | ( |  | ) | const

Returns:
  true if this is the toolbar group

Definition at line 185 of file kbookmark.cc.

Referenced by KBookmarkManager::saveAs().

The documentation for this class was generated from the following files:

- kbookmark.h
- kbookmark.cc

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:15:21 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001