Represents the Marking state where the user uses Shift-Left/Shift-Right to mark a phrase to be added to their custom phrases. A Marking state still has a composingBuffer, and the invariant is that composingBuffer = head + markedText + tail. Unlike cursorIndex, which is UTF-8 based, markStartGridCursorIndex is in the same unit that a Gramambular's grid builder uses. In other words, markStartGridCursorIndex is the beginning position of the reading cursor. This makes it easy for a key handler to know where the marked range is when combined with the grid builder's (reading) cursor index.

Hierarchy (view full)

Constructors

  • Parameters

    • buf: string
    • index: number
    • tooltipText: string
    • startCursorIndexInGrid: number
    • headText: string
    • markedText: string
    • tailText: string
    • readingText: string
    • canAccept: boolean

    Returns Marking

Properties

acceptable: boolean

Whether the marked text could be saved to the user phrases.

composingBuffer: string
cursorIndex: number
head: string

THe text before the marked text.

markedText: string

The marked text.

markStartGridCursorIndex: number

The index of the cursor that the user starts to make a marked range. It helps to restore the position of the cursor.

reading: string

The Bopomofo reading of the marked text.

tail: string

The text after the marked text.

tooltip: string

Methods