KDE 4.7 PyKDE API Reference

- KDE's Python API

# KBookmarkGroup Class Reference

`from PyKDE4.kio import *`

Inherits: KBookmark

## Detailed Description

A group of bookmarks

## Methods

| __init__ (self)
| __init__ (self, QDomElement elem)
KBookmark | addBookmark (self, KBookmark bm)
KBookmark | addBookmark (self, QString text, KUrl url, QString icon=QString())
KBookmarkGroup | createNewFolder (self, QString text)
KBookmark | createNewSeparator (self)
| deleteBookmark (self, KBookmark bk)
QDomElement | findToolbar (self)
KBookmark | first (self)
[KUrl] | groupUrlList (self)
int | indexOf (self, KBookmark child)
bool | isOpen (self)
bool | isToolbarGroup (self)
bool | moveBookmark (self, KBookmark bookmark, KBookmark after)
bool | moveItem (self, KBookmark item, KBookmark after)
KBookmark | next (self, KBookmark current)
QDomElement | nextKnownTag (self, QDomElement start, bool goNext)
KBookmark | previous (self, KBookmark current)

## Method Documentation

__init__ | ( |  | self ) |

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)

__init__ | ( | self, |
|  | QDomElement | elem
| ) |  |  |

Create a bookmark group as specified by the given element

KBookmark addBookmark | ( | self, |
|  | KBookmark | bm
| ) |  |  |

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

Parameters:

  | text | for the bookmark
  | url | the URL that the bookmark points to
  | icon | the name of the icon to associate with the bookmark. A suitable default will be determined from the URL if not specified.

KBookmark addBookmark | ( | self, |
|  | QString | text,
|  | KUrl | url,
|  | QString | icon=QString()
| ) |  |  |

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

Parameters:

  | text | for the bookmark
  | url | the URL that the bookmark points to
  | icon | the name of the icon to associate with the bookmark. A suitable default will be determined from the URL if not specified.

KBookmarkGroup createNewFolder | ( | self, |
|  | QString | text
| ) |  |  |

Create a new bookmark folder, as the last child of this group

Parameters:

  | text | for the folder. If you want an dialog use KBookmarkDialog

KBookmark createNewSeparator | ( |  | self ) |

Create a new bookmark separator Don't forget to use KBookmarkManager.self()->emitChanged( parentBookmark );

deleteBookmark | ( | self, |
|  | KBookmark | bk
| ) |  |  |

Delete a bookmark - it has to be one of our children ! Don't forget to use KBookmarkManager.self()->emitChanged( parentBookmark );

QDomElement findToolbar | ( |  | self ) |

Internal:

KBookmark first | ( |  | self ) |

Return the first child bookmark of this group

[KUrl] groupUrlList | ( |  | self ) |

Returns:
  the list of urls of bookmarks at top level of the group

int indexOf | ( | self, |
|  | KBookmark | child
| ) |  |  |

Return the index of a child bookmark, -1 if not found

bool isOpen | ( |  | self ) |

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

bool isToolbarGroup | ( |  | self ) |

Returns:
  true if this is the toolbar group

bool moveBookmark | ( | self, |
|  | KBookmark | bookmark,
|  | KBookmark | after
| ) |  |  |

Moves bookmark after after (which should be a child of ours). If after is null, bookmark is moved as the first child. Don't forget to use KBookmarkManager.self()->emitChanged( parentBookmark );

bool moveItem | ( | self, |
|  | KBookmark | item,
|  | KBookmark | after
| ) |  |  |

KBookmark next | ( | self, |
|  | KBookmark | current
| ) |  |  |

Return the next sibling of a child bookmark of this group

Parameters:

  | current | has to be one of our child bookmarks.

QDomElement nextKnownTag | ( | self, |
|  | QDomElement | start,
|  | bool | goNext
| ) |  |  |

KBookmark previous | ( | self, |
|  | KBookmark | current
| ) |  |  |

Return the prevous sibling of a child bookmark of this group

Parameters:

  | current | has to be one of our child bookmarks.