Flutter Engine
The Flutter Engine
ax_platform_node_textprovider_win.h
Go to the documentation of this file.
1// Copyright 2019 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
5#ifndef UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_TEXTPROVIDER_WIN_H_
6#define UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_TEXTPROVIDER_WIN_H_
7
8#include <atlbase.h>
9#include <atlcom.h>
10
11#include <UIAutomationCore.h>
12
13#include "ax/ax_node_position.h"
15
16namespace ui {
17
18class AX_EXPORT __declspec(uuid("3e1c192b-4348-45ac-8eb6-4b58eeb3dcca"))
19 AXPlatformNodeTextProviderWin
20 : public CComObjectRootEx<CComMultiThreadModel>,
21 public ITextEditProvider {
22 public:
23 BEGIN_COM_MAP(AXPlatformNodeTextProviderWin)
24 COM_INTERFACE_ENTRY(ITextProvider)
25 COM_INTERFACE_ENTRY(ITextEditProvider)
26 COM_INTERFACE_ENTRY(AXPlatformNodeTextProviderWin)
27 END_COM_MAP()
28
29 AXPlatformNodeTextProviderWin();
30 ~AXPlatformNodeTextProviderWin();
31
32 static AXPlatformNodeTextProviderWin* Create(AXPlatformNodeWin* owner);
33 static void CreateIUnknown(AXPlatformNodeWin* owner, IUnknown** unknown);
34
35 //
36 // ITextProvider methods.
37 //
38
39 IFACEMETHODIMP GetSelection(SAFEARRAY** selection) override;
40
41 IFACEMETHODIMP GetVisibleRanges(SAFEARRAY** visible_ranges) override;
42
43 IFACEMETHODIMP RangeFromChild(IRawElementProviderSimple* child,
44 ITextRangeProvider** range) override;
45
46 IFACEMETHODIMP RangeFromPoint(UiaPoint point,
47 ITextRangeProvider** range) override;
48
49 IFACEMETHODIMP get_DocumentRange(ITextRangeProvider** range) override;
50
51 IFACEMETHODIMP get_SupportedTextSelection(
52 enum SupportedTextSelection* text_selection) override;
53
54 //
55 // ITextEditProvider methods.
56 //
57
58 IFACEMETHODIMP GetActiveComposition(ITextRangeProvider** range) override;
59
60 IFACEMETHODIMP GetConversionTarget(ITextRangeProvider** range) override;
61
62 // ITextProvider supporting methods.
63
64 static ITextRangeProvider* GetRangeFromChild(
65 ui::AXPlatformNodeWin* ancestor,
66 ui::AXPlatformNodeWin* descendant);
67
68 // Create a dengerate text range at the start of the specified node.
69 static ITextRangeProvider* CreateDegenerateRangeAtStart(
70 ui::AXPlatformNodeWin* node);
71
72 private:
73 friend class AXPlatformNodeTextProviderTest;
74 ui::AXPlatformNodeWin* owner() const;
75 HRESULT GetTextRangeProviderFromActiveComposition(ITextRangeProvider** range);
76
77 Microsoft::WRL::ComPtr<ui::AXPlatformNodeWin> owner_;
78};
79
80} // namespace ui
81
82#endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_TEXTPROVIDER_WIN_H_
static sk_sp< Effect > Create()
Definition: RefCntTest.cpp:117
#define AX_EXPORT
Definition: ax_export.h:29