skrypton-api / com.waicool20.skrypton.jni.objects / WebViewHighlighter

WebViewHighlighter

class WebViewHighlighter : SKryptonWidget

A class that provides a colored rectangle overlay to highlight certain areas of a web view.

Constructors

<init>

WebViewHighlighter(view: SKryptonWebView, x: Int, y: Int, width: Int, height: Int, fillColor: Boolean = false, color: Color = Color.GREEN)

Main constructor

Properties

color

var color: Color

Color of the highlight.

fillColor

var fillColor: Boolean

Whether or not the highlight should filled or just a border.

handle

val handle: CPointer

Native pointer

Inherited Properties

geometry

var geometry: Rectangle

The geometry of the widget. (x-y coordinates, width and height)

size

var size: Dimension

Dimension of the widget. (Width and height only)

Functions

showFor

fun showFor(seconds: Float, callback: () -> Unit = {}): Unit
fun showFor(seconds: Double, callback: () -> Unit = {}): Unit
fun showFor(duration: Long, unit: TimeUnit = TimeUnit.SECONDS, callback: () -> Unit = {}): Unit

Shows the highlight for a given duration.

showForAndDispose

fun showForAndDispose(seconds: Float, callback: () -> Unit = {}): Unit
fun showForAndDispose(seconds: Double, callback: () -> Unit = {}): Unit
fun showForAndDispose(duration: Long, unit: TimeUnit = TimeUnit.SECONDS, callback: () -> Unit = {}): Unit

Same as showFor but disposes the highlighter before calling the callback.

toggle

fun toggle(): Unit

Toggles the visibility of the highlighter.

Inherited Functions

addOnKeyEventListener

fun addOnKeyEventListener(type: KeyEventType, listener: (event: SKryptonKeyEvent) -> Unit): Unit

Adds a listener for when a key event occurs on this widget.

addOnMouseEventListener

fun addOnMouseEventListener(type: MouseEventType, listener: (event: SKryptonMouseEvent) -> Unit): Unit

Adds a listener for when a mouse event occurs on this widget.

addOnResizeEventListener

fun addOnResizeEventListener(listener: (event: SKryptonResizeEvent) -> Unit): Unit

Adds a listener for when a resize event occurs on this widget.

addOnWheelEventListener

fun addOnWheelEventListener(listener: (event: SKryptonWheelEvent) -> Unit): Unit

Adds a listener for when a mouse wheel event occurs on this widget.

close

open fun close(): Unit

Hides and closes this widget.

hide

fun hide(): Unit

Hides the widget.

isHidden

fun isHidden(): Boolean

Returns true if the widget is hidden.

move

fun move(x: Int, y: Int): Unit

Moves the widget to the given coordinates.

removeOnKeyEventListener

fun removeOnKeyEventListener(type: KeyEventType, listener: (event: SKryptonKeyEvent) -> Unit): Unit

Removes given onKeyEvent listener.

removeOnMouseEventListener

fun removeOnMouseEventListener(type: MouseEventType, listener: (event: SKryptonMouseEvent) -> Unit): Unit

Removes given onMouseEvent listener.

removeOnResizeEventListener

fun removeOnResizeEventListener(listener: (event: SKryptonResizeEvent) -> Unit): Unit

Removes given onResizeEvent listener.

removeOnWheelEventListener

fun removeOnWheelEventListener(listener: (event: SKryptonWheelEvent) -> Unit): Unit

Removes given onWheelEvent listener.

resize

fun resize(width: Int, height: Int): Unit

Resizes the widget.

show

fun show(): Unit

Makes the widget visible.