Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
flutter::FlutterPlatformNodeDelegateWindows Class Reference

#include <flutter_platform_node_delegate_windows.h>

Inheritance diagram for flutter::FlutterPlatformNodeDelegateWindows:
flutter::FlutterPlatformNodeDelegate ui::AXPlatformNodeDelegateBase ui::AXPlatformNodeDelegate

Public Member Functions

 FlutterPlatformNodeDelegateWindows (std::weak_ptr< AccessibilityBridge > bridge, FlutterWindowsView *view)
 
virtual ~FlutterPlatformNodeDelegateWindows ()
 
void Init (std::weak_ptr< OwnerBridge > bridge, ui::AXNode *node) override
 Called only once, immediately after construction. The constructor doesn't take any arguments because in the Windows subclass we use a special function to construct a COM object. Subclasses must call super.
 
gfx::NativeViewAccessible GetNativeViewAccessible () override
 
gfx::NativeViewAccessible HitTestSync (int screen_physical_pixel_x, int screen_physical_pixel_y) const override
 
gfx::Rect GetBoundsRect (const ui::AXCoordinateSystem coordinate_system, const ui::AXClippingBehavior clipping_behavior, ui::AXOffscreenResult *offscreen_result) const override
 
virtual void DispatchWinAccessibilityEvent (ax::mojom::Event event_type)
 
void SetFocus ()
 
gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent () override
 
ui::AXPlatformNodeGetPlatformNode () const override
 
- Public Member Functions inherited from flutter::FlutterPlatformNodeDelegate
 FlutterPlatformNodeDelegate ()
 
virtual ~FlutterPlatformNodeDelegate () override
 
const ui::AXUniqueIdGetUniqueId () const override
 
const ui::AXNodeDataGetData () const override
 
bool AccessibilityPerformAction (const ui::AXActionData &data) override
 
gfx::NativeViewAccessible GetParent () override
 
gfx::NativeViewAccessible GetFocus () override
 
int GetChildCount () const override
 
gfx::NativeViewAccessible ChildAtIndex (int index) override
 
gfx::NativeViewAccessible GetLowestPlatformAncestor () const override
 
ui::AXNodePosition::AXPositionInstance CreateTextPositionAt (int offset) const override
 
ui::AXNodeGetAXNode () const
 Gets the underlying ax node for this platform node delegate.
 
std::weak_ptr< OwnerBridgeGetOwnerBridge () const
 Gets the owner of this platform node delegate. This is useful when you want to get the information about surrounding nodes of this platform node delegate, e.g. the global rect of this platform node delegate. This pointer is only safe in the platform thread.
 
virtual ui::AXPlatformNodeGetFromNodeID (int32_t id) override
 
virtual ui::AXPlatformNodeGetFromTreeIDAndNodeID (const ui::AXTreeID &tree_id, int32_t node_id) override
 
virtual const ui::AXTree::Selection GetUnignoredSelection () const override
 
- Public Member Functions inherited from ui::AXPlatformNodeDelegateBase
 AXPlatformNodeDelegateBase ()
 
 ~AXPlatformNodeDelegateBase () override
 
const AXTreeDataGetTreeData () const override
 
std::u16string GetInnerText () const override
 
gfx::NativeViewAccessible GetNSWindow () override
 
int GetIndexInParent () override
 
bool HasModalDialog () const override
 
gfx::NativeViewAccessible GetFirstChild () override
 
gfx::NativeViewAccessible GetLastChild () override
 
gfx::NativeViewAccessible GetNextSibling () override
 
gfx::NativeViewAccessible GetPreviousSibling () override
 
bool IsChildOfLeaf () const override
 
bool IsChildOfPlainTextField () const override
 
bool IsLeaf () const override
 
bool IsToplevelBrowserWindow () override
 
gfx::NativeViewAccessible GetClosestPlatformObject () const override
 
std::unique_ptr< AXPlatformNodeDelegate::ChildIteratorChildrenBegin () override
 
std::unique_ptr< AXPlatformNodeDelegate::ChildIteratorChildrenEnd () override
 
std::string GetName () const override
 
std::u16string GetHypertext () const override
 
bool SetHypertextSelection (int start_offset, int end_offset) override
 
TextAttributeMap ComputeTextAttributeMap (const TextAttributeList &default_attributes) const override
 
std::string GetInheritedFontFamilyName () const override
 
gfx::Rect GetHypertextRangeBoundsRect (const int start_offset, const int end_offset, const AXCoordinateSystem coordinate_system, const AXClippingBehavior clipping_behavior, AXOffscreenResult *offscreen_result) const override
 
gfx::Rect GetInnerTextRangeBoundsRect (const int start_offset, const int end_offset, const AXCoordinateSystem coordinate_system, const AXClippingBehavior clipping_behavior, AXOffscreenResult *offscreen_result) const override
 
gfx::Rect GetClippedScreenBoundsRect (AXOffscreenResult *offscreen_result=nullptr) const override
 
gfx::Rect GetUnclippedScreenBoundsRect (AXOffscreenResult *offscreen_result=nullptr) const
 
bool IsOffscreen () const override
 
bool IsMinimized () const override
 
bool IsText () const override
 
bool IsWebContent () const override
 
bool HasVisibleCaretOrSelection () const override
 
AXPlatformNodeGetTargetNodeForRelation (ax::mojom::IntAttribute attr) override
 
std::vector< AXPlatformNode * > GetTargetNodesForRelation (ax::mojom::IntListAttribute attr) override
 
std::set< AXPlatformNode * > GetReverseRelations (ax::mojom::IntAttribute attr) override
 
std::set< AXPlatformNode * > GetReverseRelations (ax::mojom::IntListAttribute attr) override
 
std::u16string GetAuthorUniqueId () const override
 
std::optional< intFindTextBoundary (ax::mojom::TextBoundary boundary, int offset, ax::mojom::MoveDirection direction, ax::mojom::TextAffinity affinity) const override
 
const std::vector< gfx::NativeViewAccessibleGetUIADescendants () const override
 
std::string GetLanguage () const override
 
bool IsTable () const override
 
std::optional< intGetTableColCount () const override
 
std::optional< intGetTableRowCount () const override
 
std::optional< intGetTableAriaColCount () const override
 
std::optional< intGetTableAriaRowCount () const override
 
std::optional< intGetTableCellCount () const override
 
std::optional< bool > GetTableHasColumnOrRowHeaderNode () const override
 
std::vector< int32_t > GetColHeaderNodeIds () const override
 
std::vector< int32_t > GetColHeaderNodeIds (int col_index) const override
 
std::vector< int32_t > GetRowHeaderNodeIds () const override
 
std::vector< int32_t > GetRowHeaderNodeIds (int row_index) const override
 
AXPlatformNodeGetTableCaption () const override
 
bool IsTableRow () const override
 
std::optional< intGetTableRowRowIndex () const override
 
bool IsTableCellOrHeader () const override
 
std::optional< intGetTableCellIndex () const override
 
std::optional< intGetTableCellColIndex () const override
 
std::optional< intGetTableCellRowIndex () const override
 
std::optional< intGetTableCellColSpan () const override
 
std::optional< intGetTableCellRowSpan () const override
 
std::optional< intGetTableCellAriaColIndex () const override
 
std::optional< intGetTableCellAriaRowIndex () const override
 
std::optional< int32_t > GetCellId (int row_index, int col_index) const override
 
std::optional< int32_t > CellIndexToId (int cell_index) const override
 
bool IsCellOrHeaderOfARIATable () const override
 
bool IsCellOrHeaderOfARIAGrid () const override
 
bool IsOrderedSetItem () const override
 
bool IsOrderedSet () const override
 
std::optional< intGetPosInSet () const override
 
std::optional< intGetSetSize () const override
 
std::u16string GetLocalizedStringForImageAnnotationStatus (ax::mojom::ImageAnnotationStatus status) const override
 
std::u16string GetLocalizedRoleDescriptionForUnlabeledImage () const override
 
std::u16string GetLocalizedStringForLandmarkType () const override
 
std::u16string GetLocalizedStringForRoleDescription () const override
 
std::u16string GetStyleNameAttributeAsLocalizedString () const override
 
