summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2022-09-08 19:27:31 -0800
committerJim Raykowski <raykowj@gmail.com>2022-09-26 05:55:25 +0200
commit947fe0d89dee75ee43515ef7dfb43837d65a45bc (patch)
tree3fc8c819233f9c22abf7c8c896a6e08aa4fd90c0 /vcl
parenta6abe4a33568d87904fd49c734af4726878af421 (diff)
tdf#119788 tdf#117173 add accessibility NOTIFICATION role
and use it to make screen readers announce notifications from the 'Find and Replace' dialog Change-Id: Ifcf9304883e2e824ea1b7998d7767e474b87c8b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139709 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/osx/a11yrolehelper.mm2
-rw-r--r--vcl/qt5/QtAccessibleWidget.cxx6
-rw-r--r--vcl/source/window/builder.cxx2
-rw-r--r--vcl/unx/gtk3/a11y/atkwrapper.cxx2
4 files changed, 11 insertions, 1 deletions
diff --git a/vcl/osx/a11yrolehelper.mm b/vcl/osx/a11yrolehelper.mm
index 0ea7075277eb..5cb75c94a86f 100644
--- a/vcl/osx/a11yrolehelper.mm
+++ b/vcl/osx/a11yrolehelper.mm
@@ -126,6 +126,7 @@ using namespace ::com::sun::star::uno;
MAP( AccessibleRole::DOCUMENT_SPREADSHEET, NSAccessibilityGroupRole );
MAP( AccessibleRole::DOCUMENT_TEXT, NSAccessibilityGroupRole );
MAP( AccessibleRole::STATIC, NSAccessibilityStaticTextRole );
+ MAP( AccessibleRole::NOTIFICATION, NSAccessibilityStaticTextRole );
#undef MAP
default:
@@ -260,6 +261,7 @@ using namespace ::com::sun::star::uno;
MAP( AccessibleRole::DOCUMENT_TEXT, @"" );
MAP( AccessibleRole::STATIC, @"" );
+ MAP( AccessibleRole::NOTIFICATION, @"" );
#undef MAP
default:
diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index c097d8efd6ac..e2807dd6fecf 100644
--- a/vcl/qt5/QtAccessibleWidget.cxx
+++ b/vcl/qt5/QtAccessibleWidget.cxx
@@ -463,6 +463,12 @@ QAccessible::Role QtAccessibleWidget::role() const
return QAccessible::MenuBar;
case AccessibleRole::MENU_ITEM:
return QAccessible::MenuItem;
+ case AccessibleRole::NOTIFICATION:
+#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 5)
+ return QAccessible::Notification;
+#else
+ return QAccessible::StaticText;
+#endif
case AccessibleRole::OPTION_PANE:
return QAccessible::Pane;
case AccessibleRole::PAGE_TAB:
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 441680aec077..c71b19304813 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -2407,7 +2407,7 @@ namespace BuilderUtils
{ "list box", AccessibleRole::UNKNOWN },
{ "grouping", AccessibleRole::GROUP_BOX },
{ "image map", AccessibleRole::IMAGE_MAP },
- { "notification", AccessibleRole::UNKNOWN },
+ { "notification", AccessibleRole::NOTIFICATION },
{ "info bar", AccessibleRole::UNKNOWN },
{ "level bar", AccessibleRole::UNKNOWN },
{ "title bar", AccessibleRole::UNKNOWN },
diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx b/vcl/unx/gtk3/a11y/atkwrapper.cxx
index 8159bb119e5f..9f0c6e4bbdc0 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx
@@ -343,6 +343,8 @@ static AtkRole mapToAtkRole( sal_Int16 nRole )
return ATK_ROLE_DOCUMENT_TEXT;
case accessibility::AccessibleRole::STATIC:
return ATK_ROLE_STATIC;
+ case accessibility::AccessibleRole::NOTIFICATION:
+ return ATK_ROLE_NOTIFICATION;
default:
SAL_WARN("vcl.gtk", "Unmapped accessible role: " << nRole);
return ATK_ROLE_UNKNOWN;