Files

72 lines
2.4 KiB
Go

// Fenrir console screen reader.
// Copyright (c) 2026 Storm Dragon
// SPDX-License-Identifier: GPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.html>.
package presentation
// Cue identifies an optional sound independently of the spoken text.
type Cue string
// Message pairs text with an optional sound that replaces the spoken message.
// The cue comes from the event, never from matching the text's spelling.
type Message struct {
// Character preserves the source rune for profile-based character naming.
Character *rune
Attributes *Attributes
Indentation *Indentation
Text string
Cue Cue
}
// Attributes marks feedback that obeys mute and may combine a cue and speech.
type Attributes struct{ Speech bool }
// Indentation requests a generated tone, with optional simultaneous speech.
// Message.Text remains the speech fallback when sound is unavailable.
type Indentation struct {
Level int
Speech bool
}
// Spelling carries source text separately from announcements and punctuation
// names. Each rune is presented once, in order, by the shared speech presenter.
type Spelling struct {
Text string
Phonetic bool
}
const (
Ready Cue = "ready"
Stopped Cue = "stopped"
TTYChanged Cue = "tty_changed"
SpeechOn Cue = "speech_on"
SpeechOff Cue = "speech_off"
Blank Cue = "blank"
HasAttributes Cue = "has_attributes"
Misspelled Cue = "misspelled"
Capital Cue = "capital"
Top Cue = "top"
Bottom Cue = "bottom"
LineStart Cue = "line_start"
LineEnd Cue = "line_end"
Error Cue = "error"
Accept Cue = "accept"
PlaceStartMark Cue = "place_start_mark"
PlaceEndMark Cue = "place_end_mark"
CopyToClipboard Cue = "copy_to_clipboard"
PasteClipboard Cue = "paste_clipboard"
)