1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
9 #include "MsaaRootAccessible.h"
10 #include "RootAccessible.h"
12 using namespace mozilla
;
13 using namespace mozilla::a11y
;
17 Accessible
* UiaRoot::Acc() {
18 auto* mr
= static_cast<MsaaRootAccessible
*>(this);
19 return static_cast<MsaaAccessible
*>(mr
)->Acc();
22 // IRawElementProviderFragmentRoot
25 UiaRoot::ElementProviderFromPoint(
27 __RPC__deref_out_opt IRawElementProviderFragment
** aRetVal
) {
32 Accessible
* acc
= Acc();
34 return CO_E_OBJNOTCONNECTED
;
36 if (Accessible
* target
= acc
->ChildAtPoint(
37 aX
, aY
, Accessible::EWhichChildAtPoint::DeepestChild
)) {
38 RefPtr
<IRawElementProviderFragment
> fragment
=
39 MsaaAccessible::GetFrom(target
);
40 fragment
.forget(aRetVal
);
46 UiaRoot::GetFocus(__RPC__deref_out_opt IRawElementProviderFragment
** aRetVal
) {
51 Accessible
* acc
= Acc();
53 return CO_E_OBJNOTCONNECTED
;
55 if (Accessible
* focus
= acc
->FocusedChild()) {
56 RefPtr
<IRawElementProviderFragment
> fragment
=
57 MsaaAccessible::GetFrom(focus
);
58 fragment
.forget(aRetVal
);