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