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 // IAccessibleEx methods not implemented. | |
dmazzoni
2012/04/04 06:02:00
Nit: same
ananta
2012/04/04 19:23:00
Done.
| |
295 STDMETHODIMP GetObjectForChild(long child_id, IAccessibleEx** ret) { | |
296 return E_NOTIMPL; | |
297 } | |
298 STDMETHODIMP GetIAccessiblePair(IAccessible** acc, long* child_id) { | |
299 return E_NOTIMPL; | |
300 } | |
301 STDMETHODIMP GetRuntimeId(SAFEARRAY** runtime_id) { | |
302 return E_NOTIMPL; | |
303 } | |
304 STDMETHODIMP ConvertReturnedElement(IRawElementProviderSimple* element, | |
305 IAccessibleEx** acc) { | |
306 return E_NOTIMPL; | |
307 } | |
308 | |
309 // IRawElementProviderSimple methods. | |
310 // The GetPatternProvider/GetPropertyValue methods need to be implemented for | |
311 // the on screen keyboard to show up in Windows 8 metro. | |
312 STDMETHOD(GetPatternProvider)(PATTERNID id, IUnknown** provider); | |
313 STDMETHOD(GetPropertyValue)(PROPERTYID id, VARIANT* ret); | |
314 | |
315 // IRawElementProviderSimple methods not implemented. | |
316 STDMETHOD(get_ProviderOptions)(enum ProviderOptions* ret) { | |
317 return E_NOTIMPL; | |
318 } | |
319 STDMETHOD(get_HostRawElementProvider)(IRawElementProviderSimple** provider) { | |
320 return E_NOTIMPL; | |
321 } | |
322 | |
289 // Returns a conversion from the event (as defined in accessibility_types.h) | 323 // Returns a conversion from the event (as defined in accessibility_types.h) |
290 // to an MSAA event. | 324 // to an MSAA event. |
291 static int32 MSAAEvent(ui::AccessibilityTypes::Event event); | 325 static int32 MSAAEvent(ui::AccessibilityTypes::Event event); |
292 | 326 |
293 // Returns a conversion from the Role (as defined in accessibility_types.h) | 327 // Returns a conversion from the Role (as defined in accessibility_types.h) |
294 // to an MSAA role. | 328 // to an MSAA role. |
295 static int32 MSAARole(ui::AccessibilityTypes::Role role); | 329 static int32 MSAARole(ui::AccessibilityTypes::Role role); |
296 | 330 |
297 // Returns a conversion from the State (as defined in accessibility_types.h) | 331 // Returns a conversion from the State (as defined in accessibility_types.h) |
298 // to MSAA states set. | 332 // 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. | 380 // A unique id for each object, needed for IAccessible2. |
347 long unique_id_; | 381 long unique_id_; |
348 | 382 |
349 // Next unique id to assign. | 383 // Next unique id to assign. |
350 static long next_unique_id_; | 384 static long next_unique_id_; |
351 | 385 |
352 DISALLOW_COPY_AND_ASSIGN(NativeViewAccessibilityWin); | 386 DISALLOW_COPY_AND_ASSIGN(NativeViewAccessibilityWin); |
353 }; | 387 }; |
354 | 388 |
355 #endif // VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_WIN_H_ | 389 #endif // VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_WIN_H_ |
OLD | NEW |