You.i Engine
CYIAccessibilityAttributes Class Reference

Detailed Description

An accessibility attributes defines the accessibility related properties of the containing scene node.

The CYIAccessibilityAttributes will be a member variable of CYISceneNode when it is required.

The attributes are:

  • label: string that gets announced when the containing node highlighted
  • hint: string that explains about the containing node
  • role: string that defines the type of node
  • state: string that defines the states of the node
  • action: object with name and label that specifies the callback with accessibility event happening

The information can be provide:

  • from AE with a layer comment of composition
  • from RN view props

#include <accessibility/YiAccessibilityAttributes.h>

Classes

struct  Action
 The accessibility Action structure of the CYIAccessibilityAttributes class instance. More...
 

Public Types

enum  Accessible : uint8_t {
  Accessible::Undefined,
  Accessible::Disabled,
  Accessible::Enabled
}
 The accessible type of the CYIAccessibilityAttributes class instance. More...
 
enum  Role {
  Role::None,
  Role::Adjustable,
  Role::Alert,
  Role::Button,
  Role::CheckBox,
  Role::ComboBox,
  Role::Header,
  Role::Image,
  Role::ImageButton,
  Role::KeyboardKey,
  Role::Link,
  Role::Menu,
  Role::MenuBar,
  Role::MenuItem,
  Role::ProgressBar,
  Role::Radio,
  Role::RadioGroup,
  Role::ScrollBar,
  Role::Search,
  Role::SpinButton,
  Role::Summary,
  Role::Switch,
  Role::Tab,
  Role::TabList,
  Role::Text,
  Role::TextField,
  Role::Timer,
  Role::ToolBar
}
 The accessibility Role type of the CYIAccessibilityAttributes class instance. More...
 
enum  State {
  State::None,
  State::Busy,
  State::Disabled,
  State::Checked,
  State::Expanded,
  State::Selected
}
 The accessibility State type of the CYIAccessibilityAttributes class instance. More...
 

Public Member Functions

 CYIAccessibilityAttributes ()
 
const CYIStringGetLabel () const
 
void SetLabel (CYIString label)
 
const CYIStringGetHint () const
 
void SetHint (CYIString hint)
 
Role GetRole () const
 
CYIString GetRoleString () const
 
void SetRole (Role role)
 
void ReplaceStates (std::map< State, bool > states)
 
void SetState (State state, bool value)
 
bool GetState (State state) const
 
CYIString ProduceStatesString () const
 
const std::vector< Action > & GetActions () const
 
void SetActions (std::vector< Action > actions)
 

Public Attributes

CYISignal< CYIStringAccessibilityActionRequested
 

Member Enumeration Documentation

◆ Accessible

The accessible type of the CYIAccessibilityAttributes class instance.

Enumerator
Undefined 

Not implicitly enabled respecting children's state

Disabled 

When a node is disabled, the node and it's children are also disabled.

Enabled 

When a node is enabled, only Enabled children and the node are handled.

◆ Role

The accessibility Role type of the CYIAccessibilityAttributes class instance.

Enumerator
None 
Adjustable 
Alert 
Button 
CheckBox 
ComboBox 
Header 
Image 
ImageButton 
KeyboardKey 
Link 
Menu 
MenuBar 
MenuItem 
ProgressBar 
Radio 
RadioGroup 
ScrollBar 
Search 
SpinButton 
Summary 
Switch 
Tab 
TabList 
Text 
TextField 
Timer 
ToolBar 

◆ State

The accessibility State type of the CYIAccessibilityAttributes class instance.

Enumerator
None 
Busy 
Disabled 
Checked 
Expanded 
Selected 

Constructor & Destructor Documentation

◆ CYIAccessibilityAttributes()

CYIAccessibilityAttributes::CYIAccessibilityAttributes ( )

Member Function Documentation

◆ GetActions()

const std::vector<Action>& CYIAccessibilityAttributes::GetActions ( ) const

Returns the array of accessibility actions.

◆ GetHint()

const CYIString& CYIAccessibilityAttributes::GetHint ( ) const

Returns the accessibility role.

◆ GetLabel()

const CYIString& CYIAccessibilityAttributes::GetLabel ( ) const

Returns the accessibility Label.

Note
If this returns non-empty string, it will be announced instead of text strings of itself or children.

◆ GetRole()

Role CYIAccessibilityAttributes::GetRole ( ) const

Returns the accessibility role.

◆ GetRoleString()

CYIString CYIAccessibilityAttributes::GetRoleString ( ) const

Returns the accessibility role string.

◆ GetState()

bool CYIAccessibilityAttributes::GetState ( State  state) const

Returns the current value of the given state.

◆ ProduceStatesString()

CYIString CYIAccessibilityAttributes::ProduceStatesString ( ) const

Returns the accessibility state string.

◆ ReplaceStates()

void CYIAccessibilityAttributes::ReplaceStates ( std::map< State, bool >  states)

Sets state values.

◆ SetActions()

void CYIAccessibilityAttributes::SetActions ( std::vector< Action actions)

Sets an array of the accessibility actions.

See also
GetActions

◆ SetHint()

void CYIAccessibilityAttributes::SetHint ( CYIString  hint)

Sets the accessibility hint.

See also
GetHint

◆ SetLabel()

void CYIAccessibilityAttributes::SetLabel ( CYIString  label)

Sets the accessibility label.

See also
GetLabel

◆ SetRole()

void CYIAccessibilityAttributes::SetRole ( Role  role)

Sets the accessibility role.

See also
GetRole

◆ SetState()

void CYIAccessibilityAttributes::SetState ( State  state,
bool  value 
)

Sets a boolean value of the state.

Member Data Documentation

◆ AccessibilityActionRequested

CYISignal<CYIString> CYIAccessibilityAttributes::AccessibilityActionRequested

Emitted when an accessibility action is going to happen.


The documentation for this class was generated from the following file: