KiteLinkAction

sealed class KiteLinkAction

A tapped link the viewer cannot follow on its own, handed to KiteDocView's onLinkTap.

In-document jumps never arrive here: the viewer scrolls to the target page itself. What reaches you is everything else, and it differs by format, so this type carries the format-native payload instead of flattening it:

  • EPUB links are plain hrefs, so they arrive as Uri.

  • PDF links carry a whole /A action dictionary (a URI, a remote GoTo, a Launch, JavaScript, a form submit), so they arrive as Pdf with the parsed PdfAction untouched.

Opening web links needs no when, because both cases answer uri:

onLinkTap = { link -> link.uri?.let { openInBrowser(it); true } ?: false }

Inheritors

Types

Link copied to clipboard
data class Pdf(val action: PdfAction) : KiteLinkAction

A parsed PDF action the viewer does not perform itself.

Link copied to clipboard
data class Uri(val uri: String) : KiteLinkAction

A plain external URL. EPUB hrefs with a scheme arrive as this.

Properties

Link copied to clipboard
open val uri: String?

The external URL this link points at, or null when it is not a URL.