Bug 1877642 - Disable browser_fullscreen-tab-close-race.js on apple_silicon !debug...
[gecko.git] / accessible / ios / MUIAccessible.h
blob725b06c345458687cb5f8fbeea12d250f1702e3d
1 /* clang-format off */
2 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3 /* clang-format on */
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"
17 @class MUIAccessible;
19 namespace mozilla {
20 namespace a11y {
22 inline MUIAccessible* _Nullable GetNativeFromGeckoAccessible(
23 mozilla::a11y::Accessible* _Nullable aAcc) {
24 if (!aAcc) {
25 return nil;
27 if (LocalAccessible* localAcc = aAcc->AsLocal()) {
28 MUIAccessible* native = nil;
29 localAcc->GetNativeInterface((void**)&native);
30 return native;
33 RemoteAccessible* remoteAcc = aAcc->AsRemote();
34 return reinterpret_cast<MUIAccessible*>(remoteAcc->GetWrapper());
37 } // namespace a11y
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;
50 - (void)expire;
52 // override
53 - (void)dealloc;
55 // UIAccessibility
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;
70 @end
72 #endif