Class: Accessibility

Inherits:
Object
  • Object
show all
Defined in:
lib/project/status.rb,
lib/project/constants.rb

Overview

Miscellaneous aliases to determine the status of accessibility components

Constant Summary collapse

Element =
UIAccessibilityElement
Data =
{}
Attributes =
{
:accessibility_identifier => :accessibilityIdentifier,
:accessibility_identifier= => :setAccessibilityIdentifier,
:accessibility_label => :accessibilityLabel,
:accessibility_label= =>  :setAccessibilityLabel,
:accessibility_hint => :accessibilityHint,
:accessibility_hint= => :setAccessibilityHint,
:accessibility_traits => :accessibilityTraits,
:accessibility_value => :accessibilityValue,
:accessibility_value= => :setAccessibilityValue,
:accessibility_language => :accessibilityLanguage,
:accessibility_language= => :setAccessibilityLanguage,
:accessibility_frame => :accessibilityFrame,
:accessibility_frame= => :setAccessibilityFrame,
:accessibility_activation_point => :accessibilityActivationPoint,
:accessibility_activation_point= => :setAccessibilityActivationPoint,
:accessibility_view_is_modal => :accessibilityViewIsModal,
:accessibility_view_is_modal= => :setAccessibilityViewIsModal,
:accessibility_modal_view? => :accessibilityViewIsModal,
:should_group_accessibility_children => :shouldGroupAccessibilityChildren,
:group_accessibility_children? => :shouldGroupAccessibilityChildren,
:should_group_accessibility_children= => :setShouldGroupAccessibilityChildren,
:accessibility_elements_hidden => :accessibilityElementsHidden,
:accessibility_elements_hidden? => :accessibilityElementsHidden,
:accessibility_elements_hidden= => :setAccessibilityElementsHidden,
:accessibility_element_did_become_focused => :accessibilityElementDidBecomeFocused,
:accessibility_element_did_lose_focus => :accessibilityElementDidLoseFocus,
:accessibility_element_is_focused => :accessibilityElementIsFocused,
:accessibility_element_focused? => :accessibilityElementIsFocused,
:accessibility_element? => :isAccessibilityElement,
:is_accessibility_element => :isAccessibilityElement,
:is_accessibility_element= => :isAccessibilityElement=
}
Element_Attributes =
{
:container => :accessibilityContainer,
:container= => :setAccessibilityContainer,
:frame => :accessibilityFrame,
:frame= => :setAccessibilityFrame,
:hint => :accessibilityHint,
:hint= => :setAccessibilityHint,
:label => :accessibilityLabel,
:label= => :setAccessibilityLabel,
:traits => :accessibilityTraits,
:value => :accessibilityValue,
:value= => :setAccessibilityValue,
:did_become_focused => :accessibilityElementDidBecomeFocused,
:did_lose_focus => :accessibilityElementDidLoseFocus,
:is_focused => :accessibilityElementIsFocused,
:focused? => :accessibilityElementIsFocused,
:is_accessibility_element => :isAccessibilityElement,
:is_accessibility_element= => :setIsAccessibilityElement,
:accessibility_element? => :isAccessibilityElement
}
Traits =
{
none: UIAccessibilityTraitNone,
button: UIAccessibilityTraitButton,
link: UIAccessibilityTraitLink,
search_field: UIAccessibilityTraitSearchField,
image: UIAccessibilityTraitImage,
selected: UIAccessibilityTraitSelected,
keyboard_key: UIAccessibilityTraitKeyboardKey,
static_text: UIAccessibilityTraitStaticText,
header: UIAccessibilityTraitHeader,
summary_element: UIAccessibilityTraitSummaryElement,
plays_sound: UIAccessibilityTraitPlaysSound,
starts_media_session: UIAccessibilityTraitStartsMediaSession,
updates_frequently: UIAccessibilityTraitUpdatesFrequently,
adjustable: UIAccessibilityTraitAdjustable,
allows_direct_interaction: UIAccessibilityTraitAllowsDirectInteraction,
causes_page_turn: UIAccessibilityTraitCausesPageTurn,
not_enabled: UIAccessibilityTraitNotEnabled
}
PickerView_Attributes =
{
:accessibility_label_for_component => :accessibilityLabelForComponent,
:accessibility_abel_for_component= => :setAccessibilityLabelForComponent,
:accessibility_hint_for_component => :accessibilityHintForComponent,
:accessibility_hint_for_component= => :setAccessibilityHintForComponent
}
Container_Attributes =
{
:accessibility_element_at_index => :accessibilityElementAtIndex,
:accessibility_element_count => :accessibilityElementCount,
:index_of_accessibility_element => :indexOfAccessibilityElement
}
Reading_Content =
{
accessibility_content_for_line_number: :accessibbilityContentForLineNumber,
accessibility_frame_for_line_number: :accessibilityFrameForLineNumber,
accessibility_line_number_for_point: :accessibilityLineNumberForPoint,
accessibility_page_content: :accessibilityPageContent
}
Actions =
{
:accessibility_decrement => :accessibilityDecrement,
:accessibility_increment => :accessibilityIncrement,
:accessibility_perform_escape => :accessibilityPerformEscape,
:accessibility_perform_magic_tap => :accessibilityPerformMagicTap,
:accessibility_scroll => :accessibilityScroll
}
All_Attributes =
Attributes.merge(Container_Attributes).merge(Reading_Content).merge(Actions)
Notifications =
{
:layout_changed => UIAccessibilityLayoutChangedNotification,
:screen_changed => UIAccessibilityScreenChangedNotification,
:page_scrolled => UIAccessibilityPageScrolledNotification,
:announcement => UIAccessibilityAnnouncementNotification,
:announcement_did_finish => UIAccessibilityAnnouncementDidFinishNotification,
:closed_captioning => UIAccessibilityClosedCaptioningStatusDidChangeNotification,
:guided_access => UIAccessibilityGuidedAccessStatusDidChangeNotification,
:invert_colors => UIAccessibilityInvertColorsStatusDidChangeNotification,
:mono_audio => UIAccessibilityMonoAudioStatusDidChangeNotification,
:voiceover => UIAccessibilityVoiceOverStatusChanged
}
Scroll_Directions =
{
:right => UIAccessibilityScrollDirectionRight,
:left => UIAccessibilityScrollDirectionLeft,
:up => UIAccessibilityScrollDirectionUp,
:down => UIAccessibilityScrollDirectionDown,
:next => UIAccessibilityScrollDirectionNext,
:previous => UIAccessibilityScrollDirectionPrevious
}
Zoom =
{
:announcement_key_string_value => UIAccessibilityAnnouncementKeyStringValue,
:announcement_key_was_successful => UIAccessibilityAnnouncementKeyWasSuccessful
}

