From 76899152ec3d1924cc72d2b869e197a1e34a0a1a Mon Sep 17 00:00:00 2001 From: Marco Cecchetti Date: Tue, 10 Oct 2023 10:50:50 +0200 Subject: lok: a11y: impress: help screen reader to report shape selection Refactored LOKDocumentFocusListener::notifyEvent. Implemented 2 new callbacks: - LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE: it says the client if editing in a shape or cell is active or it isn't. - LOK_CALLBACK_A11Y_SELECTION_CHANGED: it says if a shape has been selected/unselected, the name of the shape and text content are sent too for being reported by a screen reader. Change-Id: I644bcc7daeb8772805688a9bccdabd0631ce0a22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158343 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks --- include/LibreOfficeKit/LibreOfficeKitEnums.h | 31 +++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index ce093ff7a276..c17c6e811131 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -1001,7 +1001,32 @@ typedef enum * the user got in from the outer to the inner; row/column span default * value is 1; paragraph is the cell text content. */ - LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED = 67 + LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED = 67, + + /** + * Accessibility event: text editing in a shape or cell has been enabled/disabled + * + * { + * "cell": true/false (editing a cell ?) + * "enabled": true|false + * "selection": a selection description + * "paragraph": focused paragraph + * } + */ + LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE = 68, + + /** + * Accessibility event: a selection (of a shape/graphic, etc.) has changed + * + * { + * "cell": true/false (selected object is a cell ?) + * "action": "create"|"add"|"remove" + * "name": selected object name + * "text": text content if any + * } + */ + LOK_CALLBACK_A11Y_SELECTION_CHANGED = 69 + } LibreOfficeKitCallbackType; @@ -1166,6 +1191,10 @@ static inline const char* lokCallbackTypeToString(int nType) return "LOK_CALLBACK_DOCUMENT_PASSWORD_RESET"; case LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED: return "LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED"; + case LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE: + return "LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE"; + case LOK_CALLBACK_A11Y_SELECTION_CHANGED: + return "LOK_CALLBACK_A11Y_SELECTION_CHANGED"; } assert(!"Unknown LibreOfficeKitCallbackType type."); -- cgit