Revert 268405 "Make sure that ScratchBuffer::Allocate() always r..."
[chromium-blink-merge.git] / content / browser / accessibility / browser_accessibility_cocoa.h
blob8f38eaaa170c6fffb740a06f13056679149d5a30
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_
6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_
8 #import <Cocoa/Cocoa.h>
10 #import "base/mac/scoped_nsobject.h"
11 #include "content/browser/accessibility/browser_accessibility.h"
12 #include "content/browser/accessibility/browser_accessibility_manager.h"
14 // BrowserAccessibilityCocoa is a cocoa wrapper around the BrowserAccessibility
15 // object. The renderer converts webkit's accessibility tree into a
16 // WebAccessibility tree and passes it to the browser process over IPC.
17 // This class converts it into a format Cocoa can query.
18 @interface BrowserAccessibilityCocoa : NSObject {
19 @private
20 content::BrowserAccessibility* browserAccessibility_;
21 base::scoped_nsobject<NSMutableArray> children_;
24 // This creates a cocoa browser accessibility object around
25 // the cross platform BrowserAccessibility object, which can't be null.
26 - (id)initWithObject:(content::BrowserAccessibility*)accessibility;
28 // Clear this object's pointer to the wrapped BrowserAccessibility object
29 // because the wrapped object has been deleted, but this object may
30 // persist if the system still has references to it.
31 - (void)detach;
33 // Invalidate children for a non-ignored ancestor (including self).
34 - (void)childrenChanged;
36 // Convenience method to get the internal, cross-platform role
37 // from browserAccessibility_.
38 - (ui::AXRole)internalRole;
40 // Convenience method to get the BrowserAccessibilityDelegate from
41 // the manager.
42 - (content::BrowserAccessibilityDelegate*)delegate;
44 // Convert the local objet's origin to a global point.
45 - (NSPoint)pointInScreen:(NSPoint)origin
46 size:(NSSize)size;
48 // Return the method name for the given attribute. For testing only.
49 - (NSString*)methodNameForAttribute:(NSString*)attribute;
51 // Internally-used method.
52 @property(nonatomic, readonly) NSPoint origin;
54 // Children is an array of BrowserAccessibility objects, representing
55 // the accessibility children of this object.
56 @property(nonatomic, readonly) NSString* accessKey;
57 @property(nonatomic, readonly) NSNumber* ariaAtomic;
58 @property(nonatomic, readonly) NSNumber* ariaBusy;
59 @property(nonatomic, readonly) NSString* ariaLive;
60 @property(nonatomic, readonly) NSString* ariaRelevant;
61 @property(nonatomic, readonly) NSArray* children;
62 @property(nonatomic, readonly) NSArray* columns;
63 @property(nonatomic, readonly) NSArray* columnHeaders;
64 @property(nonatomic, readonly) NSValue* columnIndexRange;
65 @property(nonatomic, readonly) NSString* description;
66 @property(nonatomic, readonly) NSNumber* disclosing;
67 @property(nonatomic, readonly) id disclosedByRow;
68 @property(nonatomic, readonly) NSNumber* disclosureLevel;
69 @property(nonatomic, readonly) id disclosedRows;
70 @property(nonatomic, readonly) NSNumber* enabled;
71 @property(nonatomic, readonly) NSNumber* focused;
72 @property(nonatomic, readonly) NSString* help;
73 // isIgnored returns whether or not the accessibility object
74 // should be ignored by the accessibility hierarchy.
75 @property(nonatomic, readonly, getter=isIgnored) BOOL ignored;
76 // Index of a row, column, or tree item.
77 @property(nonatomic, readonly) NSNumber* index;
78 @property(nonatomic, readonly) NSString* invalid;
79 @property(nonatomic, readonly) NSNumber* loaded;
80 @property(nonatomic, readonly) NSNumber* loadingProgress;
81 @property(nonatomic, readonly) NSNumber* maxValue;
82 @property(nonatomic, readonly) NSNumber* minValue;
83 @property(nonatomic, readonly) NSNumber* numberOfCharacters;
84 @property(nonatomic, readonly) NSString* orientation;
85 @property(nonatomic, readonly) id parent;
86 @property(nonatomic, readonly) NSValue* position;
87 @property(nonatomic, readonly) NSNumber* required;
88 // A string indicating the role of this object as far as accessibility
89 // is concerned.
90 @property(nonatomic, readonly) NSString* role;
91 @property(nonatomic, readonly) NSString* roleDescription;
92 @property(nonatomic, readonly) NSArray* rowHeaders;
93 @property(nonatomic, readonly) NSValue* rowIndexRange;
94 @property(nonatomic, readonly) NSArray* rows;
95 // The size of this object.
96 @property(nonatomic, readonly) NSValue* size;
97 // A string indicating the subrole of this object as far as accessibility
98 // is concerned.
99 @property(nonatomic, readonly) NSString* subrole;
100 // The tabs owned by a tablist.
101 @property(nonatomic, readonly) NSArray* tabs;
102 @property(nonatomic, readonly) NSString* title;
103 @property(nonatomic, readonly) id titleUIElement;
104 @property(nonatomic, readonly) NSURL* url;
105 @property(nonatomic, readonly) NSString* value;
106 @property(nonatomic, readonly) NSString* valueDescription;
107 @property(nonatomic, readonly) NSValue* visibleCharacterRange;
108 @property(nonatomic, readonly) NSArray* visibleCells;
109 @property(nonatomic, readonly) NSArray* visibleColumns;
110 @property(nonatomic, readonly) NSArray* visibleRows;
111 @property(nonatomic, readonly) NSNumber* visited;
112 @property(nonatomic, readonly) id window;
113 @end
115 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_