Class Method Summary collapse

Class Method Details

.closed_captioning_enabled?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/project/status.rb', line 9

def closed_captioning_enabled?
UIAccessibilityIsClosedCaptioningEnabled()
end

.guided_access_enabled?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/project/status.rb', line 12

def guided_access_enabled?
UIAccessibilityIsGuidedAccessEnabled()
end

.invert_colors_enabled?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/project/status.rb', line 15

def invert_colors_enabled?
UIAccessibilityIsInvertColorsEnabled()
end

.mono_audio_enabled?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/project/status.rb', line 18

def mono_audio_enabled?
UIAccessibilityIsMonoAudioEnabled()
end

.post_notification(notification, *args) ⇒ Object



123
124
125
126
127
128
129
130
131
132
# File 'lib/project/constants.rb', line 123

def Accessibility.post_notification(notification, *args)
if(notification.kind_of?(Fixnum))
UIAccessibilityPostNotification(notification, *args)
elsif(notification.kind_of?(Symbol))
raise "You cannot post #{notification} as an accessibility notification" unless Notifications[notification].kind_of?(Fixnum)
UIAccessibilityPostNotification(Notifications[notification], *args)
else
raise "Unknown accessibility notification #{notification}"
end
end

.registered_gesture_conflict_with_zoomObject



25
26
27
# File 'lib/project/status.rb', line 25

def registered_gesture_conflict_with_zoom
UIAccessibilityRegisterGestureConflictWithZoom()
end

.voiceover_running?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/project/status.rb', line 6

def voiceover_running?
UIAccessibilityIsVoiceOverRunning()
end

.zoom_focused_changed(zoom, frame, view) ⇒ Object



21
22
23
24
# File 'lib/project/status.rb', line 21

def zoom_focused_changed(zoom, frame, view)
zoom=zoom.accessibility_zoom_type if zoom.kind_of?(Symbol)
UIAccessibilityZoomFocusChanged(zoom,frame,view)
end