summaryrefslogtreecommitdiff
path: root/accessibility/source/standard/svtaccessiblenumericfield.cxx
AgeCommit message (Collapse)Author
2024-12-17a11y: Merge accessibility module into vclMichael Weghorn
Now that the accessibility module no longer depends on toolkit and svtools and there's therefore no more cyclic dependency, merge it into the vcl library, where the vcl widgets are located, for which the classes in the accessibility module (primarily) provide the a11y classes. Initially, take over the existing UNO service "com.sun.star.accessibility.comp.GetStandardAccessibleFactoryService" to vcl as is. It used to be necessary to break the cyclic dependency between the vcl, svtools, toolkit and accessibility module. (vcl is the lowest and accessibility used to be furthest up in the dependency chain; yet vcl needed it to create the objects providing the XAccessible/XAccessibleContext for its widgets.) Further simplification can happen in upcoming commits. Change-Id: Ib46c87446dc9121d3b8e735e0e5a40594da73cc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178647 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-12a11y: Stop using VCLXWindow in vcl a11y classesMichael Weghorn
Adjust VCLXAccessibleComponent and subclasses to take a vcl::Window arg instead of a VCLXWindow in the ctor and drop the VCLXAccessibleComponent::m_xVCLXWindow member that used to hold a reference to the VCLXWindow. (VCLXAccessibleComponent still holds a VclPtr to the corresponding vcl::Window.) Instead of passing the UNO/toolkit peer (VCLXWindow and subclasses) to the AccessibleFactory to create an XAccessibleContext context for the underlying VCL widget, pass the underlying vcl widget, which can now be passed as is to the corresponding ctors of VCLXAccessibleComponent and specialized subclasses. This follows earlier commits replacing the use of the VCLXWindow classes by direct uses of the vcl::Window subclasses inside VCLXAccessibleComponent and subclasses and is the next step in reducing the UNO/toolkit dependency in the accessibility implementation for vcl widgets. For now, the logic where those accessible objects are created remains in VCLXWindow::CreateAccessibleContext and overrides, but that can change in the future. `IAccessibleFactory::createAccessibleContext(VCLXMultiLineEdit*)` is just dropped and doesn't need its own replacement: The previous VCLXMultiLineEdit variant was creating a VCLXAccessibleEdit like the variant taking a VCLXEdit, but VCLXMultiLineEdit doesn't subclass VCLXEdit. The vcl MultiLineEdit however subclasses Edit, so VCLXMultiLineEdit::CreateAccessibleContext can make use of `IAccessibleFactory::createAccessibleContext(Edit*)` as well now. This also implements what was mentioned in earlier commit Change-Id: I67bb7a6a237e57d0c522790c09a595c02ac06325 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Thu Dec 12 17:16:29 2024 +0100 sw annotation win a11y: Skip VCLXWindow logic : > Drop the comment about the code being dodgy from > SwAnnotationWin::CreateAccessible. This commit partially > addresses it and switching VCLXAccessibleComponent > to using the vcl::Window will take care of the rest, > see upcoming commit > Change-Id If0894e733273eecad268c6a932ecee7c2e34b4c2 > ("a11y: Stop using VCLXWindow in vcl a11y classes"). Now that the VCLXAccessibleComponent ctor takes a vcl::Window, the sw::annotation::SwAnnotationWin can be passed directly. From a user perspective, no change in behavior is intended by this commit. Change-Id: If0894e733273eecad268c6a932ecee7c2e34b4c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178385 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-12-04a11y: Use FormattedField directly in SVTXAccessibleNumericFieldMichael Weghorn
... instead of using the toolkit/UNO wrapper SVTXNumericField. Change-Id: I86e274a06f210e2076e287087a1d4b979abe7c35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177814 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2023-04-15a11y: Send VALUE_CHANGED event for FormattedFieldMichael Weghorn
`VCLXAccessibleEdit::ProcessWindowEvent` takes care of sending a `TEXT_CHANGED` event. In the case of `SVTXAccessibleNumericField`, numeric values are handled, so send a `VALUE_CHANGED` event in addition. This makes Orca with the qt6 VCL plugin announce the new value when e.g. changing the page width using the arrow up key in the "Format" -> "Page Style" dialog. For Accerciser, an additional fix is needed so the value gets updated there in the interface view when the a11y object is selected. Pending MR: [1] [1] https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/25 Change-Id: Id911f50664df7220bc58204bc3477c5306a1da33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150422 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-01-26Use ImplInheritanceHelper in SVTXAccessibleNumericFieldStephan Bergmann
Change-Id: I9d9b6a6d7cbd89983cbe803511b59226330ae9e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146185 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-06Merge comphelper::OAccessibleContextHelper into ↵Stephan Bergmann
comphelper::OCommonAccessibleComponent Change-Id: I586ae8fe2842fd879ae2ae506c659d06dda16843 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145160 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-07-28a11y: Add XAccessibleValue::getMinimumIncrement methodMichael Weghorn
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>
2021-07-28a11y: Expose FormattedField as spinboxMichael Weghorn
This adds a new accessibility class 'SVTXAccessibleNumericField' that implements 'XAccessibleValue' and reports having an a11y role of 'AccessibleRole::SPIN_BOX'. An object of that class is returned by 'SVTXNumericField::CreateAccessibleContext'. Create an 'SVTXNumericField' XWindow peer for windows of type 'WindowType::FORMATTEDFIELD' (instead of a 'VCLXNumericField' one), so the newly introduced accessibility class gets used for 'FormattedField'. This way, FormattedFields are now exposed to a11y tools as spinboxes. Previously, since no specific accessibility class had been implemented for VCLXNumericField (then used as XWindow peer class for FormattedField), the one for VCLXEdit, i.e. VCLXAccessibleEdit, was used. While VCLXNumericField implements XNumericField and thus in general offers the relevant methods to implement an accessible class that implements XAccessibleValue as well, it uses the Formatter from the VCLXFormattedSpinField base class to get/set values. However, that doesn't work for the FormattedField case, since FormattedField has its own formatter of a different type and the 'mpFormatter' member in the VCLXFormattedSpinField base class is a nullptr, resulting in the corresponding getter methods always returning 0 and the setters doing nothing. With this commit in place, Accerciser now reports role "spin box" instead of just "text" for FormattedFields and displays the current value as well as allows to change it via the "Value" interface when using the qt5/kf5 VCL plugin. Note: For non-integer values, Accerciser doesn't show the actual decimal value, but an integer, e.g. when the value for "Height" spinbox in Writer's "Page Style" -> "Page" dialog (section "Paper format") is set to "29.70cm", Accerciser shows "30" instead of "29.70", despite 'Qt5AccessibleWidget::currentValue' returning the exact value. This is because Accerciser appears to rely on the value for the minimum increment being reported (as a corresponding decimal value) by a call to 'atspi_value_get_minimum_increment', s.[1]. However, there is currently no corresponding method in the 'XAccesibleValue' interface for that at-spi method which 'Qt5AccessibleWidget::currentValue' could call to retrieve the value. The NVDA screen reader on Windows now also says e.g. "Width: (Type = 344) spin button editable Alt+W selected 8.50″" instead of "Width: (Type = 344) edit Alt+W selected 8.50″". [1] https://developer.gnome.org/libatspi/stable/libatspi-atspi-value.html#atspi-value-get-minimum-increment Change-Id: I8af326c2d24c1801147a56ea2e2a886ab42ac634 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119590 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>