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 #import "content/browser/accessibility/browser_accessibility_delegate_mac.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
{
20 content::BrowserAccessibility
* browserAccessibility_
;
21 base::scoped_nsobject
<NSMutableArray
> children_
;
22 id
<BrowserAccessibilityDelegateCocoa
> delegate_
;
25 // This creates a cocoa browser accessibility object around
26 // the cross platform BrowserAccessibility object. The delegate is
27 // used to communicate with the host renderer. None of these
28 // parameters can be null.
29 - (id
)initWithObject
:(content::BrowserAccessibility
*)accessibility
30 delegate
:(id
<BrowserAccessibilityDelegateCocoa
>)delegate
;
32 // Clear this object's pointer to the wrapped BrowserAccessibility object
33 // because the wrapped object has been deleted, but this object may
34 // persist if the system still has references to it.
37 // Invalidate children for a non-ignored ancestor (including self).
38 - (void)childrenChanged
;
40 // Convenience method to get the internal, cross-platform role
41 // from browserAccessibility_.
42 - (ui::AXRole
)internalRole
;
44 // Return the method name for the given attribute. For testing only.
45 - (NSString
*)methodNameForAttribute
:(NSString
*)attribute
;
47 // Internally-used method.
48 @
property(nonatomic
, readonly
) NSPoint origin
;
50 // Children is an array of BrowserAccessibility objects, representing
51 // the accessibility children of this object.
52 @
property(nonatomic
, readonly
) NSString
* accessKey
;
53 @
property(nonatomic
, readonly
) NSNumber
* ariaAtomic
;
54 @
property(nonatomic
, readonly
) NSNumber
* ariaBusy
;
55 @
property(nonatomic
, readonly
) NSString
* ariaLive
;
56 @
property(nonatomic
, readonly
) NSString
* ariaRelevant
;
57 @
property(nonatomic
, readonly
) NSArray
* children
;
58 @
property(nonatomic
, readonly
) NSArray
* columns
;
59 @
property(nonatomic
, readonly
) NSArray
* columnHeaders
;
60 @
property(nonatomic
, readonly
) NSValue
* columnIndexRange
;
61 @
property(nonatomic
, readonly
) NSString
* description
;
62 @
property(nonatomic
, readonly
) NSNumber
* disclosing
;
63 @
property(nonatomic
, readonly
) id disclosedByRow
;
64 @
property(nonatomic
, readonly
) NSNumber
* disclosureLevel
;
65 @
property(nonatomic
, readonly
) id disclosedRows
;
66 @
property(nonatomic
, readonly
) NSNumber
* enabled
;
67 @
property(nonatomic
, readonly
) NSNumber
* focused
;
68 @
property(nonatomic
, readonly
) NSString
* help
;
69 // isIgnored returns whether or not the accessibility object
70 // should be ignored by the accessibility hierarchy.
71 @
property(nonatomic
, readonly
, getter
=isIgnored
) BOOL ignored
;
72 // Index of a row, column, or tree item.
73 @
property(nonatomic
, readonly
) NSNumber
* index
;
74 @
property(nonatomic
, readonly
) NSString
* invalid
;
75 @
property(nonatomic
, readonly
) NSNumber
* loaded
;
76 @
property(nonatomic
, readonly
) NSNumber
* loadingProgress
;
77 @
property(nonatomic
, readonly
) NSNumber
* maxValue
;
78 @
property(nonatomic
, readonly
) NSNumber
* minValue
;
79 @
property(nonatomic
, readonly
) NSNumber
* numberOfCharacters
;
80 @
property(nonatomic
, readonly
) NSString
* orientation
;
81 @
property(nonatomic
, readonly
) id parent
;
82 @
property(nonatomic
, readonly
) NSValue
* position
;
83 @
property(nonatomic
, readonly
) NSNumber
* required
;
84 // A string indicating the role of this object as far as accessibility
86 @
property(nonatomic
, readonly
) NSString
* role
;
87 @
property(nonatomic
, readonly
) NSString
* roleDescription
;
88 @
property(nonatomic
, readonly
) NSArray
* rowHeaders
;
89 @
property(nonatomic
, readonly
) NSValue
* rowIndexRange
;
90 @
property(nonatomic
, readonly
) NSArray
* rows
;
91 // The size of this object.
92 @
property(nonatomic
, readonly
) NSValue
* size
;
93 // A string indicating the subrole of this object as far as accessibility
95 @
property(nonatomic
, readonly
) NSString
* subrole
;
96 // The tabs owned by a tablist.
97 @
property(nonatomic
, readonly
) NSArray
* tabs
;
98 @
property(nonatomic
, readonly
) NSString
* title
;
99 @
property(nonatomic
, readonly
) id titleUIElement
;
100 @
property(nonatomic
, readonly
) NSString
* url
;
101 @
property(nonatomic
, readonly
) NSString
* value
;
102 @
property(nonatomic
, readonly
) NSString
* valueDescription
;
103 @
property(nonatomic
, readonly
) NSValue
* visibleCharacterRange
;
104 @
property(nonatomic
, readonly
) NSArray
* visibleCells
;
105 @
property(nonatomic
, readonly
) NSArray
* visibleColumns
;
106 @
property(nonatomic
, readonly
) NSArray
* visibleRows
;
107 @
property(nonatomic
, readonly
) NSNumber
* visited
;
108 @
property(nonatomic
, readonly
) id window
;
111 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_