K3InputMethodState

abstract class K3InputMethodState<S : K3InputMethodState<S, E>, E : K3Editor>(val model: K3Model, val editor: E, val content: K3Content, val touchLayerId: K3LayerId)(source)

Represents the current input method state.

This class is designed to be extensible with new properties for custom state, while allowing the base runtime classes to also update the state.

Inheritors

Constructors

Link copied to clipboard
constructor(model: K3Model, editor: E, content: K3Content, touchLayerId: K3LayerId)

Properties

Link copied to clipboard

The currently cached content. Matches the editor's real content on a best-effort basis.

Link copied to clipboard
val editor: E

The current editor we are connected to.

Link copied to clipboard

The current K3Model active. Is used for all sorts of matching, including transform rules. A change in model MUST cause a reset of content, else the behavior is undefined due to possible stale markers. Prefer to use K3InputMethod.switchModel() to ensure correct model switch behavior.

Link copied to clipboard

The current touch layer id that is active. Only relevant for soft keyboards.

Functions

Link copied to clipboard
abstract fun copy(model: K3Model = this.model, editor: E = this.editor, content: K3Content = this.content, touchLayerId: K3LayerId = this.touchLayerId): S

Copies this state with new model, editor, content, and touchLayerId. Any additional custom properties are expected to be unchanged (i.e. copied as is).

Link copied to clipboard
operator override fun equals(other: Any?): Boolean
Link copied to clipboard
override fun hashCode(): Int