1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/src/mac/mozAccessibleProtocol.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,69 @@ 1.4 +/* -*- Mode: Objective-C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#import <Cocoa/Cocoa.h> 1.10 + 1.11 +#import "mozView.h" 1.12 + 1.13 +/* This protocol's primary use is so widget/cocoa can talk back to us 1.14 + properly. 1.15 + 1.16 + ChildView owns the topmost mozRootAccessible, and needs to take care of setting up 1.17 + that parent/child relationship. 1.18 + 1.19 + This protocol is thus used to make sure it knows it's talking to us, and not 1.20 + just some random |id|. 1.21 +*/ 1.22 + 1.23 +@protocol mozAccessible 1.24 + 1.25 +// returns whether this accessible is the root accessible. there is one 1.26 +// root accessible per window. 1.27 +- (BOOL)isRoot; 1.28 + 1.29 +// some mozAccessibles implement accessibility support in place of another object. for example, 1.30 +// ChildView gets its support from us. 1.31 +// 1.32 +// instead of returning a mozAccessible to the OS when it wants an object, we need to pass the view we represent, so the 1.33 +// OS doesn't get confused and think we return some random object. 1.34 +- (BOOL)hasRepresentedView; 1.35 +- (id)representedView; 1.36 + 1.37 +#ifdef DEBUG 1.38 +// debug utility that will print the native accessibility tree, starting 1.39 +// at this node. 1.40 +- (void)printHierarchy; 1.41 +#endif 1.42 + 1.43 +/*** general ***/ 1.44 + 1.45 +// returns the accessible at the specified point. 1.46 +- (id)accessibilityHitTest:(NSPoint)point; 1.47 + 1.48 +// whether this element is flagged as ignored. 1.49 +- (BOOL)accessibilityIsIgnored; 1.50 + 1.51 +// currently focused UI element (possibly a child accessible) 1.52 +- (id)accessibilityFocusedUIElement; 1.53 + 1.54 +/*** attributes ***/ 1.55 + 1.56 +// all supported attributes 1.57 +- (NSArray*)accessibilityAttributeNames; 1.58 + 1.59 +// value for given attribute. 1.60 +- (id)accessibilityAttributeValue:(NSString*)attribute; 1.61 + 1.62 +// whether a particular attribute can be modified 1.63 +- (BOOL)accessibilityIsAttributeSettable:(NSString*)attribute; 1.64 + 1.65 +/*** actions ***/ 1.66 + 1.67 +- (NSArray*)accessibilityActionNames; 1.68 +- (NSString*)accessibilityActionDescription:(NSString*)action; 1.69 +- (void)accessibilityPerformAction:(NSString*)action; 1.70 + 1.71 +@end 1.72 +