Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
ax_tree_manager.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_AX_TREE_MANAGER_H_
6#define UI_ACCESSIBILITY_AX_TREE_MANAGER_H_
7
8#include "ax_export.h"
9#include "ax_node.h"
10#include "ax_tree.h"
11#include "ax_tree_id.h"
12
13namespace ui {
14
15// Abstract interface for a class that owns an AXTree and manages its
16// connections to other AXTrees in the same page or desktop (parent and child
17// trees).
19 public:
20 virtual ~AXTreeManager() = default;
21
22 // Returns the AXNode with the given |node_id| from the tree that has the
23 // given |tree_id|. This allows for callers to access nodes outside of their
24 // own tree. Returns nullptr if |tree_id| or |node_id| is not found.
25 virtual AXNode* GetNodeFromTree(const AXTreeID tree_id,
26 const AXNode::AXID node_id) const = 0;
27
28 // Returns the AXNode in the current tree that has the given |node_id|.
29 // Returns nullptr if |node_id| is not found.
30 virtual AXNode* GetNodeFromTree(const AXNode::AXID node_id) const = 0;
31
32 // Returns the tree id of the tree managed by this AXTreeManager.
33 virtual AXTreeID GetTreeID() const = 0;
34
35 // Returns the tree id of the parent tree.
36 // Returns AXTreeIDUnknown if this tree doesn't have a parent tree.
37 virtual AXTreeID GetParentTreeID() const = 0;
38
39 // Returns the AXNode that is at the root of the current tree.
40 virtual AXNode* GetRootAsAXNode() const = 0;
41
42 // If this tree has a parent tree, returns the node in the parent tree that
43 // hosts the current tree. Returns nullptr if this tree doesn't have a parent
44 // tree.
46
47 virtual AXTree* GetTree() const = 0;
48};
49
50} // namespace ui
51
52#endif // UI_ACCESSIBILITY_AX_TREE_MANAGER_H_
#define AX_EXPORT
Definition ax_export.h:29
int32_t AXID
Definition ax_node.h:36
virtual AXNode * GetNodeFromTree(const AXTreeID tree_id, const AXNode::AXID node_id) const =0
virtual AXTreeID GetParentTreeID() const =0
virtual AXNode * GetParentNodeFromParentTreeAsAXNode() const =0
virtual ~AXTreeManager()=default
virtual AXTreeID GetTreeID() const =0
virtual AXTree * GetTree() const =0
virtual AXNode * GetNodeFromTree(const AXNode::AXID node_id) const =0
virtual AXNode * GetRootAsAXNode() const =0