pl.wendigo.chrome.domain.accessibility.AccessibilityDomain.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chrome-reactive-kotlin Show documentation
Show all versions of chrome-reactive-kotlin Show documentation
Chrome Reactive - low level, remote chrome debugger protocol client (DevTools)
package pl.wendigo.chrome.domain.accessibility
/**
* AccessibilityDomain represents remote debugger protocol domain.
*/
class AccessibilityDomain internal constructor(private val connectionRemote : pl.wendigo.chrome.DebuggerProtocol) {
/**
* Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.
*/
fun getPartialAXTree(input : GetPartialAXTreeRequest) : io.reactivex.Single {
return connectionRemote.runAndCaptureResponse("Accessibility.getPartialAXTree", input, GetPartialAXTreeResponse::class.java).map {
it.value()
}
}
/**
* Returns flowable capturing all Accessibility domains events.
*/
fun events() : io.reactivex.Flowable {
return connectionRemote.captureAllEvents().map { it.value() }.filter {
it.protocolDomain() == "Accessibility"
}
}
}
/**
* Represents request frame that can be used with Accessibility.getPartialAXTree method call.
*
* Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.
*/
data class GetPartialAXTreeRequest (
/**
* ID of node to get the partial accessibility tree for.
*/
val nodeId : pl.wendigo.chrome.domain.dom.NodeId,
/**
* Whether to fetch this nodes ancestors, siblings and children. Defaults to true.
*/
val fetchRelatives : Boolean? = null
)
/**
* Represents response frame for Accessibility.getPartialAXTree method call.
*
* Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.
*/
data class GetPartialAXTreeResponse(
/**
* The Accessibility.AXNode
for this DOM node, if it exists, plus its ancestors, siblings and children, if requested.
*/
val nodes : List
)