summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-10-16 17:58:54 +0200
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-10-25 18:30:08 +0200
commit18a538ed40d5419b7f9edf5e42730113447ed527 (patch)
treedfbb8c08d4d1abeca7027d37fd55afa418a85ca3 /src/plugins/platforms/cocoa/qcocoaaccessibility.mm
parente859de3fb5203579fbb4a6774bcdf59dc00404f9 (diff)
Add searchEdit as accessible state
The search state is used by VoiceOver on iOS to announce a search field. Change-Id: I464125827dbbf275daf38104e26e9591bb23365a Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaaccessibility.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibility.mm17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
index 1ade985b79..00baeddb39 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
@@ -162,7 +162,7 @@ static void populateRoleMap()
}
/*
- Returns a Mac accessibility role for the given interface, or
+ Returns a Cocoa accessibility role for the given interface, or
NSAccessibilityUnknownRole if no role mapping is found.
*/
NSString *macRole(QAccessibleInterface *interface)
@@ -190,13 +190,24 @@ NSString *macRole(QAccessibleInterface *interface)
}
/*
- Mac accessibility supports ignoring elements, which means that
+ Returns a Cocoa sub role for the given interface.
+*/
+NSString *macSubrole(QAccessibleInterface *interface)
+{
+ QAccessible::State s = interface->state();
+ if (s.searchEdit)
+ return NSAccessibilitySearchFieldSubrole;
+ return nil;
+}
+
+/*
+ Cocoa accessibility supports ignoring elements, which means that
the elements are still present in the accessibility tree but is
not used by the screen reader.
*/
bool shouldBeIgnored(QAccessibleInterface *interface)
{
- // Mac accessibility does not have an attribute that corresponds to the Invisible/Offscreen
+ // Cocoa accessibility does not have an attribute that corresponds to the Invisible/Offscreen
// state. Ignore interfaces with those flags set.
const QAccessible::State state = interface->state();
if (state.invisible ||