OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_WIN_H_ | 5 #ifndef VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_WIN_H_ |
6 #define VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_WIN_H_ | 6 #define VIEWS_ACCESSIBILITY_NATIVE_VIEW_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> |
11 | 11 |
12 #include <oleacc.h> | 12 #include <oleacc.h> |
| 13 #include <UIAutomationCore.h> |
13 | 14 |
14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
15 #include "third_party/iaccessible2/ia2_api_all.h" | 16 #include "third_party/iaccessible2/ia2_api_all.h" |
16 #include "ui/base/accessibility/accessible_view_state.h" | 17 #include "ui/base/accessibility/accessible_view_state.h" |
17 #include "ui/views/controls/native/native_view_host.h" | 18 #include "ui/views/controls/native/native_view_host.h" |
18 #include "ui/views/view.h" | 19 #include "ui/views/view.h" |
19 | 20 |
20 namespace ui { | 21 namespace ui { |
21 enum TextBoundaryDirection; | 22 enum TextBoundaryDirection; |
22 enum TextBoundaryType; | 23 enum TextBoundaryType; |
(...skipping 10 matching lines...) Expand all Loading... |
33 // providing accessibility to be used by screen readers and other assistive | 34 // providing accessibility to be used by screen readers and other assistive |
34 // technology (AT). | 35 // technology (AT). |
35 // | 36 // |
36 //////////////////////////////////////////////////////////////////////////////// | 37 //////////////////////////////////////////////////////////////////////////////// |
37 class __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2")) | 38 class __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2")) |
38 NativeViewAccessibilityWin | 39 NativeViewAccessibilityWin |
39 : public CComObjectRootEx<CComMultiThreadModel>, | 40 : public CComObjectRootEx<CComMultiThreadModel>, |
40 public IDispatchImpl<IAccessible2, &IID_IAccessible2, | 41 public IDispatchImpl<IAccessible2, &IID_IAccessible2, |
41 &LIBID_IAccessible2Lib>, | 42 &LIBID_IAccessible2Lib>, |
42 public IAccessibleText, | 43 public IAccessibleText, |
43 public IServiceProvider { | 44 public IServiceProvider, |
| 45 public IAccessibleEx, |
| 46 public IRawElementProviderSimple { |
44 public: | 47 public: |
45 BEGIN_COM_MAP(NativeViewAccessibilityWin) | 48 BEGIN_COM_MAP(NativeViewAccessibilityWin) |
46 COM_INTERFACE_ENTRY2(IDispatch, IAccessible2) | 49 COM_INTERFACE_ENTRY2(IDispatch, IAccessible2) |
47 COM_INTERFACE_ENTRY2(IAccessible, IAccessible2) | 50 COM_INTERFACE_ENTRY2(IAccessible, IAccessible2) |
48 COM_INTERFACE_ENTRY(IAccessible2) | 51 COM_INTERFACE_ENTRY(IAccessible2) |
49 COM_INTERFACE_ENTRY(IAccessibleText) | 52 COM_INTERFACE_ENTRY(IAccessibleText) |
50 COM_INTERFACE_ENTRY(IServiceProvider) | 53 COM_INTERFACE_ENTRY(IServiceProvider) |
| 54 COM_INTERFACE_ENTRY(IAccessibleEx) |
| 55 COM_INTERFACE_ENTRY(IRawElementProviderSimple) |
51 END_COM_MAP() | 56 END_COM_MAP() |
52 | 57 |
53 // Create method for view accessibility. | 58 // Create method for view accessibility. |
54 static scoped_refptr<NativeViewAccessibilityWin> Create(views::View* view); | 59 static scoped_refptr<NativeViewAccessibilityWin> Create(views::View* view); |
55 | 60 |
56 virtual ~NativeViewAccessibilityWin(); | 61 virtual ~NativeViewAccessibilityWin(); |
57 | 62 |
58 void set_view(views::View* view) { view_ = view; } | 63 void set_view(views::View* view) { view_ = view; } |
59 | 64 |
60 // Supported IAccessible methods. | 65 // Supported IAccessible methods. |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 LONG x, LONG y) { | 284 LONG x, LONG y) { |
280 return E_NOTIMPL; | 285 return E_NOTIMPL; |
281 } | 286 } |
282 | 287 |
283 // | 288 // |
284 // IServiceProvider methods. | 289 // IServiceProvider methods. |
285 // | 290 // |
286 | 291 |
287 STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, void** object); | 292 STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, void** object); |
288 | 293 |
| 294 // |
| 295 // IAccessibleEx methods not implemented. |
| 296 // |
| 297 STDMETHODIMP GetObjectForChild(long child_id, IAccessibleEx** ret) { |
| 298 return E_NOTIMPL; |
| 299 } |
| 300 |
| 301 STDMETHODIMP GetIAccessiblePair(IAccessible** acc, long* child_id) { |
| 302 return E_NOTIMPL; |
| 303 } |
| 304 |
| 305 STDMETHODIMP GetRuntimeId(SAFEARRAY** runtime_id) { |
| 306 return E_NOTIMPL; |
| 307 } |
| 308 |
| 309 STDMETHODIMP ConvertReturnedElement(IRawElementProviderSimple* element, |
| 310 IAccessibleEx** acc) { |
| 311 return E_NOTIMPL; |
| 312 } |
| 313 |
| 314 // |
| 315 // IRawElementProviderSimple methods. |
| 316 // |
| 317 // The GetPatternProvider/GetPropertyValue methods need to be implemented for |
| 318 // the on-screen keyboard to show up in Windows 8 metro. |
| 319 STDMETHODIMP GetPatternProvider(PATTERNID id, IUnknown** provider); |
| 320 STDMETHODIMP GetPropertyValue(PROPERTYID id, VARIANT* ret); |
| 321 |
| 322 // |
| 323 // IRawElementProviderSimple methods not implemented. |
| 324 // |
| 325 STDMETHODIMP get_ProviderOptions(enum ProviderOptions* ret) { |
| 326 return E_NOTIMPL; |
| 327 } |
| 328 |
| 329 STDMETHODIMP get_HostRawElementProvider( |
| 330 IRawElementProviderSimple** provider) { |
| 331 return E_NOTIMPL; |
| 332 } |
| 333 |
289 // Returns a conversion from the event (as defined in accessibility_types.h) | 334 // Returns a conversion from the event (as defined in accessibility_types.h) |
290 // to an MSAA event. | 335 // to an MSAA event. |
291 static int32 MSAAEvent(ui::AccessibilityTypes::Event event); | 336 static int32 MSAAEvent(ui::AccessibilityTypes::Event event); |
292 | 337 |
293 // Returns a conversion from the Role (as defined in accessibility_types.h) | 338 // Returns a conversion from the Role (as defined in accessibility_types.h) |
294 // to an MSAA role. | 339 // to an MSAA role. |
295 static int32 MSAARole(ui::AccessibilityTypes::Role role); | 340 static int32 MSAARole(ui::AccessibilityTypes::Role role); |
296 | 341 |
297 // Returns a conversion from the State (as defined in accessibility_types.h) | 342 // Returns a conversion from the State (as defined in accessibility_types.h) |
298 // to MSAA states set. | 343 // to MSAA states set. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 // A unique id for each object, needed for IAccessible2. | 391 // A unique id for each object, needed for IAccessible2. |
347 long unique_id_; | 392 long unique_id_; |
348 | 393 |
349 // Next unique id to assign. | 394 // Next unique id to assign. |
350 static long next_unique_id_; | 395 static long next_unique_id_; |
351 | 396 |
352 DISALLOW_COPY_AND_ASSIGN(NativeViewAccessibilityWin); | 397 DISALLOW_COPY_AND_ASSIGN(NativeViewAccessibilityWin); |
353 }; | 398 }; |
354 | 399 |
355 #endif // VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_WIN_H_ | 400 #endif // VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_WIN_H_ |
OLD | NEW |