android-components / mozilla.components.concept.storage / BookmarksStorage

BookmarksStorage

interface BookmarksStorage : Storage (source)

An interface which defines read/write operations for bookmarks data.

Functions

Name Summary
addFolder abstract suspend fun addFolder(parentGuid: String, title: String, position: Int? = null): String
Adds a new bookmark folder to a given node.
addItem abstract suspend fun addItem(parentGuid: String, url: String, title: String, position: Int?): String
Adds a new bookmark item to a given node.
addSeparator abstract suspend fun addSeparator(parentGuid: String, position: Int?): String
Adds a new bookmark separator to a given node.
deleteNode abstract suspend fun deleteNode(guid: String): Boolean
Deletes a bookmark node and all of its children, if any.
getBookmark abstract suspend fun getBookmark(guid: String): BookmarkNode?
Obtains the details of a bookmark without children, if one exists with that guid. Otherwise, null.
getBookmarksWithUrl abstract suspend fun getBookmarksWithUrl(url: String): List<BookmarkNode>
Produces a list of all bookmarks with the given URL.
getTree abstract suspend fun getTree(guid: String, recursive: Boolean = false): BookmarkNode?
Produces a bookmarks tree for the given guid string.
searchBookmarks abstract suspend fun searchBookmarks(query: String, limit: Int = defaultBookmarkSearchLimit): List<BookmarkNode>
Searches bookmarks with a query string.
updateNode abstract suspend fun updateNode(guid: String, info: BookmarkInfo): Unit
Edits the properties of an existing bookmark item and/or moves an existing one underneath a new parent guid.

Inherited Functions

Name Summary
cleanup abstract fun cleanup(): Unit
Cleans up background work and database connections
runMaintenance abstract suspend fun runMaintenance(): Unit
Runs internal database maintenance tasks

Companion Object Properties

Name Summary
defaultBookmarkSearchLimit const val defaultBookmarkSearchLimit: Int

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.

Inheritors

Name Summary
PlacesBookmarksStorage open class PlacesBookmarksStorage : PlacesStorage, BookmarksStorage, SyncableStore
Implementation of the BookmarksStorage which is backed by a Rust Places lib via PlacesApi.