-
- All Implemented Interfaces:
-
org.readium.r2.shared.JSONable
public final class HtmlDecorationTemplate implements JSONableAn HtmlDecorationTemplate renders a Decoration into a set of HTML elements and associated stylesheet.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumHtmlDecorationTemplate.LayoutDetermines the number of created HTML elements and their position relative to the matching DOM range.
public enumHtmlDecorationTemplate.WidthIndicates how the width of each created HTML element expands in the viewport.
public classHtmlDecorationTemplate.Companion
-
Field Summary
Fields Modifier and Type Field Description private final HtmlDecorationTemplate.Layoutlayoutprivate final HtmlDecorationTemplate.Widthwidthprivate final Function1<Decoration, String>elementprivate final Stringstylesheet
-
Constructor Summary
Constructors Constructor Description HtmlDecorationTemplate(HtmlDecorationTemplate.Layout layout, HtmlDecorationTemplate.Width width, Function1<Decoration, String> element, String stylesheet)
-
Method Summary
Modifier and Type Method Description final HtmlDecorationTemplate.LayoutgetLayout()final HtmlDecorationTemplate.WidthgetWidth()final Function1<Decoration, String>getElement()final StringgetStylesheet()JSONObjecttoJSON()-
-
Constructor Detail
-
HtmlDecorationTemplate
HtmlDecorationTemplate(HtmlDecorationTemplate.Layout layout, HtmlDecorationTemplate.Width width, Function1<Decoration, String> element, String stylesheet)
- Parameters:
layout- Determines the number of created HTML elements and their position relative to the matching DOM range.width- Indicates how the width of each created HTML element expands in the viewport.element- Closure used to generate a new HTML element for the given Decoration.stylesheet- A CSS stylesheet which will be injected in the resource, which can be referenced by the created elements.
-
-
Method Detail
-
getLayout
final HtmlDecorationTemplate.Layout getLayout()
-
getWidth
final HtmlDecorationTemplate.Width getWidth()
-
getElement
final Function1<Decoration, String> getElement()
-
getStylesheet
final String getStylesheet()
-
toJSON
JSONObject toJSON()
-
-
-
-