summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-11-13 15:53:44 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2023-11-14 08:09:02 +0100
commitd6c6472bbe1c90b733a4d69c4c8528f4de3750d3 (patch)
treec8a36eea0bd19c3a3c2a866222a8d178e9be1a90 /vcl
parent74c1e23c80eef5e246acfbfdf2287b49303ecc6f (diff)
tdf#123864 a11y: Add new AccessibleStateType::CHECKABLE
Both, AT-SPI and IAccessible2 have a CHECKABLE state that describes whether an item is checkable, i.e. whether it can be checked, i.e. whether it is possible that this object can have the CHECKED state. So far, LibreOffice didn't have any equivalent, and e.g. a checkbox that is ticked would report state CHECKED but not CHECKABLE, which is inconsistent. ("How can an object that is not checkable be checked?") For an unchecked object, the fact that it can be checked is unclear since that one will just have the CHECKED state not being present. Introduce a new a11y state, `AccessibleStateType::CHECKABLE` with the same semantics as in AT-SPI and IAccessible2 to bridge the gap. Map the state in winaccessibility (to IAccessible2), gtk3 and an the Qt-based VCL plugins, which are responsible for mapping to AT-SPI. While Qt has an equivalent state flag, it currently doesn't map that to AT-SPI yet. Pending upstream Gerrit change to implement that: [1] The gtk4 a11y API doesn't have a direct equivalent and will be handled separately in a following commit. Reporting the new state where applicable will be implemented in following commits. [1] https://codereview.qt-project.org/c/qt/qtbase/+/517844 Change-Id: I6aa7fec3b3bd728a5cfedcdc8d6b66f06337f7ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159382 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qt5/QtAccessibleWidget.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/atkwrapper.cxx1
2 files changed, 4 insertions, 0 deletions
diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index 47eb08b7e8c7..7eadc3313834 100644
--- a/vcl/qt5/QtAccessibleWidget.cxx
+++ b/vcl/qt5/QtAccessibleWidget.cxx
@@ -578,6 +578,9 @@ void lcl_addState(QAccessible::State* state, sal_Int64 nState)
case AccessibleStateType::BUSY:
state->busy = true;
break;
+ case AccessibleStateType::CHECKABLE:
+ state->checkable = true;
+ break;
case AccessibleStateType::CHECKED:
state->checked = true;
break;
diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx b/vcl/unx/gtk3/a11y/atkwrapper.cxx
index 8caf40020d13..49b1d371ae12 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx
@@ -125,6 +125,7 @@ AtkStateType mapAtkState( sal_Int64 nState )
MAP_DIRECT( ACTIVE );
MAP_DIRECT( ARMED );
MAP_DIRECT( BUSY );
+ MAP_DIRECT( CHECKABLE );
MAP_DIRECT( CHECKED );
MAP_DIRECT( EDITABLE );
MAP_DIRECT( ENABLED );