OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_BROWSER_ACCESSIBILITY_WIN_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_ACCESSIBILITY_WIN_H_ |
6 #define CHROME_BROWSER_BROWSER_ACCESSIBILITY_WIN_H_ | 6 #define CHROME_BROWSER_BROWSER_ACCESSIBILITY_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <atlbase.h> | 9 #include <atlbase.h> |
10 #include <atlcom.h> | 10 #include <atlcom.h> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 void AddChild(BrowserAccessibility* child); | 60 void AddChild(BrowserAccessibility* child); |
61 | 61 |
62 // Mark this object as inactive, and remove references to all children. | 62 // Mark this object as inactive, and remove references to all children. |
63 // When no other clients hold any references to this object it will be | 63 // When no other clients hold any references to this object it will be |
64 // deleted, and in the meantime, calls to any methods will return E_FAIL. | 64 // deleted, and in the meantime, calls to any methods will return E_FAIL. |
65 void InactivateTree(); | 65 void InactivateTree(); |
66 | 66 |
67 // Return true if this object is equal to or a descendant of |ancestor|. | 67 // Return true if this object is equal to or a descendant of |ancestor|. |
68 bool IsDescendantOf(BrowserAccessibility* ancestor); | 68 bool IsDescendantOf(BrowserAccessibility* ancestor); |
69 | 69 |
| 70 // Returns the parent of this object, or NULL if it's the BrowserAccessibility |
| 71 // root. |
| 72 BrowserAccessibility* GetParent(); |
| 73 |
70 // Return the previous sibling of this object, or NULL if it's the first | 74 // Return the previous sibling of this object, or NULL if it's the first |
71 // child of its parent. | 75 // child of its parent. |
72 BrowserAccessibility* GetPreviousSibling(); | 76 BrowserAccessibility* GetPreviousSibling(); |
73 | 77 |
74 // Return the next sibling of this object, or NULL if it's the last child | 78 // Return the next sibling of this object, or NULL if it's the last child |
75 // of its parent. | 79 // of its parent. |
76 BrowserAccessibility* GetNextSibling(); | 80 BrowserAccessibility* GetNextSibling(); |
77 | 81 |
| 82 // Replace a child BrowserAccessibility object. Used when updating the |
| 83 // accessibility tree. |
| 84 void ReplaceChild( |
| 85 const BrowserAccessibility* old_acc, BrowserAccessibility* new_acc); |
| 86 |
78 // Accessors | 87 // Accessors |
79 LONG child_id() const { return child_id_; } | 88 LONG child_id() const { return child_id_; } |
80 int32 renderer_id() const { return renderer_id_; } | 89 int32 renderer_id() const { return renderer_id_; } |
| 90 LONG index_in_parent() const { return index_in_parent_; } |
81 | 91 |
82 // Add one to the reference count and return the same object. Always | 92 // Add one to the reference count and return the same object. Always |
83 // use this method when returning a BrowserAccessibility object as | 93 // use this method when returning a BrowserAccessibility object as |
84 // an output parameter to a COM interface, never use it otherwise. | 94 // an output parameter to a COM interface, never use it otherwise. |
85 BrowserAccessibility* NewReference(); | 95 BrowserAccessibility* NewReference(); |
86 | 96 |
87 // | 97 // |
88 // IAccessible methods. | 98 // IAccessible methods. |
89 // | 99 // |
90 | 100 |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 // and it's removed from our accessibility tree, a client may still be | 401 // and it's removed from our accessibility tree, a client may still be |
392 // holding onto a pointer to this object, so we mark it as inactive | 402 // holding onto a pointer to this object, so we mark it as inactive |
393 // so that calls to any of this object's methods immediately return | 403 // so that calls to any of this object's methods immediately return |
394 // failure. | 404 // failure. |
395 bool instance_active_; | 405 bool instance_active_; |
396 | 406 |
397 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 407 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
398 }; | 408 }; |
399 | 409 |
400 #endif // CHROME_BROWSER_BROWSER_ACCESSIBILITY_WIN_H_ | 410 #endif // CHROME_BROWSER_BROWSER_ACCESSIBILITY_WIN_H_ |
OLD | NEW |