OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2006-2008 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. |
| 4 |
| 5 #ifndef WEBKIT_GLUE_GLUE_ACCESSIBILITY_H_ |
| 6 #define WEBKIT_GLUE_GLUE_ACCESSIBILITY_H_ |
| 7 |
| 8 #include <oleacc.h> |
| 9 #include <hash_map> |
| 10 |
| 11 #include "chrome/common/render_messages.h" |
| 12 |
| 13 class WebView; |
| 14 |
| 15 typedef stdext::hash_map<int, IAccessible*> IntToIAccessibleMap; |
| 16 typedef stdext::hash_map<IAccessible*, int> IAccessibleToIntMap; |
| 17 |
| 18 //////////////////////////////////////////////////////////////////////////////// |
| 19 // |
| 20 // GlueAccessibility |
| 21 // |
| 22 // Operations that access the underlying WebKit DOM directly, exposing |
| 23 // accessibility information. |
| 24 //////////////////////////////////////////////////////////////////////////////// |
| 25 class GlueAccessibility { |
| 26 public: |
| 27 GlueAccessibility(); |
| 28 ~GlueAccessibility(); |
| 29 |
| 30 // Retrieves the IAccessible information as requested in in_params, by calling |
| 31 // into WebKit's implementation of IAccessible. Maintains a hashmap of the |
| 32 // currently active (browser ref count not zero) IAccessibles. Returns true if |
| 33 // successful, false otherwise. |
| 34 bool GetAccessibilityInfo(WebView* view, |
| 35 const ViewMsg_Accessibility_In_Params& in_params, |
| 36 ViewHostMsg_Accessibility_Out_Params* out_params); |
| 37 |
| 38 // Retrieves the RenderObject associated with this WebView, and uses it to |
| 39 // initialize the root of the render-side MSAA tree with the associated |
| 40 // accessibility information. Returns true if successful, false otherwise. |
| 41 bool InitAccessibilityRoot(WebView* view); |
| 42 |
| 43 // Erases the entry identified by the |iaccessible_id| from the hash map. If |
| 44 // |clear_all| is true, all entries are erased. Returns true if successful, |
| 45 // false otherwise. |
| 46 bool ClearIAccessibleMap(int iaccessible_id, bool clear_all); |
| 47 |
| 48 private: |
| 49 // Wrapper around the COM pointer that holds the root of the MSAA tree, to |
| 50 // ensure that we are not requiring WebKit includes outside of glue. |
| 51 struct GlueAccessibilityRoot; |
| 52 GlueAccessibilityRoot* root_; |
| 53 |
| 54 // Hashmap for cashing of elements in use by the AT, mapping id (int) to an |
| 55 // IAccessible pointer. |
| 56 IntToIAccessibleMap int_to_iaccessible_map_; |
| 57 // Hashmap for cashing of elements in use by the AT, mapping an IAccessible |
| 58 // pointer to its id (int). Needed for reverse lookup, to ensure unnecessary |
| 59 // duplicate entries are not created in the IntToIAccessibleMap (above). |
| 60 IAccessibleToIntMap iaccessible_to_int_map_; |
| 61 |
| 62 // Unique identifier for retrieving an IAccessible from the page's hashmap. |
| 63 int iaccessible_id_; |
| 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(GlueAccessibility); |
| 66 }; |
| 67 |
| 68 #endif // WEBKIT_GLUE_GLUE_ACCESSIBILITY_H_ |
OLD | NEW |