OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef BASE_WIN_ACCESSIBILITY_MISC_UTILS_H_ | 4 #ifndef UI_BASE_WIN_ACCESSIBILITY_MISC_UTILS_H_ |
5 #define BASE_WIN_ACCESSIBILITY_MISC_UTILS_H_ | 5 #define UI_BASE_WIN_ACCESSIBILITY_MISC_UTILS_H_ |
6 #pragma once | 6 #pragma once |
7 | 7 |
8 #include <atlbase.h> | 8 #include <atlbase.h> |
9 #include <atlcom.h> | 9 #include <atlcom.h> |
10 #include <UIAutomationCore.h> | 10 #include <UIAutomationCore.h> |
11 | 11 |
12 #include "base/base_export.h" | |
13 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "ui/base/ui_export.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 namespace win { | 16 namespace win { |
17 | 17 |
18 // UIA Text provider implementation for edit controls. | 18 // UIA Text provider implementation for edit controls. |
19 class BASE_EXPORT UIATextProvider | 19 class UI_EXPORT UIATextProvider |
20 : public NON_EXPORTED_BASE(CComObjectRootEx<CComMultiThreadModel>), | 20 : public NON_EXPORTED_BASE(CComObjectRootEx<CComMultiThreadModel>), |
21 public IValueProvider, | 21 public IValueProvider, |
22 public ITextProvider { | 22 public ITextProvider { |
23 public: | 23 public: |
24 BEGIN_COM_MAP(UIATextProvider) | 24 BEGIN_COM_MAP(UIATextProvider) |
25 COM_INTERFACE_ENTRY2(IUnknown, ITextProvider) | 25 COM_INTERFACE_ENTRY2(IUnknown, ITextProvider) |
26 COM_INTERFACE_ENTRY(IValueProvider) | 26 COM_INTERFACE_ENTRY(IValueProvider) |
27 COM_INTERFACE_ENTRY(ITextProvider) | 27 COM_INTERFACE_ENTRY(ITextProvider) |
28 END_COM_MAP() | 28 END_COM_MAP() |
29 | 29 |
30 UIATextProvider(); | 30 UIATextProvider(); |
31 | 31 |
32 // Creates an instance of the UIATextProvider class. | 32 // Creates an instance of the UIATextProvider class. |
33 // Returns true on success | 33 // Returns true on success |
34 static bool CreateTextProvider(bool editable, IUnknown** provider); | 34 static bool CreateTextProvider(bool editable, IUnknown** provider); |
35 | 35 |
36 void set_editable(bool editable) { | 36 void set_editable(bool editable) { |
37 editable_ = editable; | 37 editable_ = editable; |
38 } | 38 } |
39 | 39 |
40 // | 40 // |
41 // IValueProvider methods. | 41 // IValueProvider methods. |
42 // | 42 // |
43 STDMETHODIMP get_IsReadOnly(BOOL* read_only); | 43 STDMETHOD(get_IsReadOnly)(BOOL* read_only); |
44 | 44 |
45 // | 45 // |
46 // IValueProvider methods not implemented. | 46 // IValueProvider methods not implemented. |
47 // | 47 // |
48 STDMETHODIMP SetValue(const wchar_t* val) { | 48 STDMETHOD(SetValue)(const wchar_t* val) { |
49 return E_NOTIMPL; | 49 return E_NOTIMPL; |
50 } | 50 } |
51 | 51 |
52 STDMETHODIMP get_Value(BSTR* value) { | 52 STDMETHOD(get_Value)(BSTR* value) { |
53 return E_NOTIMPL; | 53 return E_NOTIMPL; |
54 } | 54 } |
55 | 55 |
56 // | 56 // |
57 // ITextProvider methods. | 57 // ITextProvider methods. |
58 // | 58 // |
59 STDMETHODIMP GetSelection(SAFEARRAY** ret) { | 59 STDMETHOD(GetSelection)(SAFEARRAY** ret) { |
60 return E_NOTIMPL; | 60 return E_NOTIMPL; |
61 } | 61 } |
62 | 62 |
63 STDMETHODIMP GetVisibleRanges(SAFEARRAY** ret) { | 63 STDMETHOD(GetVisibleRanges)(SAFEARRAY** ret) { |
64 return E_NOTIMPL; | 64 return E_NOTIMPL; |
65 } | 65 } |
66 | 66 |
67 STDMETHODIMP RangeFromChild(IRawElementProviderSimple* child, | 67 STDMETHOD(RangeFromChild)(IRawElementProviderSimple* child, |
68 ITextRangeProvider** ret) { | 68 ITextRangeProvider** ret) { |
69 return E_NOTIMPL; | 69 return E_NOTIMPL; |
70 } | 70 } |
71 | 71 |
72 STDMETHODIMP RangeFromPoint(struct UiaPoint point, | 72 STDMETHOD(RangeFromPoint)(struct UiaPoint point, |
73 ITextRangeProvider** ret) { | 73 ITextRangeProvider** ret) { |
74 return E_NOTIMPL; | 74 return E_NOTIMPL; |
75 } | 75 } |
76 | 76 |
77 STDMETHODIMP get_DocumentRange(ITextRangeProvider** ret) { | 77 STDMETHOD(get_DocumentRange)(ITextRangeProvider** ret) { |
78 return E_NOTIMPL; | 78 return E_NOTIMPL; |
79 } | 79 } |
80 | 80 |
81 STDMETHODIMP get_SupportedTextSelection(enum SupportedTextSelection* ret) { | 81 STDMETHOD(get_SupportedTextSelection)(enum SupportedTextSelection* ret) { |
82 return E_NOTIMPL; | 82 return E_NOTIMPL; |
83 } | 83 } |
84 | 84 |
85 private: | 85 private: |
86 bool editable_; | 86 bool editable_; |
87 }; | 87 }; |
88 | 88 |
89 } // win | 89 } // win |
90 } // base | 90 } // base |
91 | 91 |
92 #endif // BASE_WIN_ACCESSIBILITY_MISC_UTILS_H_ | 92 #endif // UI_BASE_WIN_ACCESSIBILITY_MISC_UTILS_H_ |
OLD | NEW |