summaryrefslogtreecommitdiffstats
path: root/accessible/ios/MUIAccessible.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /accessible/ios/MUIAccessible.h
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'accessible/ios/MUIAccessible.h')
-rw-r--r--accessible/ios/MUIAccessible.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/accessible/ios/MUIAccessible.h b/accessible/ios/MUIAccessible.h
new file mode 100644
index 0000000000..725b06c345
--- /dev/null
+++ b/accessible/ios/MUIAccessible.h
@@ -0,0 +1,72 @@
+/* clang-format off */
+/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef _MUIAccessible_H_
+#define _MUIAccessible_H_
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIAccessibility.h>
+
+#include "AccessibleWrap.h"
+#include "RemoteAccessible.h"
+
+@class MUIAccessible;
+
+namespace mozilla {
+namespace a11y {
+
+inline MUIAccessible* _Nullable GetNativeFromGeckoAccessible(
+ mozilla::a11y::Accessible* _Nullable aAcc) {
+ if (!aAcc) {
+ return nil;
+ }
+ if (LocalAccessible* localAcc = aAcc->AsLocal()) {
+ MUIAccessible* native = nil;
+ localAcc->GetNativeInterface((void**)&native);
+ return native;
+ }
+
+ RemoteAccessible* remoteAcc = aAcc->AsRemote();
+ return reinterpret_cast<MUIAccessible*>(remoteAcc->GetWrapper());
+}
+
+} // namespace a11y
+} // namespace mozilla
+
+@interface MUIAccessible : NSObject {
+ mozilla::a11y::Accessible* mGeckoAccessible;
+}
+
+// inits with the given accessible
+- (nonnull id)initWithAccessible:(nonnull mozilla::a11y::Accessible*)aAcc;
+
+// allows for gecko accessible access outside of the class
+- (mozilla::a11y::Accessible* _Nullable)geckoAccessible;
+
+- (void)expire;
+
+// override
+- (void)dealloc;
+
+// UIAccessibility
+- (BOOL)isAccessibilityElement;
+- (nullable NSString*)accessibilityLabel;
+- (nullable NSString*)accessibilityHint;
+- (CGRect)accessibilityFrame;
+- (nullable NSString*)accessibilityValue;
+- (uint64_t)accessibilityTraits;
+
+// UIAccessibilityContainer
+- (NSInteger)accessibilityElementCount;
+- (nullable id)accessibilityElementAtIndex:(NSInteger)index;
+- (NSInteger)indexOfAccessibilityElement:(nonnull id)element;
+- (nullable NSArray*)accessibilityElements;
+- (UIAccessibilityContainerType)accessibilityContainerType;
+
+@end
+
+#endif