Interface BookmarkProvider
-
- All Implemented Interfaces:
public interface BookmarkProvider
Handles all bookmark related operations on the owning document. Retrieve it with getBookmarkProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
BookmarkProvider.BookmarkListener
Listener for notifying other components when bookmarks change.
-
Method Summary
Modifier and Type Method Description abstract List<Bookmark>
getBookmarks()
Returns the list of bookmarks in the document. abstract Observable<List<Bookmark>>
getBookmarksAsync()
Returns the list of bookmarks in the document. abstract boolean
addBookmark(@NonNull() Bookmark bookmark)
Adds a new bookmark to the document. abstract boolean
removeBookmark(@NonNull() Bookmark bookmark)
Removes bookmark from the document. abstract Completable
addBookmarkAsync(@NonNull() Bookmark bookmark)
Adds bookmark to the document. abstract Completable
removeBookmarkAsync(@NonNull() Bookmark bookmark)
Remove bookmark from the document. abstract void
addBookmarkListener(@NonNull() BookmarkProvider.BookmarkListener listener)
Adds a BookmarkListener for being notified when bookmarks have been changed. abstract void
removeBookmarkListener(@NonNull() BookmarkProvider.BookmarkListener listener)
Removes a previously registered BookmarkListener. abstract boolean
hasUnsavedChanges()
Returns true
if there were any changes to the bookmarks without save.-
-
Method Detail
-
getBookmarks
@NonNull() abstract List<Bookmark> getBookmarks()
Returns the list of bookmarks in the document.
Note: this call may block for a while and should not be called on the main thread.
- Returns:
List of bookmarks or empty list if this document contains no bookmarks.
-
getBookmarksAsync
@NonNull() abstract Observable<List<Bookmark>> getBookmarksAsync()
Returns the list of bookmarks in the document.
- Returns:
Observable stream of bookmarks in the document.
-
addBookmark
abstract boolean addBookmark(@NonNull() Bookmark bookmark)
Adds a new bookmark to the document.
- Parameters:
bookmark
- Bookmark to be added to the document.- Returns:
true
if bookmark was actually added,false
otherwise.
-
removeBookmark
abstract boolean removeBookmark(@NonNull() Bookmark bookmark)
Removes bookmark from the document.
- Parameters:
bookmark
- Bookmark to be removed.- Returns:
true
if bookmark was actually removed,false
otherwise.
-
addBookmarkAsync
@NonNull() abstract Completable addBookmarkAsync(@NonNull() Bookmark bookmark)
Adds bookmark to the document.
- Parameters:
bookmark
- Bookmark to be added.- Returns:
Completable which notifies when addition was successful.
-
removeBookmarkAsync
@NonNull() abstract Completable removeBookmarkAsync(@NonNull() Bookmark bookmark)
Remove bookmark from the document.
- Parameters:
bookmark
- Bookmark to be added.- Returns:
Completable which notifies when removal was successful.
-
addBookmarkListener
abstract void addBookmarkListener(@NonNull() BookmarkProvider.BookmarkListener listener)
Adds a BookmarkListener for being notified when bookmarks have been changed. If the listener has already been added previously, this method will be a no-op. Passing
null
is not allowed, and will result in an exception.- Parameters:
listener
- BookmarkListener that should be notified.
-
removeBookmarkListener
abstract void removeBookmarkListener(@NonNull() BookmarkProvider.BookmarkListener listener)
Removes a previously registered BookmarkListener. Upon calling this method the
listener
will no longer be notified of any changes. If the listener has not been added, this method will be a no-op. Passingnull
is not allowed, and will result in an exception.- Parameters:
listener
- BookmarkListener that should be removed.
-
hasUnsavedChanges
abstract boolean hasUnsavedChanges()
Returns
true
if there were any changes to the bookmarks without save.- Returns:
true
if bookmarks were changed,false
otherwise.
-
-
-
-