# eric4.Helpviewer.Bookmarks.BookmarksManager

Module implementing the bookmarks manager.

### Global Attributes

BOOKMARKBAR
BOOKMARKMENU
extract_js

### Classes

BookmarksManager | Class implementing the bookmarks manager.
ChangeBookmarkCommand | Class implementing the Insert undo command.
InsertBookmarksCommand | Class implementing the Insert undo command.
RemoveBookmarksCommand | Class implementing the Remove undo command.

### Functions

None

## BookmarksManager

Class implementing the bookmarks manager.

### Signals

entryAdded
  emitted after a bookmark node has been added
entryChanged
  emitted after a bookmark node has been changed
entryRemoved
  emitted after a bookmark node has been removed

### Derived from

QObject

### Class Attributes

None

### Class Methods

None

### Methods

BookmarksManager | Constructor
__convertFromOldBookmarks | Private method to convert the old bookmarks into the new ones.
addBookmark | Public method to add a bookmark.
bookmarks | Public method to get a reference to the root bookmark node.
bookmarksModel | Public method to get a reference to the bookmarks model.
changeExpanded | Public method to handle a change of the expanded state.
close | Public method to close the bookmark manager.
exportBookmarks | Public method to export the bookmarks.
importBookmarks | Public method to import bookmarks.
load | Public method to load the bookmarks.
menu | Public method to get a reference to the bookmarks menu node.
removeBookmark | Public method to remove a bookmark.
save | Public method to save the bookmarks.
setTitle | Public method to set the title of a bookmark.
setUrl | Public method to set the URL of a bookmark.
toolbar | Public method to get a reference to the bookmarks toolbar node.
undoRedoStack | Public method to get a reference to the undo stack.

### Static Methods

None

#### BookmarksManager (Constructor)

BookmarksManager(parent = None)

Constructor

parent
  reference to the parent object (QObject)

#### BookmarksManager.__convertFromOldBookmarks

__convertFromOldBookmarks()

Private method to convert the old bookmarks into the new ones.

#### BookmarksManager.addBookmark

addBookmark(parent, node, row = -1)

Public method to add a bookmark.

parent
  reference to the node to add to (BookmarkNode)
node
  reference to the node to add (BookmarkNode)
row
  row number (integer)

#### BookmarksManager.bookmarks

bookmarks()

Public method to get a reference to the root bookmark node.

Returns:
  reference to the root bookmark node (BookmarkNode)

#### BookmarksManager.bookmarksModel

bookmarksModel()

Public method to get a reference to the bookmarks model.

Returns:
  reference to the bookmarks model (BookmarksModel)

#### BookmarksManager.changeExpanded

changeExpanded()

Public method to handle a change of the expanded state.

#### BookmarksManager.close

close()

Public method to close the bookmark manager.

#### BookmarksManager.exportBookmarks

exportBookmarks()

Public method to export the bookmarks.

#### BookmarksManager.importBookmarks

importBookmarks()

Public method to import bookmarks.

#### BookmarksManager.load

load()

Public method to load the bookmarks.

#### BookmarksManager.menu

menu()

Public method to get a reference to the bookmarks menu node.

Returns:
  reference to the bookmarks menu node (BookmarkNode)

#### BookmarksManager.removeBookmark

removeBookmark(node)

Public method to remove a bookmark.

node
  reference to the node to be removed (BookmarkNode)

#### BookmarksManager.save

save()

Public method to save the bookmarks.

#### BookmarksManager.setTitle

setTitle(node, newTitle)

Public method to set the title of a bookmark.

node
  reference to the node to be changed (BookmarkNode)
newTitle
  title to be set (QString)

#### BookmarksManager.setUrl

setUrl(node, newUrl)

Public method to set the URL of a bookmark.

node
  reference to the node to be changed (BookmarkNode)
newUrl
  URL to be set (QString)

#### BookmarksManager.toolbar

toolbar()

Public method to get a reference to the bookmarks toolbar node.

Returns:
  reference to the bookmarks toolbar node (BookmarkNode)

#### BookmarksManager.undoRedoStack

undoRedoStack()

Public method to get a reference to the undo stack.

Returns:
  reference to the undo stack (QUndoStack)

Up

## ChangeBookmarkCommand

Class implementing the Insert undo command.

### Derived from

QUndoCommand

### Class Attributes

None

### Class Methods

None

### Methods

ChangeBookmarkCommand | Constructor
redo | Public slot to perform the redo action.
undo | Public slot to perform the undo action.

### Static Methods

None

#### ChangeBookmarkCommand (Constructor)

ChangeBookmarkCommand(bookmarksManager, node, newValue, title)

Constructor

bookmarksManager
  reference to the bookmarks manager (BookmarksManager)
node
  reference to the node to be changed (BookmarkNode)
newValue
  new value to be set (QString)
title
  flag indicating a change of the title (True) or the URL (False) (boolean)

#### ChangeBookmarkCommand.redo

redo()

Public slot to perform the redo action.

#### ChangeBookmarkCommand.undo

undo()

Public slot to perform the undo action.

Up

## InsertBookmarksCommand

Class implementing the Insert undo command.

### Derived from

RemoveBookmarksCommand

### Class Attributes

None

### Class Methods

None

### Methods

InsertBookmarksCommand | Constructor
redo | Public slot to perform the redo action.
undo | Public slot to perform the undo action.

### Static Methods

None

#### InsertBookmarksCommand (Constructor)

InsertBookmarksCommand(bookmarksManager, parent, node, row)

Constructor

bookmarksManager
  reference to the bookmarks manager (BookmarksManager)
parent
  reference to the parent node (BookmarkNode)
node
  reference to the node to be inserted (BookmarkNode)
row
  row number of bookmark (integer)

#### InsertBookmarksCommand.redo

redo()

Public slot to perform the redo action.

#### InsertBookmarksCommand.undo

undo()

Public slot to perform the undo action.

Up

## RemoveBookmarksCommand

Class implementing the Remove undo command.

### Derived from

QUndoCommand

### Class Attributes

None

### Class Methods

None

### Methods

RemoveBookmarksCommand | Constructor
redo | Public slot to perform the redo action.
undo | Public slot to perform the undo action.

### Static Methods

None

#### RemoveBookmarksCommand (Constructor)

RemoveBookmarksCommand(bookmarksManager, parent, row)

Constructor

bookmarksManager
  reference to the bookmarks manager (BookmarksManager)
parent
  reference to the parent node (BookmarkNode)
row
  row number of bookmark (integer)

#### RemoveBookmarksCommand.redo

redo()

Public slot to perform the redo action.

#### RemoveBookmarksCommand.undo

undo()

Public slot to perform the undo action.

Up