bool ShouldIgnoreHoveredStateForTesting () override
 
- Public Member Functions inherited from ui::AXPlatformNodeDelegate
virtual ~AXPlatformNodeDelegate ()=default
 
std::string ToString ()
 
std::string SubtreeToString ()
 

Additional Inherited Members

- Protected Member Functions inherited from ui::AXPlatformNodeDelegateBase
std::string SubtreeToStringHelper (size_t level) override
 
std::set< ui::AXPlatformNode * > GetNodesForNodeIds (const std::set< int32_t > &ids)
 
AXPlatformNodeDelegateGetParentDelegate ()
 
- Protected Member Functions inherited from ui::AXPlatformNodeDelegate
 AXPlatformNodeDelegate ()=default
 

Detailed Description

Definition at line 20 of file flutter_platform_node_delegate_windows.h.

Constructor & Destructor Documentation

◆ FlutterPlatformNodeDelegateWindows()

flutter::FlutterPlatformNodeDelegateWindows::FlutterPlatformNodeDelegateWindows ( std::weak_ptr< AccessibilityBridge bridge,
FlutterWindowsView view 
)

Definition at line 18 of file flutter_platform_node_delegate_windows.cc.

21 : bridge_(bridge), view_(view) {
22 FML_DCHECK(!bridge_.expired())
23 << "Expired AccessibilityBridge passed to node delegate";
24 FML_DCHECK(view_);
25}
#define FML_DCHECK(condition)
Definition logging.h:103

◆ ~FlutterPlatformNodeDelegateWindows()

flutter::FlutterPlatformNodeDelegateWindows::~FlutterPlatformNodeDelegateWindows ( )
virtual

Definition at line 27 of file flutter_platform_node_delegate_windows.cc.

27 {
28 if (ax_platform_node_) {
29 ax_platform_node_->Destroy();
30 }
31}
virtual void Destroy()

Member Function Documentation

◆ DispatchWinAccessibilityEvent()

void flutter::FlutterPlatformNodeDelegateWindows::DispatchWinAccessibilityEvent ( ax::mojom::Event  event_type)
virtual

Definition at line 96 of file flutter_platform_node_delegate_windows.cc.

97 {
98 ax_platform_node_->NotifyAccessibilityEvent(event_type);
99}
ax::mojom::Event event_type
virtual void NotifyAccessibilityEvent(ax::mojom::Event event_type)=0

◆ GetBoundsRect()

gfx::Rect flutter::FlutterPlatformNodeDelegateWindows::GetBoundsRect ( const ui::AXCoordinateSystem  coordinate_system,
const ui::AXClippingBehavior  clipping_behavior,
ui::AXOffscreenResult offscreen_result 
) const
overridevirtual

Reimplemented from flutter::FlutterPlatformNodeDelegate.

Definition at line 82 of file flutter_platform_node_delegate_windows.cc.

85 {
87 coordinate_system, clipping_behavior, offscreen_result);
88 POINT origin{bounds.x(), bounds.y()};
89 POINT extent{bounds.x() + bounds.width(), bounds.y() + bounds.height()};
90 ClientToScreen(view_->GetWindowHandle(), &origin);
91 ClientToScreen(view_->GetWindowHandle(), &extent);
92 return gfx::Rect(origin.x, origin.y, extent.x - origin.x,
93 extent.y - origin.y);
94}
gfx::Rect GetBoundsRect(const ui::AXCoordinateSystem coordinate_system, const ui::AXClippingBehavior clipping_behavior, ui::AXOffscreenResult *offscreen_result) const override
Optional< SkRect > bounds
Definition SkRecords.h:189

◆ GetNativeViewAccessible()

gfx::NativeViewAccessible flutter::FlutterPlatformNodeDelegateWindows::GetNativeViewAccessible ( )
overridevirtual

Reimplemented from ui::AXPlatformNodeDelegateBase.

Definition at line 43 of file flutter_platform_node_delegate_windows.cc.

43 {
44 FML_DCHECK(ax_platform_node_) << "AXPlatformNode hasn't been created";
45 return ax_platform_node_->GetNativeViewAccessible();
46}
virtual gfx::NativeViewAccessible GetNativeViewAccessible()=0

