From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- accessible/windows/uia/uiaRawElmProvider.h | 75 +++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) (limited to 'accessible/windows/uia/uiaRawElmProvider.h') diff --git a/accessible/windows/uia/uiaRawElmProvider.h b/accessible/windows/uia/uiaRawElmProvider.h index 0e05d1a030..ea713d8bc1 100644 --- a/accessible/windows/uia/uiaRawElmProvider.h +++ b/accessible/windows/uia/uiaRawElmProvider.h @@ -11,10 +11,20 @@ #include #include +#include + +#include "nsString.h" + +template +class nsTArray; +template +class RefPtr; + namespace mozilla { namespace a11y { class Accessible; +enum class RelationType; /** * IRawElementProviderSimple implementation (maintains IAccessibleEx approach). @@ -26,8 +36,16 @@ class uiaRawElmProvider : public IAccessibleEx, public IToggleProvider, public IExpandCollapseProvider, public IScrollItemProvider, - public IValueProvider { + public IValueProvider, + public IRangeValueProvider, + public ISelectionProvider, + public ISelectionItemProvider { public: + static constexpr enum ProviderOptions kProviderOptions = + static_cast(ProviderOptions_ServerSideProvider | + ProviderOptions_UseComThreading | + ProviderOptions_HasNativeIAccessible); + static void RaiseUiaEventForGeckoEvent(Accessible* aAcc, uint32_t aGeckoEvent); static void RaiseUiaEventForStateChange(Accessible* aAcc, uint64_t aState, @@ -118,6 +136,51 @@ class uiaRawElmProvider : public IAccessibleEx, virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsReadOnly( /* [retval][out] */ __RPC__out BOOL* pRetVal); + // IRangeValueProvider + virtual HRESULT STDMETHODCALLTYPE SetValue( + /* [in] */ double aVal); + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Value( + /* [retval][out] */ __RPC__out double* aRetVal); + + // get_IsReadOnly is shared with IValueProvider. + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Maximum( + /* [retval][out] */ __RPC__out double* aRetVal); + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Minimum( + /* [retval][out] */ __RPC__out double* aRetVal); + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_LargeChange( + /* [retval][out] */ __RPC__out double* aRetVal); + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_SmallChange( + /* [retval][out] */ __RPC__out double* aRetVal); + + // ISelectionProvider + virtual HRESULT STDMETHODCALLTYPE GetSelection( + /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY** aRetVal); + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_CanSelectMultiple( + /* [retval][out] */ __RPC__out BOOL* aRetVal); + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsSelectionRequired( + /* [retval][out] */ __RPC__out BOOL* aRetVal); + + // ISelectionItemProvider methods + virtual HRESULT STDMETHODCALLTYPE Select(void); + + virtual HRESULT STDMETHODCALLTYPE AddToSelection(void); + + virtual HRESULT STDMETHODCALLTYPE RemoveFromSelection(void); + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsSelected( + /* [retval][out] */ __RPC__out BOOL* aRetVal); + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_SelectionContainer( + /* [retval][out] */ __RPC__deref_out_opt IRawElementProviderSimple** + aRetVal); + private: Accessible* Acc() const; bool IsControl(); @@ -125,8 +188,18 @@ class uiaRawElmProvider : public IAccessibleEx, bool HasTogglePattern(); bool HasExpandCollapsePattern(); bool HasValuePattern() const; + template + RefPtr GetPatternFromDerived(); + bool HasSelectionItemPattern(); + SAFEARRAY* AccRelationsToUiaArray( + std::initializer_list aTypes) const; + Accessible* GetLabeledBy() const; + long GetLandmarkType() const; + void GetLocalizedLandmarkType(nsAString& aLocalized) const; }; +SAFEARRAY* AccessibleArrayToUiaArray(const nsTArray& aAccs); + } // namespace a11y } // namespace mozilla -- cgit v1.2.3