summaryrefslogtreecommitdiffstats
path: root/src/gui/accessible/windows
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@qt.io>2023-11-10 11:19:11 +0100
committerJan Arve Sæther <jan-arve.saether@qt.io>2023-11-23 13:25:41 +0100
commitbc8141d286727e7c7b21d61556852ee78acd56c3 (patch)
tree2045745fa8f7cbb585116291bf185ef4e8869409 /src/gui/accessible/windows
parent1082038bd89d0bbba4df0d9b3f8af3cd0a2f96f2 (diff)
a11y: Fix bug where some characters were not spoken while moving cursor
The problem occurred when we moved the cursor to the penultimate character of the string, because the boundary condition was wrong. It is important to realize that the offsets are moved *between* each character (and also before and after the whole string), just like you would move a cursor. This means that the offsets can be in the range [0, len] (closed interval) The problem could only be reproduced with JAWS. Pick-to: 6.6 6.5 6.2 Fixes: QTBUG-115156 Change-Id: I0c5f05fa391e6c7744ab22d71afe8904b49e89bc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'src/gui/accessible/windows')
-rw-r--r--src/gui/accessible/windows/apisupport/uiaclientinterfaces_p.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/gui/accessible/windows/apisupport/uiaclientinterfaces_p.h b/src/gui/accessible/windows/apisupport/uiaclientinterfaces_p.h
index fb74042bfa..b9ea861966 100644
--- a/src/gui/accessible/windows/apisupport/uiaclientinterfaces_p.h
+++ b/src/gui/accessible/windows/apisupport/uiaclientinterfaces_p.h
@@ -16,6 +16,7 @@
//
#include <unknwn.h>
+#include "uiatypes_p.h"
#ifndef __IUIAutomationElement_INTERFACE_DEFINED__
@@ -30,6 +31,8 @@ struct IUIAutomationFocusChangedEventHandler;
struct IUIAutomationProxyFactory;
struct IUIAutomationProxyFactoryEntry;
struct IUIAutomationProxyFactoryMapping;
+struct IUIAutomationTextRangeArray;
+struct IUIAutomationTextRange;
#ifndef __IAccessible_FWD_DEFINED__
#define __IAccessible_FWD_DEFINED__
struct IAccessible;
@@ -225,6 +228,59 @@ __CRT_UUID_DECL(IUIAutomationTreeWalker, 0x4042c624, 0x389c, 0x4afc, 0xa6,0x30,
#endif
#endif
+
+#ifndef __IUIAutomationTextPattern_INTERFACE_DEFINED__
+#define __IUIAutomationTextPattern_INTERFACE_DEFINED__
+DEFINE_GUID(IID_IUIAutomationTextPattern, 0x32eba289, 0x3583, 0x42c9, 0x9c,0x59, 0x3b, 0x6d, 0x9a, 0x1e, 0x9b, 0x6a);
+MIDL_INTERFACE("32eba289-3583-42c9-9c59-3b6d9a1e9b6a")
+IUIAutomationTextPattern : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE RangeFromPoint(POINT pt, __RPC__deref_out_opt IUIAutomationTextRange **range) = 0;
+ virtual HRESULT STDMETHODCALLTYPE RangeFromChild(__RPC__in_opt IUIAutomationElement *child, __RPC__deref_out_opt IUIAutomationTextRange **range) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetSelection(__RPC__deref_out_opt IUIAutomationTextRangeArray **ranges) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetVisibleRanges(__RPC__deref_out_opt IUIAutomationTextRangeArray **ranges) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_DocumentRange(__RPC__deref_out_opt IUIAutomationTextRange **range) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_SupportedTextSelection(__RPC__out enum SupportedTextSelection *supportedTextSelection) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IUIAutomationTextPattern, 0x32eba289, 0x3583, 0x42c9, 0x9c,0x59, 0x3b, 0x6d, 0x9a, 0x1e, 0x9b, 0x6a)
+#endif
+#endif
+
+
+#ifndef __IUIAutomationTextRange_INTERFACE_DEFINED__
+#define __IUIAutomationTextRange_INTERFACE_DEFINED__
+DEFINE_GUID(IID_IUIAutomationTextRange, 0xa543cc6a, 0xf4ae, 0x494b, 0x82,0x39, 0xc8, 0x14, 0x48, 0x11, 0x87, 0xa8);
+MIDL_INTERFACE("a543cc6a-f4ae-494b-8239-c814481187a8")
+IUIAutomationTextRange : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE Clone(__RPC__deref_out_opt IUIAutomationTextRange **clonedRange) = 0;
+ virtual HRESULT STDMETHODCALLTYPE Compare(__RPC__in_opt IUIAutomationTextRange *range, __RPC__out BOOL *areSame) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CompareEndpoints(enum TextPatternRangeEndpoint srcEndPoint, __RPC__in_opt IUIAutomationTextRange *range, enum TextPatternRangeEndpoint targetEndPoint, __RPC__out int *compValue) = 0;
+ virtual HRESULT STDMETHODCALLTYPE ExpandToEnclosingUnit(enum TextUnit textUnit) = 0;
+ virtual HRESULT STDMETHODCALLTYPE FindAttribute(TEXTATTRIBUTEID attr, VARIANT val, BOOL backward, __RPC__deref_out_opt IUIAutomationTextRange **found) = 0;
+ virtual HRESULT STDMETHODCALLTYPE FindText(__RPC__in BSTR text, BOOL backward, BOOL ignoreCase, __RPC__deref_out_opt IUIAutomationTextRange **found) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetAttributeValue(TEXTATTRIBUTEID attr, __RPC__out VARIANT *value) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetBoundingRectangles(__RPC__deref_out_opt SAFEARRAY * *boundingRects) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetEnclosingElement(__RPC__deref_out_opt IUIAutomationElement **enclosingElement) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetText(int maxLength, __RPC__deref_out_opt BSTR *text) = 0;
+ virtual HRESULT STDMETHODCALLTYPE Move(enum TextUnit unit, int count, __RPC__out int *moved) = 0;
+ virtual HRESULT STDMETHODCALLTYPE MoveEndpointByUnit(enum TextPatternRangeEndpoint endpoint, enum TextUnit unit, int count, __RPC__out int *moved) = 0;
+ virtual HRESULT STDMETHODCALLTYPE MoveEndpointByRange(enum TextPatternRangeEndpoint srcEndPoint, __RPC__in_opt IUIAutomationTextRange *range, enum TextPatternRangeEndpoint targetEndPoint) = 0;
+ virtual HRESULT STDMETHODCALLTYPE Select( void) = 0;
+ virtual HRESULT STDMETHODCALLTYPE AddToSelection( void) = 0;
+ virtual HRESULT STDMETHODCALLTYPE RemoveFromSelection( void) = 0;
+ virtual HRESULT STDMETHODCALLTYPE ScrollIntoView(BOOL alignToTop) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetChildren(__RPC__deref_out_opt IUIAutomationElementArray **children) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IUIAutomationTextRange, 0xa543cc6a, 0xf4ae, 0x494b, 0x82,0x39, 0xc8, 0x14, 0x48, 0x11, 0x87, 0xa8)
+#endif
+#endif
+
+
DEFINE_GUID(CLSID_CUIAutomation, 0xff48dba4, 0x60ef, 0x4201, 0xaa,0x87, 0x54,0x10,0x3e,0xef,0x59,0x4e);
#endif