class ScreenReaderMessageGenerator
Defined at line 25 of file ../../src/ui/a11y/lib/screen_reader/screen_reader_message_generator.h
The ScreenReaderMessageGenerator creates screen reader output (node descriptions, hints, etc.),
which is spoken to the user by a tts system. For example, a semantic node which is a button,
with label 'ok', could be represented as: Utterance: 'ok', (with 200 ms delay) Utterance:
'button'.
Public Methods
void ~ScreenReaderMessageGenerator ()
Defined at line 62 of file ../../src/ui/a11y/lib/screen_reader/screen_reader_message_generator.h
void ScreenReaderMessageGenerator (std::unique_ptr<i18n::MessageFormatter> message_formatter)
|message_formatter| is the resourses object used by this class tto retrieeve localized message
strings by their unique MessageId. The language used is the language loaded in
|message_formatter|.
Defined at line 63 of file ../../src/ui/a11y/lib/screen_reader/screen_reader_message_generator.cc
i18n::MessageFormatter * message_formatter_for_test ()
Defined at line 95 of file ../../src/ui/a11y/lib/screen_reader/screen_reader_message_generator.h
std::vector<UtteranceAndContext> DescribeNode (const fuchsia::accessibility::semantics::Node * node, ScreenReaderMessageContext message_context)
Returns a description of the semantic node.
Defined at line 144 of file ../../src/ui/a11y/lib/screen_reader/screen_reader_message_generator.cc
UtteranceAndContext GenerateUtteranceByMessageId (fuchsia::intl::l10n::MessageIds message_id, zx::duration delay, const std::vector<std::string> & arg_names, const std::vector<i18n::MessageFormatter::ArgValue> & arg_values)
Returns an utterance for a message retrieved by message ID. If the message contains positional
named arguments, they must be passed in |arg_names|, with corresponding values in |arg_values|.
Please see MessageFormatter for a full documentation on named arguments.
Defined at line 190 of file ../../src/ui/a11y/lib/screen_reader/screen_reader_message_generator.cc
UtteranceAndContext DescribeCharacterForSpelling (const std::string & character)
Returns an utterance that spells out a single character.
1. Pronounces single symbols: For example, the label '.' may be described as 'dot', if the
current language is English.
2. Pronounces capital letters: For example, the label 'A' may be described as 'capital A'.
If neither of these occur, the original label will be returned.
Note that 'character' should only be a single character (its type is 'string' because not all
UTF-8 grapheme clusters can be represented in a 'char').
Virtual for testing.
Defined at line 417 of file ../../src/ui/a11y/lib/screen_reader/screen_reader_message_generator.cc
UtteranceAndContext DescribeListElementMarkerLabel (const std::string & label)
Helper method that describes a list element marker.
If the node label only contains a single symbol, instead pronounces a canonicalized version
(e.g., " •" becomes "bullet").
Defined at line 436 of file ../../src/ui/a11y/lib/screen_reader/screen_reader_message_generator.cc
Protected Methods
void ScreenReaderMessageGenerator ()
Constructor for mock only.
Defined at line 99 of file ../../src/ui/a11y/lib/screen_reader/screen_reader_message_generator.h