ContentLocation

interface ContentLocation

Represents a location within a ReaderPublication and methods to extract information related to that location.

Properties

Link copied to clipboard

Used for fetching publication text content related to this ContentLocation.

Link copied to clipboard

The locator pointing to this content location.

Functions

Link copied to clipboard
abstract fun collapseToEnd(onSuccess: (ContentLocation) -> Unit, onError: (ColibrioException) -> Unit)

If this ContentLocation represents a range, it creates a new ContentLocation by collapsing the locator to its end position. If this ContentLocation does not represent a range, it creates a new ContentLocation with the locator untouched.

Link copied to clipboard
abstract fun collapseToStart(onSuccess: (ContentLocation) -> Unit, onError: (ColibrioException) -> Unit)

If this ContentLocation represents a range, it creates a new ContentLocation by collapsing the locator to its start position. If this ContentLocation does not represent a range, it creates a new ContentLocation with the locator untouched.

Link copied to clipboard
abstract suspend fun contains(otherLocation: SimpleLocatorData): ColibrioResult<Boolean>
abstract fun contains(otherLocation: SimpleLocatorData, onSuccess: (Boolean) -> Unit, onError: (ColibrioException) -> Unit)

Check if the passed locator is equal to this one, or is contained inside this ContentLocation.

abstract suspend fun contains(otherLocation: ReaderPublicationNavigationItem): ColibrioResult<Boolean>
abstract fun contains(otherLocation: ReaderPublicationNavigationItem, onSuccess: (Boolean) -> Unit, onError: (ColibrioException) -> Unit)

Check if the passed navigation item is equal to this one, or is contained inside this ContentLocation.

Link copied to clipboard
abstract suspend fun createRangeTo(endLocation: SimpleLocatorData): ColibrioResult<ContentLocation>
abstract fun createRangeTo(endLocation: SimpleLocatorData, onSuccess: (ContentLocation) -> Unit, onError: (ColibrioException) -> Unit)
abstract fun createRangeTo(endLocation: ReaderPublicationNavigationItem, onSuccess: (ContentLocation) -> Unit, onError: (ColibrioException) -> Unit)

Creates a new ContentLocation representing the range from the start of this instance to the end of endLocation.

Link copied to clipboard
abstract suspend fun equalsLocator(otherLocation: SimpleLocatorData): ColibrioResult<Boolean>
abstract fun equalsLocator(otherLocation: SimpleLocatorData, onSuccess: (Boolean) -> Unit, onError: (ColibrioException) -> Unit)

Check if this ContentLocation target exactly the same content as the passed locator.

abstract fun equalsLocator(otherLocation: ReaderPublicationNavigationItem, onSuccess: (Boolean) -> Unit, onError: (ColibrioException) -> Unit)

Check if this ContentLocation target exactly the same content as the passed navigation item.

Link copied to clipboard

Fetches a collection of navigation item references related with this content location.

Link copied to clipboard
abstract fun fetchReaderDocuments(onSuccess: (List<ReaderDocument>) -> Unit, onError: (ColibrioException) -> Unit)

Fetch the ReaderDocuments that this ContentLocation targets.

Link copied to clipboard
abstract suspend fun intersects(otherLocation: SimpleLocatorData): ColibrioResult<Boolean>
abstract fun intersects(otherLocation: SimpleLocatorData, onSuccess: (Boolean) -> Unit, onError: (ColibrioException) -> Unit)

Check if this ContentLocation intersects with another locator.

abstract suspend fun intersects(otherLocation: ReaderPublicationNavigationItem): ColibrioResult<Boolean>
abstract fun intersects(otherLocation: ReaderPublicationNavigationItem, onSuccess: (Boolean) -> Unit, onError: (ColibrioException) -> Unit)

Check if this ContentLocation intersects with another navigation item.

Link copied to clipboard
abstract suspend fun isAfter(otherLocation: SimpleLocatorData): ColibrioResult<Boolean>
abstract fun isAfter(otherLocation: SimpleLocatorData, onSuccess: (Boolean) -> Unit, onError: (ColibrioException) -> Unit)

Check if this ContentLocation is strictly after the passed locator. Returns false if the locations are intersecting.

abstract suspend fun isAfter(otherLocation: ReaderPublicationNavigationItem): ColibrioResult<Boolean>
abstract fun isAfter(otherLocation: ReaderPublicationNavigationItem, onSuccess: (Boolean) -> Unit, onError: (ColibrioException) -> Unit)

Check if this ContentLocation is strictly after the passed navigation item. Returns false if the locations are intersecting.

Link copied to clipboard
abstract suspend fun isBefore(otherLocation: SimpleLocatorData): ColibrioResult<Boolean>
abstract fun isBefore(otherLocation: SimpleLocatorData, onSuccess: (Boolean) -> Unit, onError: (ColibrioException) -> Unit)

Check if this ContentLocation is strictly before the passed locator. Returns false if the locations are intersecting.

abstract suspend fun isBefore(otherLocation: ReaderPublicationNavigationItem): ColibrioResult<Boolean>
abstract fun isBefore(otherLocation: ReaderPublicationNavigationItem, onSuccess: (Boolean) -> Unit, onError: (ColibrioException) -> Unit)

Check if this ContentLocation is strictly before the passed navigation item. Returns false if the locations are intersecting.