Bug 1735252 [wpt PR 31197] - Regenerate WPT certificates, a=testonly
[gecko.git] / accessible / mac / MOXAccessibleProtocol.h
blob78cfe00a2ec6b09932884339873b16e64dfb364a
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 @protocol MOXTextMarkerSupport;
10 // This protocol's primary use is for abstracting the NSAccessibility informal
11 // protocol into a formal internal API. Conforming classes get to choose a
12 // subset of the optional methods to implement. Those methods will be mapped to
13 // NSAccessibility attributes or actions. A conforming class can implement
14 // moxBlockSelector to control which of its implemented methods should be
15 // exposed to NSAccessibility.
17 @protocol MOXAccessible
19 // The deepest descendant of the accessible subtree that contains the specified
20 // point. Forwarded from accessibilityHitTest.
21 - (id _Nullable)moxHitTest:(NSPoint)point;
23 // The deepest descendant of the accessible subtree that has the focus.
24 // Forwarded from accessibilityFocusedUIElement.
25 - (id _Nullable)moxFocusedUIElement;
27 // Sends a notification to any observing assistive applications.
28 - (void)moxPostNotification:(NSString* _Nonnull)notification;
30 - (void)moxPostNotification:(NSString* _Nonnull)notification
31 withUserInfo:(NSDictionary* _Nullable)userInfo;
33 // Return YES if selector should be considered not supported.
34 // Used in implementations such as:
35 // - accessibilityAttributeNames
36 // - accessibilityActionNames
37 // - accessibilityIsAttributeSettable
38 - (BOOL)moxBlockSelector:(SEL _Nonnull)selector;
40 // Returns a list of all children, doesn't do ignore filtering.
41 - (NSArray* _Nullable)moxChildren;
43 // Returns our parent, doesn't do ignore filtering.
44 - (id<mozAccessible> _Nullable)moxParent;
46 // This is called by isAccessibilityElement. If a subclass wants
47 // to alter the isAccessibilityElement return value, it must
48 // override this and not isAccessibilityElement directly.
49 - (BOOL)moxIgnoreWithParent:(id<MOXAccessible> _Nullable)parent;
51 // Should the child be ignored. This allows subclasses to determine
52 // what kinds of accessibles are valid children. This causes the child
53 // to be skipped, but the unignored descendants will be added to the
54 // container in the default children getter.
55 - (BOOL)moxIgnoreChild:(id<MOXAccessible> _Nullable)child;
57 // Return text delegate if it exists.
58 - (id<MOXTextMarkerSupport> _Nullable)moxTextMarkerDelegate;
60 // Return true if this accessible is a live region
61 - (BOOL)moxIsLiveRegion;
63 // Find the nearest ancestor that returns true with the given block function
64 - (id<MOXAccessible> _Nullable)moxFindAncestor:
65 (BOOL (^_Nonnull)(id<MOXAccessible> _Nonnull moxAcc,
66 BOOL* _Nonnull stop))findBlock;
68 @optional
70 #pragma mark - AttributeGetters
72 // AXChildren
73 - (NSArray* _Nullable)moxUnignoredChildren;
75 // AXParent
76 - (id _Nullable)moxUnignoredParent;
78 // AXRole
79 - (NSString* _Nullable)moxRole;
81 // AXRoleDescription
82 - (NSString* _Nullable)moxRoleDescription;
84 // AXSubrole
85 - (NSString* _Nullable)moxSubrole;
87 // AXTitle
88 - (NSString* _Nullable)moxTitle;
90 // AXDescription
91 - (NSString* _Nullable)moxLabel;
93 // AXHelp
94 - (NSString* _Nullable)moxHelp;
96 // AXValue
97 - (id _Nullable)moxValue;
99 // AXSize
100 - (NSValue* _Nullable)moxSize;
102 // AXPosition
103 - (NSValue* _Nullable)moxPosition;
105 // AXEnabled
106 - (NSNumber* _Nullable)moxEnabled;
108 // AXFocused
109 - (NSNumber* _Nullable)moxFocused;
111 // AXWindow
112 - (id _Nullable)moxWindow;
114 // AXFrame
115 - (NSValue* _Nullable)moxFrame;
117 // AXTitleUIElement
118 - (id _Nullable)moxTitleUIElement;
120 // AXTopLevelUIElement
121 - (id _Nullable)moxTopLevelUIElement;
123 // AXHasPopup
124 - (NSNumber* _Nullable)moxHasPopup;
126 // AXARIACurrent
127 - (NSString* _Nullable)moxARIACurrent;
129 // AXSelected
130 - (NSNumber* _Nullable)moxSelected;
132 // AXRequired
133 - (NSNumber* _Nullable)moxRequired;
135 // AXElementBusy
136 - (NSNumber* _Nullable)moxElementBusy;
138 // AXLinkedUIElements
139 - (NSArray* _Nullable)moxLinkedUIElements;
141 // AXARIAControls
142 - (NSArray* _Nullable)moxARIAControls;
144 // AXDOMIdentifier
145 - (NSString* _Nullable)moxDOMIdentifier;
147 // AXURL
148 - (NSURL* _Nullable)moxURL;
150 // AXLinkUIElements
151 - (NSArray* _Nullable)moxLinkUIElements;
153 // AXPopupValue
154 - (NSString* _Nullable)moxPopupValue;
156 // AXVisited
157 - (NSNumber* _Nullable)moxVisited;
159 // AXExpanded
160 - (NSNumber* _Nullable)moxExpanded;
162 // AXMain
163 - (NSNumber* _Nullable)moxMain;
165 // AXMinimized
166 - (NSNumber* _Nullable)moxMinimized;
168 // AXSelectedChildren
169 - (NSArray* _Nullable)moxSelectedChildren;
171 // AXTabs
172 - (NSArray* _Nullable)moxTabs;
174 // AXContents
175 - (NSArray* _Nullable)moxContents;
177 // AXOrientation
178 - (NSString* _Nullable)moxOrientation;
180 // AXMenuItemMarkChar
181 - (NSString* _Nullable)moxMenuItemMarkChar;
183 // AXLoaded
184 - (NSNumber* _Nullable)moxLoaded;
186 // AXLoadingProgress
187 - (NSNumber* _Nullable)moxLoadingProgress;
189 // Webkit also implements the following:
190 // // AXCaretBrowsingEnabled
191 // - (NSString* _Nullable)moxCaretBrowsingEnabled;
193 // // AXLayoutCount
194 // - (NSString* _Nullable)moxLayoutCount;
196 // // AXWebSessionID
197 // - (NSString* _Nullable)moxWebSessionID;
199 // // AXPreventKeyboardDOMEventDispatch
200 // - (NSString* _Nullable)moxPreventKeyboardDOMEventDispatch;
202 // Table Attributes
204 // AXRowCount
205 - (NSNumber* _Nullable)moxRowCount;
207 // AXColumnCount
208 - (NSNumber* _Nullable)moxColumnCount;
210 // AXRows
211 - (NSArray* _Nullable)moxRows;
213 // AXColumns
214 - (NSArray* _Nullable)moxColumns;
216 // AXIndex
217 - (NSNumber* _Nullable)moxIndex;
219 // AXRowIndexRange
220 - (NSValue* _Nullable)moxRowIndexRange;
222 // AXColumnIndexRange
223 - (NSValue* _Nullable)moxColumnIndexRange;
225 // AXRowHeaderUIElements
226 - (NSArray* _Nullable)moxRowHeaderUIElements;
228 // AXColumnHeaderUIElements
229 - (NSArray* _Nullable)moxColumnHeaderUIElements;
231 // AXIdentifier
232 - (NSString* _Nullable)moxIdentifier;
234 // AXVisibleChildren
235 - (NSArray* _Nullable)moxVisibleChildren;
237 // Outline Attributes
239 // AXDisclosing
240 - (NSNumber* _Nullable)moxDisclosing;
242 // AXDisclosedByRow
243 - (id _Nullable)moxDisclosedByRow;
245 // AXDisclosureLevel
246 - (NSNumber* _Nullable)moxDisclosureLevel;
248 // AXDisclosedRows
249 - (NSArray* _Nullable)moxDisclosedRows;
251 // AXSelectedRows
252 - (NSArray* _Nullable)moxSelectedRows;
254 // Math Attributes
256 // AXMathRootRadicand
257 - (id _Nullable)moxMathRootRadicand;
259 // AXMathRootIndex
260 - (id _Nullable)moxMathRootIndex;
262 // AXMathFractionNumerator
263 - (id _Nullable)moxMathFractionNumerator;
265 // AXMathFractionDenominator
266 - (id _Nullable)moxMathFractionDenominator;
268 // AXMathLineThickness
269 - (NSNumber* _Nullable)moxMathLineThickness;
271 // AXMathBase
272 - (id _Nullable)moxMathBase;
274 // AXMathSubscript
275 - (id _Nullable)moxMathSubscript;
277 // AXMathSuperscript
278 - (id _Nullable)moxMathSuperscript;
280 // AXMathUnder
281 - (id _Nullable)moxMathUnder;
283 // AXMathOver
284 - (id _Nullable)moxMathOver;
286 // AXInvalid
287 - (NSString* _Nullable)moxInvalid;
289 // AXSelectedText
290 - (NSString* _Nullable)moxSelectedText;
292 // AXSelectedTextRange
293 - (NSValue* _Nullable)moxSelectedTextRange;
295 // AXNumberOfCharacters
296 - (NSNumber* _Nullable)moxNumberOfCharacters;
298 // AXVisibleCharacterRange
299 - (NSValue* _Nullable)moxVisibleCharacterRange;
301 // AXInsertionPointLineNumber
302 - (NSNumber* _Nullable)moxInsertionPointLineNumber;
304 // AXEditableAncestor
305 - (id _Nullable)moxEditableAncestor;
307 // AXHighestEditableAncestor
308 - (id _Nullable)moxHighestEditableAncestor;
310 // AXFocusableAncestor
311 - (id _Nullable)moxFocusableAncestor;
313 // AXARIAAtomic
314 - (NSNumber* _Nullable)moxARIAAtomic;
316 // AXARIALive
317 - (NSString* _Nullable)moxARIALive;
319 // AXARIARelevant
320 - (NSString* _Nullable)moxARIARelevant;
322 // AXMozDebugDescription
323 - (NSString* _Nullable)moxMozDebugDescription;
325 #pragma mark - AttributeSetters
327 // AXDisclosing
328 - (void)moxSetDisclosing:(NSNumber* _Nullable)disclosing;
330 // AXValue
331 - (void)moxSetValue:(id _Nullable)value;
333 // AXFocused
334 - (void)moxSetFocused:(NSNumber* _Nullable)focused;
336 // AXSelected
337 - (void)moxSetSelected:(NSNumber* _Nullable)selected;
339 // AXSelectedChildren
340 - (void)moxSetSelectedChildren:(NSArray* _Nullable)selectedChildren;
342 // AXSelectedText
343 - (void)moxSetSelectedText:(NSString* _Nullable)selectedText;
345 // AXSelectedTextRange
346 - (void)moxSetSelectedTextRange:(NSValue* _Nullable)selectedTextRange;
348 // AXVisibleCharacterRange
349 - (void)moxSetVisibleCharacterRange:(NSValue* _Nullable)visibleCharacterRange;
351 #pragma mark - Actions
353 // AXPress
354 - (void)moxPerformPress;
356 // AXShowMenu
357 - (void)moxPerformShowMenu;
359 // AXScrollToVisible
360 - (void)moxPerformScrollToVisible;
362 // AXIncrement
363 - (void)moxPerformIncrement;
365 // AXDecrement
366 - (void)moxPerformDecrement;
368 #pragma mark - ParameterizedAttributeGetters
370 // AXLineForIndex
371 - (NSNumber* _Nullable)moxLineForIndex:(NSNumber* _Nonnull)index;
373 // AXRangeForLine
374 - (NSValue* _Nullable)moxRangeForLine:(NSNumber* _Nonnull)line;
376 // AXStringForRange
377 - (NSString* _Nullable)moxStringForRange:(NSValue* _Nonnull)range;
379 // AXRangeForPosition
380 - (NSValue* _Nullable)moxRangeForPosition:(NSValue* _Nonnull)position;
382 // AXRangeForIndex
383 - (NSValue* _Nullable)moxRangeForIndex:(NSNumber* _Nonnull)index;
385 // AXBoundsForRange
386 - (NSValue* _Nullable)moxBoundsForRange:(NSValue* _Nonnull)range;
388 // AXRTFForRange
389 - (NSData* _Nullable)moxRTFForRange:(NSValue* _Nonnull)range;
391 // AXStyleRangeForIndex
392 - (NSValue* _Nullable)moxStyleRangeForIndex:(NSNumber* _Nonnull)index;
394 // AXAttributedStringForRange
395 - (NSAttributedString* _Nullable)moxAttributedStringForRange:
396 (NSValue* _Nonnull)range;
398 // AXUIElementsForSearchPredicate
399 - (NSArray* _Nullable)moxUIElementsForSearchPredicate:
400 (NSDictionary* _Nonnull)searchPredicate;
402 // AXUIElementCountForSearchPredicate
403 - (NSNumber* _Nullable)moxUIElementCountForSearchPredicate:
404 (NSDictionary* _Nonnull)searchPredicate;
406 // AXCellForColumnAndRow
407 - (id _Nullable)moxCellForColumnAndRow:(NSArray* _Nonnull)columnAndRow;
409 // AXIndexForChildUIElement
410 - (NSNumber* _Nullable)moxIndexForChildUIElement:(id _Nonnull)child;
412 @end
414 // This protocol maps text marker and text marker range parameters to
415 // methods. It is implemented by a delegate of a MOXAccessible.
416 @protocol MOXTextMarkerSupport
418 #pragma mark - TextAttributeGetters
420 // AXStartTextMarker
421 - (id _Nullable)moxStartTextMarker;
423 // AXEndTextMarker
424 - (id _Nullable)moxEndTextMarker;
426 // AXSelectedTextMarkerRange
427 - (id _Nullable)moxSelectedTextMarkerRange;
429 #pragma mark - ParameterizedTextAttributeGetters
431 // AXLengthForTextMarkerRange
432 - (NSNumber* _Nullable)moxLengthForTextMarkerRange:(id _Nonnull)textMarkerRange;
434 // AXStringForTextMarkerRange
435 - (NSString* _Nullable)moxStringForTextMarkerRange:(id _Nonnull)textMarkerRange;
437 // AXTextMarkerRangeForUnorderedTextMarkers
438 - (id _Nullable)moxTextMarkerRangeForUnorderedTextMarkers:
439 (NSArray* _Nonnull)textMarkers;
441 // AXLeftWordTextMarkerRangeForTextMarker
442 - (id _Nullable)moxLeftWordTextMarkerRangeForTextMarker:(id _Nonnull)textMarker;
444 // AXRightWordTextMarkerRangeForTextMarker
445 - (id _Nullable)moxRightWordTextMarkerRangeForTextMarker:
446 (id _Nonnull)textMarker;
448 // AXStartTextMarkerForTextMarkerRange
449 - (id _Nullable)moxStartTextMarkerForTextMarkerRange:
450 (id _Nonnull)textMarkerRange;
452 // AXEndTextMarkerForTextMarkerRange
453 - (id _Nullable)moxEndTextMarkerForTextMarkerRange:(id _Nonnull)textMarkerRange;
455 // AXNextTextMarkerForTextMarker
456 - (id _Nullable)moxNextTextMarkerForTextMarker:(id _Nonnull)textMarker;
458 // AXPreviousTextMarkerForTextMarker
459 - (id _Nullable)moxPreviousTextMarkerForTextMarker:(id _Nonnull)textMarker;
461 // AXAttributedStringForTextMarkerRange
462 - (NSAttributedString* _Nullable)moxAttributedStringForTextMarkerRange:
463 (id _Nonnull)textMarkerRange;
465 // AXBoundsForTextMarkerRange
466 - (NSValue* _Nullable)moxBoundsForTextMarkerRange:(id _Nonnull)textMarkerRange;
468 // AXIndexForTextMarker
469 - (NSNumber* _Nullable)moxIndexForTextMarker:(id _Nonnull)textMarker;
471 // AXTextMarkerForIndex
472 - (id _Nullable)moxTextMarkerForIndex:(NSNumber* _Nonnull)index;
474 // AXUIElementForTextMarker
475 - (id _Nullable)moxUIElementForTextMarker:(id _Nonnull)textMarker;
477 // AXTextMarkerRangeForUIElement
478 - (id _Nullable)moxTextMarkerRangeForUIElement:(id _Nonnull)element;
480 // AXLineTextMarkerRangeForTextMarker
481 - (id _Nullable)moxLineTextMarkerRangeForTextMarker:(id _Nonnull)textMarker;
483 // AXLeftLineTextMarkerRangeForTextMarker
484 - (id _Nullable)moxLeftLineTextMarkerRangeForTextMarker:(id _Nonnull)textMarker;
486 // AXRightLineTextMarkerRangeForTextMarker
487 - (id _Nullable)moxRightLineTextMarkerRangeForTextMarker:
488 (id _Nonnull)textMarker;
490 // AXParagraphTextMarkerRangeForTextMarker
491 - (id _Nullable)moxParagraphTextMarkerRangeForTextMarker:
492 (id _Nonnull)textMarker;
494 // AXStyleTextMarkerRangeForTextMarker
495 - (id _Nullable)moxStyleTextMarkerRangeForTextMarker:(id _Nonnull)textMarker;
497 // AXMozDebugDescriptionForTextMarker
498 - (NSString* _Nullable)moxMozDebugDescriptionForTextMarker:
499 (id _Nonnull)textMarker;
501 // AXMozDebugDescriptionForTextMarkerRange
502 - (NSString* _Nullable)moxMozDebugDescriptionForTextMarkerRange:
503 (id _Nonnull)textMarkerRange;
505 #pragma mark - TextAttributeSetters
507 // AXSelectedTextMarkerRange
508 - (void)moxSetSelectedTextMarkerRange:(id _Nullable)textMarkerRange;
510 @end