◆ GetPlatformNode()

ui::AXPlatformNode * flutter::FlutterPlatformNodeDelegateWindows::GetPlatformNode ( ) const
overridevirtual

Reimplemented from flutter::FlutterPlatformNodeDelegate.

Definition at line 113 of file flutter_platform_node_delegate_windows.cc.

114 {
115 return ax_platform_node_;
116}

◆ GetTargetForNativeAccessibilityEvent()

gfx::AcceleratedWidget flutter::FlutterPlatformNodeDelegateWindows::GetTargetForNativeAccessibilityEvent ( )
overridevirtual

Reimplemented from ui::AXPlatformNodeDelegateBase.

Definition at line 109 of file flutter_platform_node_delegate_windows.cc.

109 {
110 return view_->GetWindowHandle();
111}

◆ HitTestSync()

gfx::NativeViewAccessible flutter::FlutterPlatformNodeDelegateWindows::HitTestSync ( int  screen_physical_pixel_x,
int  screen_physical_pixel_y 
) const
overridevirtual

Reimplemented from ui::AXPlatformNodeDelegateBase.

Definition at line 49 of file flutter_platform_node_delegate_windows.cc.

51 {
52 // If this node doesn't contain the point, return.
56 gfx::Point screen_point(screen_physical_pixel_x, screen_physical_pixel_y);
57 if (!rect.Contains(screen_point)) {
58 return nullptr;
59 }
60
61 // If any child in this node's subtree contains the point, return that child.
62 auto bridge = bridge_.lock();
63 FML_DCHECK(bridge);
64 for (const ui::AXNode* child : GetAXNode()->children()) {
65 std::shared_ptr<FlutterPlatformNodeDelegateWindows> win_delegate =
66 std::static_pointer_cast<FlutterPlatformNodeDelegateWindows>(
67 bridge->GetFlutterPlatformNodeDelegateFromID(child->id()).lock());
68 FML_DCHECK(win_delegate)
69 << "No FlutterPlatformNodeDelegate found for node " << child->id();
70 auto hit_view = win_delegate->HitTestSync(screen_physical_pixel_x,
71 screen_physical_pixel_y);
72 if (hit_view) {
73 return hit_view;
74 }
75 }
76
77 // If no children contain the point, but this node does, return this node.
78 return ax_platform_node_->GetNativeViewAccessible();
79}
gfx::Rect GetBoundsRect(const ui::AXCoordinateSystem coordinate_system, const ui::AXClippingBehavior clipping_behavior, ui::AXOffscreenResult *offscreen_result) const override
ui::AXNode * GetAXNode() const
Gets the underlying ax node for this platform node delegate.
GAsyncResult * result
sk_sp< SkBlender > blender SkRect rect
Definition SkRecords.h:350

◆ Init()

void flutter::FlutterPlatformNodeDelegateWindows::Init ( std::weak_ptr< OwnerBridge bridge,
ui::AXNode node 
)
overridevirtual

Called only once, immediately after construction. The constructor doesn't take any arguments because in the Windows subclass we use a special function to construct a COM object. Subclasses must call super.

Reimplemented from flutter::FlutterPlatformNodeDelegate.

Definition at line 34 of file flutter_platform_node_delegate_windows.cc.

35 {
37 ax_platform_node_ = ui::AXPlatformNode::Create(this);
38 FML_DCHECK(ax_platform_node_) << "Failed to create AXPlatformNode";
39}
virtual void Init(std::weak_ptr< OwnerBridge > bridge, ui::AXNode *node)
Called only once, immediately after construction. The constructor doesn't take any arguments because ...
static AXPlatformNode * Create(AXPlatformNodeDelegate *delegate)

◆ SetFocus()

void flutter::FlutterPlatformNodeDelegateWindows::SetFocus ( )

Definition at line 101 of file flutter_platform_node_delegate_windows.cc.

101 {
102 VARIANT varchild{};
103 varchild.vt = VT_I4;
104 varchild.lVal = CHILDID_SELF;
105 GetNativeViewAccessible()->accSelect(SELFLAG_TAKEFOCUS, varchild);
106}

The documentation for this class was generated from the following files: