SavedSitesRepository

The Repository that represents all CRUD operations related to SavedSites There are two types os SavedSites can be Favorite or Bookmark

Functions

Link copied to clipboard
abstract fun bookmarksCount(): Long

Returns total number of Bookmark

Link copied to clipboard
abstract fun delete(folder: BookmarkFolder)

Deletes an existing BookmarkFolder Used when deleting a BookmarkFolder from the Bookmarks screen

abstract fun delete(savedSite: SavedSite, deleteBookmark: Boolean = false)

Deletes a SavedSite

Link copied to clipboard
abstract fun deleteAll()

Deletes all SavedSites

Link copied to clipboard

Deletes all Bookmark and BookmarkFolder inside a folder. Used when Deleting a folder and its content

Link copied to clipboard
abstract fun favoritesCount(): Long

Returns total number of Favorite

Link copied to clipboard

Returns Bookmark given a URL

Link copied to clipboard

Returns Bookmark given an ID

Link copied to clipboard
abstract fun getBookmarks(): Flow<List<SavedSite.Bookmark>>

Returns all Bookmark in the Database

Link copied to clipboard

Returns all Bookmark in the Database

Link copied to clipboard

Returns complete list of all Bookmark This method traverses all folders.

Link copied to clipboard

Returns a Favorite given a domain

Link copied to clipboard

Returns a Favorite given a domain

Link copied to clipboard
abstract fun getFavorites(): Flow<List<SavedSite.Favorite>>

Returns all Favorite in the Database

Link copied to clipboard
abstract fun getFavoritesCountByDomain(domain: String): Int

Returns amount of Favorite given a domain

Link copied to clipboard

Returns all Favorite in the Database

Link copied to clipboard

Returns all Favorite in the Database

Link copied to clipboard
abstract fun getFolder(folderId: String): BookmarkFolder?

Returns a BookmarkFolder based on its id

Link copied to clipboard
Link copied to clipboard
abstract fun getFolderByName(folderName: String): BookmarkFolder?

Returns a BookmarkFolder based on its name

Link copied to clipboard
abstract fun getFolderTree(selectedFolderId: String, currentFolder: BookmarkFolder?): List<BookmarkFolderItem>

Returns complete list of BookmarkFolderItem inside a folder. This method traverses all folders.

Link copied to clipboard
abstract fun getFolderTreeItems(folderId: String): List<FolderTreeItem>

Returns all Bookmark and BookmarkFolder inside a folder

Link copied to clipboard
abstract fun getSavedSite(id: String): SavedSite?

Returns SavedSite given an ID

Link copied to clipboard
abstract fun getSavedSites(folderId: String): Flow<SavedSites>

Returns all SavedSites inside a folder

Link copied to clipboard
abstract fun hasBookmarks(): Boolean

Returns if the user has any Bookmark

Link copied to clipboard
abstract fun hasFavorites(): Boolean

Returns if the user has any Favorite

Link copied to clipboard
abstract fun insert(folder: BookmarkFolder): BookmarkFolder

Inserts a new BookmarkFolder Used when adding a BookmarkFolder from the Bookmarks screen

abstract fun insert(savedSite: SavedSite): SavedSite

Inserts a new SavedSite Used when undoing the deletion of a Bookmark or Favorite

Link copied to clipboard
abstract fun insertBookmark(url: String, title: String): SavedSite.Bookmark

Inserts a new Bookmark Used when adding a Bookmark from the Browser Menu

Link copied to clipboard
abstract fun insertFavorite(id: String = "", url: String, title: String, lastModified: String? = null): SavedSite.Favorite

Inserts a new Favorite Used when adding a Favorite from the Browser Menu

Link copied to clipboard
abstract fun insertFolderBranch(branchToInsert: FolderBranch)

Inserts all Bookmark and BookmarkFolder in a folder. Used when Undoing deleteFolderBranch

Link copied to clipboard
abstract fun lastModified(): Flow<String>

Returns the id the last modified SavedSite

Link copied to clipboard
abstract fun pruneDeleted()

Deletes all entities with deleted = 1 This makes the deletion permanent

Link copied to clipboard
abstract fun replaceFolderContent(folder: BookmarkFolder, oldId: String)

Replaces an existing BookmarkFolder Used when syncing data from the backend There are scenarios when a duplicate remote folder has to be replace the local one

Link copied to clipboard
abstract fun update(folder: BookmarkFolder)

Updates an existing BookmarkFolder Used when updating a BookmarkFolder from the Bookmarks screen

Link copied to clipboard
abstract fun updateBookmark(bookmark: SavedSite.Bookmark, fromFolderId: String, updateFavorite: Boolean = false)

Updates the content of a Bookmark

Link copied to clipboard
abstract fun updateFavourite(favorite: SavedSite.Favorite)

Updates the content of a Favorite

Link copied to clipboard
abstract fun updateFolderRelation(folderId: String, entities: List<String>)

Deletes and re-inserts a folder relation

Link copied to clipboard
abstract fun updateWithPosition(favorites: List<SavedSite.Favorite>)

Updates the position of Favorite Used when reordering Favorite in the QuickAccessPanel