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/. */
7 
8 #import <Cocoa/Cocoa.h>
9 
10 #import "mozView.h"
11 
12 /* This protocol's primary use is so widget/cocoa can talk back to us
13    properly.
14 
15    ChildView owns the topmost mozRootAccessible, and needs to take care of
16    setting up that parent/child relationship.
17 
18    This protocol is thus used to make sure it knows it's talking to us, and not
19    just some random |id|.
20 */
21 
22 @protocol mozAccessible
23 
24 // returns whether this accessible is the root accessible. there is one
25 // root accessible per window.
26 - (BOOL)isRoot;
27 
28 // some mozAccessibles implement accessibility support in place of another
29 // object. for example, ChildView gets its support from us.
30 //
31 // instead of returning a mozAccessible to the OS when it wants an object, we
32 // need to pass the view we represent, so the OS doesn't get confused and think
33 // we return some random object.
34 - (BOOL)hasRepresentedView;
35 - (id)representedView;
36 
37 /*** general ***/
38 
39 // returns the accessible at the specified point.
40 - (id)accessibilityHitTest:(NSPoint)point;
41 
42 // whether this element should be exposed to platform.
43 - (BOOL)isAccessibilityElement;
44 
45 // currently focused UI element (possibly a child accessible)
46 - (id)accessibilityFocusedUIElement;
47 
48 /*** attributes ***/
49 
50 // all supported attributes
51 - (NSArray*)accessibilityAttributeNames;
52 
53 // value for given attribute.
54 - (id)accessibilityAttributeValue:(NSString*)attribute;
55 
56 // whether a particular attribute can be modified
57 - (BOOL)accessibilityIsAttributeSettable:(NSString*)attribute;
58 
59 /*** actions ***/
60 
61 - (NSArray*)accessibilityActionNames;
62 - (NSString*)accessibilityActionDescription:(NSString*)action;
63 - (void)accessibilityPerformAction:(NSString*)action;
64 
65 @end
66