Files
odfstudio/offapi
Michael Weghorn 5777aa1af8 tdf#104833 tdf#135435 vcl a11y: Use TEXT role for readonly edit
... instead of STATIC.

This was originally changed from AccessibleRole::TEXT
to AccessibleRole::LABEL and then AccessibleRole::STATIC
in

    commit fa775ed30a
    Date:   Tue Feb 20 13:55:53 2018 +0100

        tdf#86661 a11y: give ROLE_LABEL to read-only edit

        ROLE_TEXT is for editable text, ROLE_LABEL should be used for static text,
        so that screen readers know they should speak it.

and

    commit ac475d8d6f
    Date:   Wed Aug 8 13:39:31 2018 +0200

        tdf#116542 a11y: Make R/O accessibleedit use STATIC role

        as improvement to tdf#86661 which had made it a LABEL as first improvement
        over TEXT.

. However, that distinction between TEXT and STATIC
for editable vs. readonly objects doesn't match what
platform a11y APIs actually use, which focus more
on the object being interactive or not, and
an edit is a control that can receive keyboard
focus, so is interactive.

Quoting from the ATSPI_ROLE_TEXT doc [1]:

> An interactive widget that supports multiple lines of text and
> optionally accepts user input, but whose purpose is not to solicit user
> input. Thus ATSPI_ROLE_TEXT is appropriate for the text view in a plain
> text editor but inappropriate for an input field in a dialog box or web
> form. For widgets whose purpose is to solicit input from the user, see
> ATSPI_ROLE_ENTRY and ATSPI_ROLE_PASSWORD_TEXT.

Quoting from the AT_SPI_ROLE_STATIC doc [2]:

> A generic non-container object whose purpose is to display a brief
> amount of information to the user and whose role is known by the
> implementor but lacks semantic value for the user. Examples in which
> ATSPI_ROLE_STATIC is appropriate include the message displayed in a
> message box and an image used as an alternative means to display text.
> ATSPI_ROLE_STATIC should not be applied to widgets which are
> traditionally interactive, objects which display a significant amount of
> content, or any object which has an accessible relation pointing to
> another object. The displayed information, as a general rule, should be
> exposed through the accessible name of the object. For labels which
> describe another widget, see ATSPI_ROLE_LABEL. For text views, see
> ATSPI_ROLE_TEXT.

VclMultiLineEdit (for which VCLXAccessibleEdit
is the a11y implementation) is used in
SalInstanceTextView, i.e. used for implementing
a text view, for which the above suggests to
use ATSPI_ROLE_TEXT.

GTK 3 also reports a read-only GtkTextView with
AT_SPI_ROLE_TEXT (and not having the
ATSPI_STATE_EDITABLE state), so this commit also aligns
it with that.

The MSAA/IAccessible doc [3] also matches for this.

> ROLE_SYSTEM_TEXT
>
>	The object represents selectable text that allows
>        edits or is designated as read-only.

and

> ROLE_SYSTEM_STATICTEXT
>
> 	The object represents read-only text, such as labels
>         for other controls or instructions in a dialog box.
>         Static text cannot be modified or selected.

In LO, text in readonly edits can be selected,
so that also makes ROLE_SYSTEM_TEXT more appropriate.

Therefore, use AccessibleRole::TEXT again.

This makes the NVDA screen reader on Windows announce the
status text in the "Help" -> "Check for Updates" dialog
(requires --enable-online-update autogen option).

Also update the AccessibleRole idl description
accordingly to align better with the AT-SPI and MSAA/IAccessible
semantics as described above.

If the STATIC role is preferred in a particular case,
it can still explicitly set for the corresponding
widget in the .ui file.

[1] https://docs.gtk.org/atspi2/enum.Role.html#text
[2] https://docs.gtk.org/atspi2/enum.Role.html#static
[3] https://learn.microsoft.com/en-us/windows/win32/winauto/object-roles

Change-Id: I58f35864eedb1b527c1af651f88612ef96678138
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192017
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-10-07 13:44:02 +02:00
..
…
…

LibreOffice API IDL Files Except UDK API

Contains all of the IDL files except those in udkapi.

i.e. the interfaces that are specific to the LibreOffice application. An artificial (?) separation.

The reference offapi/type_reference/offapi.idl and udkapi/type_reference/udkapi.idl (formerly combined into a single offapi/type_reference/types.rdb) are used to detect inadvertent incompatible changes. They are plain-text .idl files (not strictly lexicographically sorted, though, so they satisfy the .idl file requirements for no forward dependencies), so in cases where we deliberately /do/ become incompatible they can be modified manually.

Old such cases of deliberately becoming incompatible are listed in offapi/type_reference/typelibrary_history.txt, newer such cases are recorded in the git logs of (now superseded) offapi/type_reference/types.rdb, offapi/type_reference/offapi.rdb, and udkapi/type_reference/udkapi.rdb, new such cases are recorded in the git logs of offapi/type_reference/offapi.idl and udkapi/type_reference/udkapi.idl.