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 UI_BASE_WIN_ACCESSIBILITY_MISC_UTILS_H_
5 #define UI_BASE_WIN_ACCESSIBILITY_MISC_UTILS_H_
9 #include <UIAutomationCore.h>
11 #include "base/compiler_specific.h"
12 #include "ui/base/ui_base_export.h"
17 // UIA Text provider implementation for edit controls.
18 class UI_BASE_EXPORT UIATextProvider
19 : public NON_EXPORTED_BASE(CComObjectRootEx
<CComMultiThreadModel
>),
20 public IValueProvider
,
21 public ITextProvider
{
23 BEGIN_COM_MAP(UIATextProvider
)
24 COM_INTERFACE_ENTRY2(IUnknown
, ITextProvider
)
25 COM_INTERFACE_ENTRY(IValueProvider
)
26 COM_INTERFACE_ENTRY(ITextProvider
)
31 // Creates an instance of the UIATextProvider class.
32 // Returns true on success
33 static bool CreateTextProvider(bool editable
, IUnknown
** provider
);
35 void set_editable(bool editable
) {
40 // IValueProvider methods.
42 STDMETHOD(get_IsReadOnly
)(BOOL
* read_only
);
45 // IValueProvider methods not implemented.
47 STDMETHOD(SetValue
)(const wchar_t* val
) {
51 STDMETHOD(get_Value
)(BSTR
* value
) {
56 // ITextProvider methods.
58 STDMETHOD(GetSelection
)(SAFEARRAY
** ret
) {
62 STDMETHOD(GetVisibleRanges
)(SAFEARRAY
** ret
) {
66 STDMETHOD(RangeFromChild
)(IRawElementProviderSimple
* child
,
67 ITextRangeProvider
** ret
) {
71 STDMETHOD(RangeFromPoint
)(struct UiaPoint point
,
72 ITextRangeProvider
** ret
) {
76 STDMETHOD(get_DocumentRange
)(ITextRangeProvider
** ret
) {
80 STDMETHOD(get_SupportedTextSelection
)(enum SupportedTextSelection
* ret
) {
91 #endif // UI_BASE_WIN_ACCESSIBILITY_MISC_UTILS_H_