KiteReadingItem

class KiteReadingItem(val role: KiteRole, val text: String, val headingLevel: Int = 0, val sourceType: String? = null, val pronunciation: String? = null, val alphabet: String? = null, val language: String? = null, val bounds: KiteRectangle? = null)(source)

One stop in a page's reading order: what a screen reader would announce, in the order it would announce it. KitePage.readingOrder gives the items of a page of any format.

for (item in page.readingOrder()) {
when (item.role) {
KiteRole.HEADING -> speakHeading(item.text, item.headingLevel)
else -> speak(item.text)
}
}

Constructors

Link copied to clipboard
constructor(role: KiteRole, text: String, headingLevel: Int = 0, sourceType: String? = null, pronunciation: String? = null, alphabet: String? = null, language: String? = null, bounds: KiteRectangle? = null)

Properties

Link copied to clipboard

the phonetic alphabet of pronunciation, such as ipa, or null.

Link copied to clipboard

where the item is on its page, in display space: points from the top-left corner, y down, with the smaller y in KiteRectangle.bottom. Null when the page cannot tell, such as for a PDF figure whose structure gives no box (#427).

Link copied to clipboard

1 to 6 for a KiteRole.HEADING, 0 for everything else.

Link copied to clipboard

the language of text when the source gives one, such as fr, or null.

Link copied to clipboard

how a speech engine says text, from an EPUB ssml:ph, or null. The item then holds the words of that element only.

Link copied to clipboard
Link copied to clipboard

the source's own name for the content, or null: the epub:type of an EPUB element, such as footnote, or the structure type of a tagged PDF element, such as Note.

Link copied to clipboard

the words to announce. Blank only for an image without alternative text.

Functions

Link copied to clipboard
open override fun toString(): String