diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2021-07-28 11:26:16 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2021-07-28 15:45:28 +0200 |
commit | b5ada12ffd0b6b8677430fce117c4c1e38cc9159 (patch) | |
tree | a96fd46a243216c2d9a1a2b98f88a5e6cfa7a023 /accessibility/source/standard | |
parent | 349a8801b9ee98f4f9ee1d35f7d28e17baedf7cc (diff) |
a11y: Add XAccessibleValue::getMinimumIncrement method
Add a method 'getMinimumIncrement' to the XAccessibleValue interface.
The method returns the minimal increment by which the value represented by
the object can be adjusted.
The main motivation is to expose this to AT-SPI, so it can be retrieved e.g.
by libatspi's 'atspi_value_get_minimum_increment' function [1],
s. the note in Change-Id: I8af326c2d24c1801147a56ea2e2a886ab42ac634
"a11y: Expose FormattedField as spinbox" for more details.
The implementation relevant for the 'FormattedField' class is in
'SVTXAccessibleNumericField::getMinimumIncrement', which returns
the spin size.
While at it, also move the comment in sw/source/core/access/acccell.hxx
mentioning what methods are overriden for the 'XAccessibleValue' interface
to the right place.
[1] https://developer.gnome.org/libatspi/stable/libatspi-atspi-value.html#atspi-value-get-minimum-increment
Change-Id: Ie148a4e1cedbdbb5964f8565c81611d3480465cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119596
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'accessibility/source/standard')
8 files changed, 67 insertions, 0 deletions
diff --git a/accessibility/source/standard/svtaccessiblenumericfield.cxx b/accessibility/source/standard/svtaccessiblenumericfield.cxx index 114bf71802fe..729966eb8fef 100644 --- a/accessibility/source/standard/svtaccessiblenumericfield.cxx +++ b/accessibility/source/standard/svtaccessiblenumericfield.cxx @@ -90,4 +90,16 @@ css::uno::Any SAL_CALL SVTXAccessibleNumericField::getMinimumValue() return css::uno::Any(dValue); } +css::uno::Any SAL_CALL SVTXAccessibleNumericField::getMinimumIncrement() +{ + OExternalLockGuard aGuard(this); + + double dValue = 0; + SVTXNumericField* pField = static_cast<SVTXNumericField*>(GetVCLXWindow()); + if (pField) + dValue = pField->getSpinSize(); + + return css::uno::Any(dValue); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx b/accessibility/source/standard/vclxaccessiblebox.cxx index 50bb06247509..ce81c254c59a 100644 --- a/accessibility/source/standard/vclxaccessiblebox.cxx +++ b/accessibility/source/standard/vclxaccessiblebox.cxx @@ -486,6 +486,11 @@ Any VCLXAccessibleBox::getMinimumValue( ) return aAny; } +Any VCLXAccessibleBox::getMinimumIncrement( ) +{ + return Any(); +} + // Set the INDETERMINATE state when there is no selected item for combobox void VCLXAccessibleBox::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) { diff --git a/accessibility/source/standard/vclxaccessiblebutton.cxx b/accessibility/source/standard/vclxaccessiblebutton.cxx index 50e81669b86a..d5ffb68bbf2e 100644 --- a/accessibility/source/standard/vclxaccessiblebutton.cxx +++ b/accessibility/source/standard/vclxaccessiblebutton.cxx @@ -296,5 +296,15 @@ Any VCLXAccessibleButton::getMinimumValue( ) return aValue; } +Any VCLXAccessibleButton::getMinimumIncrement( ) +{ + OExternalLockGuard aGuard( this ); + + Any aValue; + aValue <<= sal_Int32(1); + + return aValue; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/source/standard/vclxaccessiblecheckbox.cxx b/accessibility/source/standard/vclxaccessiblecheckbox.cxx index f38bc3881b87..20cf2138bc06 100644 --- a/accessibility/source/standard/vclxaccessiblecheckbox.cxx +++ b/accessibility/source/standard/vclxaccessiblecheckbox.cxx @@ -328,5 +328,15 @@ Any VCLXAccessibleCheckBox::getMinimumValue( ) return aValue; } +Any VCLXAccessibleCheckBox::getMinimumIncrement( ) +{ + OExternalLockGuard aGuard( this ); + + Any aValue; + aValue <<= sal_Int32(1); + + return aValue; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/source/standard/vclxaccessiblemenuitem.cxx b/accessibility/source/standard/vclxaccessiblemenuitem.cxx index c12fdc985f7a..f8b125c1400e 100644 --- a/accessibility/source/standard/vclxaccessiblemenuitem.cxx +++ b/accessibility/source/standard/vclxaccessiblemenuitem.cxx @@ -554,5 +554,13 @@ Any VCLXAccessibleMenuItem::getMinimumValue( ) return aValue; } +Any VCLXAccessibleMenuItem::getMinimumIncrement( ) +{ + Any aValue; + aValue <<= sal_Int32(1); + + return aValue; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/source/standard/vclxaccessibleradiobutton.cxx b/accessibility/source/standard/vclxaccessibleradiobutton.cxx index 49901a8fbe17..c1a23ede2ede 100644 --- a/accessibility/source/standard/vclxaccessibleradiobutton.cxx +++ b/accessibility/source/standard/vclxaccessibleradiobutton.cxx @@ -267,5 +267,15 @@ Any VCLXAccessibleRadioButton::getMinimumValue( ) return aValue; } +Any VCLXAccessibleRadioButton::getMinimumIncrement( ) +{ + OExternalLockGuard aGuard( this ); + + Any aValue; + aValue <<= sal_Int32(1); + + return aValue; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/source/standard/vclxaccessiblescrollbar.cxx b/accessibility/source/standard/vclxaccessiblescrollbar.cxx index 329aaec906bc..9ddb5e12a8c3 100644 --- a/accessibility/source/standard/vclxaccessiblescrollbar.cxx +++ b/accessibility/source/standard/vclxaccessiblescrollbar.cxx @@ -244,6 +244,13 @@ Any VCLXAccessibleScrollBar::getMinimumValue( ) return aValue; } +Any VCLXAccessibleScrollBar::getMinimumIncrement( ) +{ + OExternalLockGuard aGuard( this ); + + return Any(); +} + OUString VCLXAccessibleScrollBar::getAccessibleName( ) { diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx index d290430975ba..dd2a4462854d 100644 --- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx +++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx @@ -725,5 +725,10 @@ Any VCLXAccessibleToolBoxItem::getMinimumValue( ) return Any(sal_Int32(0)); } +Any VCLXAccessibleToolBoxItem::getMinimumIncrement( ) +{ + return Any(sal_Int32(1)); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |