2 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef _MUIAccessible_H_
9 #define _MUIAccessible_H_
11 #import <Foundation/Foundation.h>
12 #import <UIKit/UIAccessibility.h>
14 #include "AccessibleWrap.h"
15 #include "RemoteAccessible.h"
22 inline MUIAccessible
* _Nullable
GetNativeFromGeckoAccessible(
23 mozilla::a11y::Accessible
* _Nullable aAcc
) {
27 if (LocalAccessible
* localAcc
= aAcc
->AsLocal()) {
28 MUIAccessible
* native
= nil
;
29 localAcc
->GetNativeInterface((void**)&native
);
33 RemoteAccessible
* remoteAcc
= aAcc
->AsRemote();
34 return reinterpret_cast<MUIAccessible
*>(remoteAcc
->GetWrapper());
38 } // namespace mozilla
40 @interface MUIAccessible
: NSObject
{
41 mozilla::a11y::Accessible
* mGeckoAccessible
;
44 // inits with the given accessible
45 - (nonnull id
)initWithAccessible
:(nonnull
mozilla::a11y::Accessible
*)aAcc
;
47 // allows for gecko accessible access outside of the class
48 - (mozilla::a11y::Accessible
* _Nullable
)geckoAccessible
;
56 - (BOOL
)isAccessibilityElement
;
57 - (nullable NSString
*)accessibilityLabel
;
58 - (nullable NSString
*)accessibilityHint
;
59 - (CGRect
)accessibilityFrame
;
60 - (nullable NSString
*)accessibilityValue
;
61 - (uint64_t)accessibilityTraits
;
63 // UIAccessibilityContainer
64 - (NSInteger
)accessibilityElementCount
;
65 - (nullable id
)accessibilityElementAtIndex
:(NSInteger
)index
;
66 - (NSInteger
)indexOfAccessibilityElement
:(nonnull id
)element
;
67 - (nullable NSArray
*)accessibilityElements
;
68 - (UIAccessibilityContainerType
)accessibilityContainerType
;