Skip to content

//readium-shared/org.readium.r2.shared.publication.services/PerResourcePositionsService

PerResourcePositionsService

[androidJvm]\ class PerResourcePositionsService(readingOrder: List<Link>, fallbackMediaType: String) : PositionsService

Simple PositionsService for a Publication which generates one position per readingOrder resource.

Parameters

androidJvm

fallbackMediaType Media type that will be used as a fallback if the Link doesn't specify any.

Constructors

PerResourcePositionsService [androidJvm]
fun PerResourcePositionsService(readingOrder: List<Link>, fallbackMediaType: String)

Types

Name Summary
Companion [androidJvm]
object Companion

Functions

Name Summary
close [androidJvm]
open override fun close()
Closes any opened file handles, removes temporary files, etc.
get [androidJvm]
open override fun get(link: Link): Resource?
A service can return a Resource to:
positions [androidJvm]
open suspend fun positions(): List<Locator>
Returns the list of all the positions in the publication.
positionsByReadingOrder [androidJvm]
open suspend override fun positionsByReadingOrder(): List<List<Locator>>
Returns the list of all the positions in the publication, grouped by the resource reading order index.

Properties

Name Summary
links [androidJvm]
open override val links: List<Link>
Links which will be added to Publication.links. It can be used to expose a web API for the service, through Publication.get.