michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #pragma once michael@0: michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: michael@0: #include "mozwrlbase.h" michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "mozilla/a11y/Accessible.h" michael@0: #include "UIAAccessibilityBridge.h" michael@0: michael@0: // generated michael@0: #include "UIABridge.h" michael@0: michael@0: namespace mozilla { michael@0: namespace widget { michael@0: namespace winrt { michael@0: michael@0: // represents the root window to UIA michael@0: [uuid("D3EDD951-0715-4501-A8E5-25D97EF35D5A")] michael@0: class UIABridge : public Microsoft::WRL::RuntimeClass, michael@0: IUIABridge, michael@0: IUIAElement, michael@0: IRawElementProviderSimple, michael@0: IRawElementProviderFragment, michael@0: IRawElementProviderFragmentRoot> michael@0: { michael@0: typedef ABI::Windows::UI::Core::ICoreWindow ICoreWindow; michael@0: michael@0: InspectableClass(L"IUIABridge", BaseTrust); michael@0: michael@0: public: michael@0: UIABridge() {} michael@0: michael@0: // IUIABridge michael@0: IFACEMETHODIMP Init(IInspectable* view, IInspectable* window, LONG_PTR inner); michael@0: IFACEMETHODIMP Disconnect(); michael@0: IFACEMETHODIMP FocusChangeEvent(); michael@0: michael@0: // IUIAElement michael@0: IFACEMETHODIMP SetFocusInternal(LONG_PTR aAccessible); michael@0: IFACEMETHODIMP ClearFocus(); michael@0: michael@0: // IRawElementProviderFragmentRoot michael@0: IFACEMETHODIMP ElementProviderFromPoint(double x, double y, IRawElementProviderFragment ** retVal); michael@0: IFACEMETHODIMP GetFocus(IRawElementProviderFragment ** retVal); michael@0: michael@0: // IRawElementProviderFragment michael@0: IFACEMETHODIMP Navigate(NavigateDirection direction, IRawElementProviderFragment ** retVal); michael@0: IFACEMETHODIMP GetRuntimeId(SAFEARRAY ** retVal); michael@0: IFACEMETHODIMP get_BoundingRectangle(UiaRect * retVal); michael@0: IFACEMETHODIMP GetEmbeddedFragmentRoots(SAFEARRAY ** retVal); michael@0: IFACEMETHODIMP SetFocus(); michael@0: IFACEMETHODIMP get_FragmentRoot(IRawElementProviderFragmentRoot * * retVal); michael@0: michael@0: // IRawElementProviderSimple michael@0: IFACEMETHODIMP get_ProviderOptions(ProviderOptions * retVal); michael@0: IFACEMETHODIMP GetPatternProvider(PATTERNID iid, IUnknown * * retVal); michael@0: IFACEMETHODIMP GetPropertyValue(PROPERTYID idProp, VARIANT * retVal ); michael@0: IFACEMETHODIMP get_HostRawElementProvider(IRawElementProviderSimple ** retVal); michael@0: michael@0: protected: michael@0: bool Connected(); michael@0: michael@0: private: michael@0: Microsoft::WRL::ComPtr mWindow; michael@0: #if defined(ACCESSIBILITY) michael@0: nsRefPtr mAccBridge; michael@0: nsRefPtr mAccessible; michael@0: #endif michael@0: }; michael@0: michael@0: [uuid("4438135F-F624-43DE-A417-275CE7A1A0CD")] michael@0: class UIATextElement : public Microsoft::WRL::RuntimeClass, michael@0: IUIAElement, michael@0: IRawElementProviderSimple, michael@0: IRawElementProviderFragment, michael@0: ITextProvider, michael@0: IValueProvider > michael@0: { michael@0: typedef ABI::Windows::Foundation::Rect Rect; michael@0: michael@0: InspectableClass(L"UIATextElement", BaseTrust); michael@0: michael@0: public: michael@0: UIATextElement() {} michael@0: michael@0: // IUIAElement michael@0: IFACEMETHODIMP SetFocusInternal(LONG_PTR aAccessible); michael@0: IFACEMETHODIMP ClearFocus(); michael@0: IFACEMETHODIMP FocusChangeEvent(); michael@0: michael@0: // IRawElementProviderFragment michael@0: IFACEMETHODIMP Navigate(NavigateDirection direction, IRawElementProviderFragment ** retVal); michael@0: IFACEMETHODIMP GetRuntimeId(SAFEARRAY ** retVal); michael@0: IFACEMETHODIMP get_BoundingRectangle(UiaRect * retVal); michael@0: IFACEMETHODIMP GetEmbeddedFragmentRoots(SAFEARRAY ** retVal); michael@0: IFACEMETHODIMP SetFocus(); michael@0: IFACEMETHODIMP get_FragmentRoot(IRawElementProviderFragmentRoot * * retVal); michael@0: michael@0: // IRawElementProviderSimple michael@0: IFACEMETHODIMP get_ProviderOptions(ProviderOptions * retVal); michael@0: IFACEMETHODIMP GetPatternProvider(PATTERNID iid, IUnknown * * retVal); michael@0: IFACEMETHODIMP GetPropertyValue(PROPERTYID idProp, VARIANT * retVal ); michael@0: IFACEMETHODIMP get_HostRawElementProvider(IRawElementProviderSimple ** retVal); michael@0: michael@0: // ITextProvider michael@0: IFACEMETHODIMP GetSelection(SAFEARRAY * *pRetVal); michael@0: IFACEMETHODIMP GetVisibleRanges(SAFEARRAY * *pRetVal); michael@0: IFACEMETHODIMP RangeFromChild(IRawElementProviderSimple *childElement, ITextRangeProvider **pRetVal); michael@0: IFACEMETHODIMP RangeFromPoint(UiaPoint point, ITextRangeProvider **pRetVal); michael@0: IFACEMETHODIMP get_DocumentRange(ITextRangeProvider **pRetVal); michael@0: IFACEMETHODIMP get_SupportedTextSelection(SupportedTextSelection *pRetVal); michael@0: michael@0: // IValueProvider michael@0: IFACEMETHODIMP SetValue(LPCWSTR val); michael@0: IFACEMETHODIMP get_Value(BSTR *pRetVal); michael@0: IFACEMETHODIMP get_IsReadOnly(BOOL *pRetVal); michael@0: michael@0: void SetIndexID(int id) { michael@0: mIndexID = id; michael@0: } michael@0: michael@0: private: michael@0: int mIndexID; michael@0: nsCOMPtr mAccessItem; michael@0: }; michael@0: michael@0: } } }