Interface nsINavBookmarksServiceType

The BookmarksService interface provides methods for managing bookmarked history items. Bookmarks consist of a set of user-customizable folders. A URI in history can be contained in one or more such folders.

Hierarchy

Properties

tagsFolder: number

The item ID of the top-level folder that contain the tag "folders".

totalSyncChanges: number

The total number of Sync changes (inserts, updates, deletes, merges, and uploads) recorded since Places startup for all bookmarks.

Note that this is not the number of bookmark syncs. It's a monotonically increasing counter incremented for every change that affects a bookmark's syncChangeCounter.

The counter can be used to avoid keeping an exclusive transaction open for time-consuming work. One way to do that is to store the current value of the counter, do the work, start a transaction, check the current value again, and compare it to the stored value to determine if the database changed during the work.

The bookmarks mirror does this to check for changes between building and applying a merged tree. This avoids blocking the main Places connection during the merge, and ensures that the new tree still applies cleanly.

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Creates a new child folder and inserts it under the given parent.

    Returns

    The ID of the newly-inserted folder.

    Throws

    if aGuid is malformed.

    Parameters

    • aParentFolder: number

      The id of the parent folder

    • name: string
    • index: number
    • aGuid: string
    • aSource: number

    Returns number

  • Get the title for an item.

    If no item title is available it will return a void string (null in JS).

    Returns

    The title of the item.

    Parameters

    • aItemId: number

      The id of the item whose title should be retrieved

    Returns string

  • Inserts a child bookmark into the given folder.

    Returns

    The ID of the newly-created bookmark.

    Note

    aTitle will be truncated to TITLE_LENGTH_MAX and aURI will be truncated to URI_LENGTH_MAX.

    Throws

    if aGuid is malformed.

    Parameters

    • aParentId: number

      The id of the parent folder

    • aURI: nsIURI

      The URI to insert

    • aIndex: number

      The index to insert at, or DEFAULT_INDEX to append

    • aTitle: string

      The title for the new bookmark

    • aGuid: string
    • aSource: number

    Returns number

  • Removes a child item. Used to delete a bookmark or separator.

    Parameters

    • aItemId: number

      The child item to remove

    • aSource: number

    Returns void

  • Set the last modified time for an item.

    Note

    This is the only method that will send an itemChanged notification for the property. lastModified will still be updated in any other method that changes an item property, but we will send the corresponding itemChanged notification instead.

    Parameters

    • aItemId: number

      the id of the item whose last modified time should be updated.

    • aLastModified: number

      the new last modified value in microseconds. Note that it is rounded down to milliseconds precision.

    • aSource: number

    Returns void

  • Set the title for an item.

    Note

    aTitle will be truncated to TITLE_LENGTH_MAX.

    Parameters

    • aItemId: number

      The id of the item whose title should be updated.

    • aTitle: string

      The new title for the bookmark.

    • aSource: number

    Returns void

Generated using TypeDoc