Raxol.Core.Accessibility.AccessibilityServer (Raxol v2.0.1)
View SourceUnified GenServer implementation for accessibility features in Raxol.
This server consolidates all accessibility state management, eliminating Process dictionary usage across Accessibility, Announcements, and Metadata modules.
Features
- Screen reader announcements with queuing and priority
- High contrast mode management
- Reduced motion support
- Large text support
- Keyboard focus indicators
- Accessibility metadata tracking
- User preference integration
- Theme integration for accessibility
- Announcement history tracking
State Structure
The server maintains state with the following structure:
%{
enabled: boolean(),
preferences: %{
screen_reader: boolean(),
high_contrast: boolean(),
reduced_motion: boolean(),
large_text: boolean(),
keyboard_focus: boolean(),
silence_announcements: boolean()
},
announcements: %{
queue: [announcement],
history: [announcement],
max_history: 100
},
metadata: %{component_id => metadata},
theme_settings: map(),
user_preferences_pid: pid() | nil,
announcement_callback: function() | nil
}
Summary
Functions
Adds an announcement to the queue.
Makes an announcement for screen readers.
Announces with synchronous confirmation.
Returns a specification to start this module under a supervisor.
Clears all announcements from the queue.
Clears announcement history.
Clears announcements for a specific user.
Disables accessibility features.
Enables accessibility features with the given options.
Checks if accessibility is enabled.
Gets announcement history.
Gets a component hint.
Gets component style.
Gets element metadata for a component.
Gets focus history.
Gets accessibility metadata for a component.
Gets the next announcement from the queue.
Gets an option value.
Gets all current preferences.
Gets the current state (for debugging/testing).
Handles focus change events.
Gets high contrast mode status.
Gets large text mode status.
Gets reduced motion mode status.
Registers component style.
Registers element metadata for a component.
Removes metadata for a component.
Gets screen reader support status.
Sets the announcement callback function.
Sets high contrast mode.
Sets keyboard focus indicators.
Sets large text mode.
Sets accessibility metadata for a component.
Sets an option value.
Sets reduced motion mode.
Sets screen reader support.
Checks if announcements should be made.
Unregisters component style.
Unregisters element metadata.
Functions
Adds an announcement to the queue.
Makes an announcement for screen readers.
Options
:priority- Priority level (:high, :medium, :low) default: :medium:interrupt- Whether to interrupt current announcement default: false:language- Language for the announcement
Announces with synchronous confirmation.
Returns a specification to start this module under a supervisor.
See Supervisor.
Clears all announcements from the queue.
Clears announcement history.
Clears announcements for a specific user.
Disables accessibility features.
Enables accessibility features with the given options.
Checks if accessibility is enabled.
Gets announcement history.
Gets a component hint.
Gets component style.
Gets element metadata for a component.
Gets focus history.
Gets accessibility metadata for a component.
Gets the next announcement from the queue.
Gets an option value.
Gets all current preferences.
Gets the current state (for debugging/testing).
Handles focus change events.
Gets high contrast mode status.
Gets large text mode status.
Gets reduced motion mode status.
Registers component style.
Registers element metadata for a component.
Removes metadata for a component.
Gets screen reader support status.
Sets the announcement callback function.
Sets high contrast mode.
Sets keyboard focus indicators.
Sets large text mode.
Sets accessibility metadata for a component.
Sets an option value.
Sets reduced motion mode.
Sets screen reader support.
Checks if announcements should be made.
Unregisters component style.
Unregisters element metadata.