Skip to main content

argui_accessibility/
relations.rs

1use crate::SemanticNodeId;
2
3/// References resolved in one semantic tree; no renderer or widget keys escape here.
4#[derive(Clone, Debug, Default, PartialEq, Eq)]
5pub struct SemanticRelations {
6    pub labelled_by: Vec<SemanticNodeId>,
7    pub described_by: Vec<SemanticNodeId>,
8    pub controls: Vec<SemanticNodeId>,
9    pub active_descendant: Option<SemanticNodeId>,
10}
11
12impl SemanticRelations {
13    pub const fn new() -> Self {
14        Self {
15            labelled_by: Vec::new(),
16            described_by: Vec::new(),
17            controls: Vec::new(),
18            active_descendant: None,
19        }
20    }
21}
22
23#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
24pub struct GridPosition {
25    pub row_count: Option<u32>,
26    pub column_count: Option<u32>,
27    /// One-based logical position, including unmounted rows and columns.
28    pub row_index: Option<u32>,
29    pub column_index: Option<u32>,
30}
31
32#[derive(Clone, Copy, Debug, PartialEq, Eq)]
33pub enum SortDirection {
34    Ascending,
35    Descending,
36}
37
38#[derive(Clone, Copy, Debug, PartialEq, Eq)]
39pub enum PopupKind {
40    Menu,
41    ListBox,
42    Tree,
43    Grid,
44    Dialog,
45}