Publication

class Publication(val manifest: Manifest, val container: Container<Resource> = EmptyContainer(), servicesBuilder: Publication.ServicesBuilder = ServicesBuilder()) : PublicationServicesHolder

The Publication shared model is the entry-point for all the metadata and services related to a Readium publication.

Parameters

manifest

The manifest holding the publication metadata extracted from the publication file.

container

The underlying container used to read publication resources. The default implementation returns Resource.Exception.NotFound for all HREFs.

servicesBuilder

Holds the list of service factories used to create the instances of Publication.Service attached to this Publication.

Constructors

Link copied to clipboard
constructor(manifest: Manifest, container: Container<Resource> = EmptyContainer(), servicesBuilder: Publication.ServicesBuilder = ServicesBuilder())

Types

Link copied to clipboard
class Builder(var manifest: Manifest, var container: Container<Resource>, var servicesBuilder: Publication.ServicesBuilder = ServicesBuilder())

Builds a Publication from its components.

Link copied to clipboard
object Companion
Link copied to clipboard
data class Profile(val uri: String) : Parcelable

Represents a Readium Web Publication Profile a Publication can conform to.

Link copied to clipboard
interface Service : Closeable

Base interface to be implemented by all publication services.

Link copied to clipboard

Builds a list of Publication.Service from a collection of service factories.

Properties

Link copied to clipboard
val baseUrl: Url?

The URL from which the publication resources are relative to, computed from the Link with self relation.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Credentials used to unlock this Publication.

Link copied to clipboard
Link copied to clipboard

Returns whether this Publication is protected by a Content Protection technology.

Link copied to clipboard

Whether the Publication has a restricted access to its resources, and can't be rendered in a Navigator.

Link copied to clipboard

Indicates whether the content of this publication can be searched.

Link copied to clipboard

Identifies fundamental structural components of the publication in order to enable Reading Systems to provide the User efficient access to them.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Provides navigation to positions in the Publication content that correspond to the locations of page boundaries present in a print source being represented by this EPUB Publication.

Link copied to clipboard

The error raised when trying to unlock the Publication, if any.

Link copied to clipboard

User-facing name for this Content Protection, e.g. "Readium LCP". It could be used in a sentence such as "Protected by {name}".

Link copied to clipboard

Known technology for this type of Content Protection.

Link copied to clipboard

Identifies a list of resources in reading order for the publication.

Link copied to clipboard

Identifies resources that are necessary for rendering the publication.

Link copied to clipboard

Manages consumption of user rights and permissions.

Link copied to clipboard

Default value for the search options of this publication.

Link copied to clipboard

Identifies the collection that contains a table of contents.

Functions

Link copied to clipboard
open override fun close()

Closes any opened resource associated with the Publication, including services.

Link copied to clipboard

Returns whether this publication conforms to the given Readium Web Publication Profile.

Link copied to clipboard
fun Publication.content(start: Locator? = null): Content?

Creates a Content starting from the given start location, or the beginning of the publication when missing.

Link copied to clipboard
suspend fun Publication.cover(): Bitmap?

Returns the publication cover as a Bitmap at its maximum size.

Link copied to clipboard
suspend fun Publication.coverFitting(maxSize: Size): Bitmap?

Returns the publication cover as a Bitmap, scaled down to fit the given maxSize.

Link copied to clipboard
open override fun <T : Publication.Service> findService(serviceType: KClass<T>): T?

Returns the first publication service that is an instance of serviceType.

Link copied to clipboard
open override fun <T : Publication.Service> findServices(serviceType: KClass<T>): List<T>

Returns all the publication services that are instances of serviceType.

Link copied to clipboard
fun get(link: Link): Resource?

Returns the resource targeted by the given non-templated link.

fun get(href: Url): Resource?

Returns the resource targeted by the given href.

Link copied to clipboard

Finds all Links having the given rel in the publications's links.

Link copied to clipboard
fun linkWithHref(href: Url): Link?

Finds the first Link with the given HREF in the publication's links.

Link copied to clipboard
fun linkWithRel(rel: String): Link?

Finds the first Link having the given rel in the publications's links.

Link copied to clipboard
suspend fun Publication.locate(locator: Locator): Locator?

Locates the target of the given locator.

Link copied to clipboard
suspend fun Publication.locateProgression(totalProgression: Double): Locator?

Locates the target at the given progression relative to the whole publication.

Link copied to clipboard

Creates a new Locator object from a Link to a resource of this publication.

Link copied to clipboard

Returns the list of all the positions in the publication.

Link copied to clipboard

Returns the list of all the positions in the publication, grouped by the resource reading order index.

Link copied to clipboard
suspend fun Publication.search(query: String, options: SearchService.Options? = null): SearchIterator?

Starts a new search through the publication content, with the given query.

Link copied to clipboard
fun url(locator: Locator): Url

Returns the URL to the resource represented by the given locator, relative to the publication's link with self relation.

fun url(href: Href, parameters: Map<String, String> = emptyMap()): Url

Returns the URL to the resource represented by the given href, relative to the publication's link with self relation.

fun url(link: Link, parameters: Map<String, String> = emptyMap()): Url

Returns the URL to the resource represented by the given link, relative to the publication's link with self relation.