# class KBookmarkManager

###

Module | kio
Namespace |
Class | KBookmarkManager
Inherits | QObject

This class implements the reading/writing of bookmarks in XML. The bookmarks file is read and written using the XBEL standard (http://pyxml.sourceforge.net/topics/xbel/)

A sample file looks like this :

    <xbel>
    Developer Web Site

    Title of this folder
    KDE Web Site

    My own bookmarks
    KOffice Web Site
    <separator/>
    KDevelop Web Site

    </xbel>

### methods

- KBookmarkManager (bookmarksFile, dbusObjectName)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  bookmarksFile | QString |
  dbusObjectName | QString |

  Creates a bookmark manager with a path to the bookmarks. By default, it will use the KDE standard dirs to find and create the correct location. If you are using your own app-specific bookmarks directory, you must instantiate this class with your own path before KBookmarkManager.managerForFile() is ever called.

  bookmarksFile - full path to the bookmarks file, Use ~/.kde/share/apps/konqueror/bookmarks.xml for the konqueror bookmarks

  dbusObjectName - a unique name that represents this bookmark collection, usually your kinstance (e.g. kapplication) name. This is "konqueror" for the konqueror bookmarks, "kfile" for KFileDialog bookmarks, etc. The final DBus object path is /KBookmarkManager/dbusObjectName An empty dbusObjectName disables the registration to dbus (used for temporary managers)

- KBookmarkManager (bookmarksFile)

  returns ctor
  Not implemented
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  bookmarksFile | QString |

  Creates a bookmark manager for an external file (Using KDirWatch for change monitoring) @since 4.1

- KBookmarkManager ( )

  returns ctor
  Not implemented

  Creates a temp bookmark manager

- bookmarkCompleteChange (caller)

  returns Nothing
  SIGNAL ("bookmarkCompleteChange (QString)")

  Argument | Type | Default
  --- | --- | ---
  caller | QString |

  Signal send over DBUS

- bookmarkConfigChanged ( )

  returns Nothing
  SIGNAL ("bookmarkConfigChanged ()")

  Signal send over DBUS

- bookmarksChanged (groupAddress)

  returns Nothing
  SIGNAL ("bookmarksChanged (QString)")

  Argument | Type | Default
  --- | --- | ---
  groupAddress | QString |

  Signal send over DBUS

- changed (groupAddress, caller)

  returns Nothing
  SIGNAL ("changed (const QString&, const QString&)")

  Argument | Type | Default
  --- | --- | ---
  groupAddress | QString |
  caller | QString |

  Signals that the group (or any of its children) with the address groupAddress (e.g. "/4/5") has been modified by the caller caller. connect to this

- configChanged ( )

  returns Nothing
  SIGNAL ("configChanged ()")

  Signals that the config changed

- createTempManager ( )

  returns KBookmarkManager
  static

  only used for KBookmarkBar

- emitChanged ( )

  returns Nothing

  Saves the bookmark file and notifies everyone.

- emitChanged (group)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  group | KBookmarkGroup |

  Saves the bookmark file and notifies everyone.

  group - the parent of all changed bookmarks

- emitConfigChanged ( )

  returns Nothing

- findByAddress (address)

  returns KBookmark

  Argument | Type | Default
  --- | --- | ---
  address | QString |

  Returns the bookmark designated by address

  address - the address belonging to the bookmark you're looking for

  tolerate - when true tries to find the most tolerable bookmark position

  See also KBookmark.address

- internalDocument ( )

  returns QDomDocument

  Internal

- managerForExternalFile (bookmarksFile)

  returns KBookmarkManager
  static
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  bookmarksFile | QString |

  Returns a KBookmarkManager, which will use KDirWatch for change detection This is important when sharing bookmarks with other Desktops.

  bookmarksFile - full path to the bookmarks file @since 4.1

- managerForFile (bookmarksFile, dbusObjectName)

  returns KBookmarkManager
  static

  Argument | Type | Default
  --- | --- | ---
  bookmarksFile | QString |
  dbusObjectName | QString |

  This static function will return an instance of the KBookmarkManager, responsible for the given bookmarksFile. If you do not instantiate this class either natively or in a derived class, then it will return an object with the default behaviors. If you wish to use different behaviors, you must derive your own class and instantiate it before this method is ever called.

  bookmarksFile - full path to the bookmarks file, Use ~/.kde/share/apps/konqueror/bookmarks.xml for the konqueror bookmarks

  dbusObjectName - a unique name that represents this bookmark collection, usually your kinstance (e.g. kapplication) name. This is "konqueror" for the konqueror bookmarks, "kfile" for KFileDialog bookmarks, etc. The final DBus object path is /KBookmarkManager/dbusObjectName An empty dbusObjectName disables the registration to dbus (used for temporary managers)

- notifyChanged (groupAddress, msg)

  returns Nothing
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  groupAddress | QString |
  msg | QDBusMessage |

  Emit the changed signal for the group whose address is given

  See also KBookmark.address() Called by the process that saved the file after a small change (new bookmark or new folder). Does not send signal over DBUS to the other Bookmark Managers You probably want to call emitChanged()

- notifyCompleteChange (caller)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  caller | QString |

  Reparse the whole bookmarks file and notify about the change Doesn't send signal over DBUS to the other Bookmark Managers You probably want to use emitChanged()

- notifyConfigChanged ( )

  returns Nothing

- path ( )

  returns QString

  This will return the path that this manager is using to read the bookmarks. Internal Returns the path containing the bookmarks

- root ( )

  returns KBookmarkGroup

  This will return the root bookmark. It is used to iterate through the bookmarks manually. It is mostly used internally.

  Returns the root (top-level) bookmark

- save (toolbarCache)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  toolbarCache | bool | 1

  Save the bookmarks to an XML file on disk. You should use emitChanged() instead of this function, it saves and notifies everyone that the file has changed. Only use this if you don't want the emitChanged signal.

  toolbarCache - iff true save a cache of the toolbar folder, too Returns true if saving was successful

- saveAs (filename, toolbarCache)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  filename | QString |
  toolbarCache | bool | 1

  Save the bookmarks to the given XML file on disk.

  filename - full path to the desired bookmarks file location

  toolbarCache - iff true save a cache of the toolbar folder, too Returns true if saving was successful

- setEditorOptions (caption, browser)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  caption | QString |
  browser | bool |

  Set options with which slotEditBookmarks called keditbookmarks this can be used to change the appearance of the keditbookmarks in order to provide a slightly differing outer shell depending on the bookmarks file / app which calls it.

  caption - the --caption string, for instance "Konsole"

  browser - iff false display no browser specific menu items in keditbookmarks . --nobrowser

- setUpdate (update)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  update | bool |

  Set the update flag. Defaults to true.

  update - if true then KBookmarkManager will listen to DBUS update requests.

- slotEditBookmarks ( )

  returns Nothing

- slotEditBookmarksAtAddress (address)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  address | QString |

- toolbar ( )

  returns KBookmarkGroup

  This returns the root of the toolbar menu. In the XML, this is the group with the attribute toolbar=yes

  Returns the toolbar group

- updateAccessMetadata (url)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  url | QString |

  Update access time stamps for a given url.

  url - the viewed url Returns true if any metadata was modified (bookmarks file is not saved automatically)

- updateFavicon (url, faviconurl)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  url | QString |
  faviconurl | QString |

- userBookmarksManager ( )

  returns KBookmarkManager
  static

  Returns a pointer to the user's main (konqueror) bookmark collection.