use elicitation::Established;
use crate::{
SrgbColor, WcagAccessibleAuthentication, WcagBypassBlocksMechanism, WcagColorNotSoleConveyor,
WcagConsistentHelpLocated, WcagContrastMinimumNormalText, WcagErrorIdentificationDescriptive,
WcagFocusAppearanceMinimumArea, WcagFocusIndicatorContrast, WcagFocusOrderLogical,
WcagFocusVisibleKeyboard, WcagIdentificationConsistent, WcagInfoAndRelationshipsProgrammatic,
WcagKeyboardNotTrapped, WcagKeyboardOperable, WcagLabelsOrInstructionsPresent,
WcagLinkPurposeFromContext, WcagNamePresent, WcagNameRoleValueProgrammatic,
WcagNavigationConsistent, WcagNonTextContrastMinimum, WcagOperableValid,
WcagPageLanguageIdentified, WcagPageTitled, WcagPerceivedValid, WcagPointerCancellationUpEvent,
WcagRedundantEntryMinimized, WcagRobustValid, WcagStatusMessagesProgrammatic,
WcagTargetSizeMinimum, WcagTextResizable, WcagUnderstandableValid, WidgetId,
};
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ContrastDescriptor {
pub foreground: SrgbColor,
pub background: SrgbColor,
}
#[derive(Debug, Clone, PartialEq)]
pub struct LabelDescriptor {
pub name: String,
pub role: String,
pub labelled_by: Option<WidgetId>,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct FocusDescriptor {
pub widget: WidgetId,
pub indicator_area_px: f64,
pub indicator_contrast: f64,
}
#[derive(Debug, Clone, PartialEq)]
pub struct KeyboardDescriptor {
pub widget: WidgetId,
pub tab_index: i32,
pub shortcut: Option<char>,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct TimingDescriptor {
pub element: WidgetId,
pub max_seconds: Option<u64>,
pub can_pause: bool,
pub can_extend: bool,
pub can_turn_off: bool,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct TargetDescriptor {
pub widget: WidgetId,
pub width_px: f64,
pub height_px: f64,
pub adjacent_spacing_px: f64,
}
#[derive(Debug, Clone, PartialEq)]
pub struct StructureDescriptor {
pub label: String,
pub role: String,
pub heading_level: Option<u8>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct MediaDescriptor {
pub label: String,
pub has_captions: bool,
pub has_audio_description: bool,
pub has_transcript: bool,
}
#[derive(Debug, Clone, PartialEq)]
pub struct LanguageDescriptor {
pub page_lang: String,
pub element_lang: Option<String>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct ErrorDescriptor {
pub widget: WidgetId,
pub error_text: Option<String>,
pub suggestion: Option<String>,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ContrastPair {
pub foreground: SrgbColor,
pub background: SrgbColor,
pub ratio: f64,
}
#[derive(Debug, Clone, PartialEq)]
pub struct LabeledElement {
pub id: WidgetId,
pub name: String,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct FocusIndicator {
pub widget: WidgetId,
pub area_px: f64,
pub contrast: f64,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct KeyboardPath {
pub widget: WidgetId,
pub tab_index: i32,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct TimedElement {
pub widget: WidgetId,
pub max_seconds: Option<u64>,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct PointerTarget {
pub id: WidgetId,
pub width_px: f64,
pub height_px: f64,
}
#[derive(Debug, Clone, PartialEq)]
pub struct StructuredElement {
pub id: WidgetId,
pub role: String,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct CaptionedMedia {
pub id: WidgetId,
}
#[derive(Debug, Clone, PartialEq)]
pub struct LanguagePage {
pub lang: String,
}
#[derive(Debug, Clone, PartialEq)]
pub struct ErrorField {
pub id: WidgetId,
pub description: String,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct PerceivedSection {
pub validated_count: usize,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct OperableInterface {
pub validated_count: usize,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct UnderstandableInterface {
pub validated_count: usize,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct RobustWidget {
pub validated_count: usize,
}
#[derive(Debug, Clone, Copy)]
pub struct PerceivedEvidence {
pub contrast_normal: Established<WcagContrastMinimumNormalText>,
pub non_text_contrast: Established<WcagNonTextContrastMinimum>,
pub focus_contrast: Established<WcagFocusIndicatorContrast>,
pub color_not_sole: Established<WcagColorNotSoleConveyor>,
pub text_resizable: Established<WcagTextResizable>,
pub structure: Established<WcagInfoAndRelationshipsProgrammatic>,
pub name_present: Established<WcagNamePresent>,
}
#[derive(Debug, Clone, Copy)]
pub struct OperableEvidence {
pub keyboard_operable: Established<WcagKeyboardOperable>,
pub no_keyboard_trap: Established<WcagKeyboardNotTrapped>,
pub focus_order: Established<WcagFocusOrderLogical>,
pub focus_visible: Established<WcagFocusVisibleKeyboard>,
pub focus_appearance: Established<WcagFocusAppearanceMinimumArea>,
pub bypass_blocks: Established<WcagBypassBlocksMechanism>,
pub page_titled: Established<WcagPageTitled>,
pub link_purpose: Established<WcagLinkPurposeFromContext>,
pub pointer_cancel: Established<WcagPointerCancellationUpEvent>,
pub target_minimum: Established<WcagTargetSizeMinimum>,
}
#[derive(Debug, Clone, Copy)]
pub struct UnderstandableEvidence {
pub page_language: Established<WcagPageLanguageIdentified>,
pub navigation_consistent: Established<WcagNavigationConsistent>,
pub identification_consistent: Established<WcagIdentificationConsistent>,
pub error_identified: Established<WcagErrorIdentificationDescriptive>,
pub labels_present: Established<WcagLabelsOrInstructionsPresent>,
pub help_located: Established<WcagConsistentHelpLocated>,
pub redundant_entry: Established<WcagRedundantEntryMinimized>,
pub accessible_auth: Established<WcagAccessibleAuthentication>,
}
#[derive(Debug, Clone, Copy)]
pub struct RobustEvidence {
pub name_role_value: Established<WcagNameRoleValueProgrammatic>,
pub status_messages: Established<WcagStatusMessagesProgrammatic>,
}
#[derive(Debug, Clone, Copy)]
pub struct LevelAaEvidence {
pub perceived: Established<WcagPerceivedValid>,
pub operable: Established<WcagOperableValid>,
pub understandable: Established<WcagUnderstandableValid>,
pub robust: Established<WcagRobustValid>,
}