odilia_common/
events.rs

1use serde::{Deserialize, Serialize};
2
3use crate::modes::ScreenReaderMode;
4use atspi::accessible::Role;
5
6#[derive(Eq, PartialEq, Clone, Hash, Serialize, Deserialize)]
7/// A list of features supported natively by Odilia.
8pub enum Feature {
9	/// Unimplemented, but will eventually stop all speech until re-activated.
10	Speech,
11	/// Unimplemented.
12	Braille, // TODO
13}
14
15#[derive(Eq, PartialEq, Clone, Hash, Serialize, Deserialize)]
16#[serde(tag = "direction")]
17pub enum Direction {
18	Forward,
19	Backward,
20}
21
22#[derive(Eq, PartialEq, Clone, Hash, Serialize, Deserialize)]
23#[serde(tag = "event", content = "args", rename_all = "camelCase")]
24/// Events which can be trigged through Odilia's external API.
25/// Subject to change without notice until v1.0, but we're [open to suggestions on our Github](https://github.com/odilia-app/odilia/); please reach out with features you'd like to see.
26pub enum ScreenReaderEvent {
27	/// when we need to do "something" but this is always hardcoded as nothing
28	Noop,
29	/// Stop all current speech.
30	StopSpeech,
31	/// Enable a feature from working.
32	Enable(Feature),
33	/// Disable a feature.
34	Disable(Feature),
35	/// Change mode of the screen reader. This is currently global, but it should be per application, and an update should only affect the current application.
36	ChangeMode(ScreenReaderMode),
37	StructuralNavigation(Direction, Role),
38}