Flutter Engine
The Flutter Engine
ax_relative_bounds.h
Go to the documentation of this file.
1// Copyright 2016 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_RELATIVE_BOUNDS_H_
6#define UI_ACCESSIBILITY_AX_RELATIVE_BOUNDS_H_
7
8#include <cstdint>
9#include <memory>
10#include <ostream>
11
12#include "ax_base_export.h"
13#include "ax_enums.h"
14#include "gfx/geometry/rect_f.h"
15#include "gfx/transform.h"
16
17namespace ui {
18
19// The relative bounding box of an AXNode.
20//
21// This is an efficient, compact, serializable representation of a node's
22// bounding box that requires minimal changes to the tree when layers are
23// moved or scrolled. Computing the absolute bounding box of a node requires
24// walking up the tree and applying node offsets and transforms until reaching
25// the top.
26//
27// If the offset container id is valid, the bounds are relative
28// to the node with that offset container id.
29//
30// Otherwise, for a node other than the root, the bounds are relative to
31// the root of the tree, and for the root of a tree, the bounds are relative
32// to its immediate containing node.
35 virtual ~AXRelativeBounds();
36
38 AXRelativeBounds& operator=(AXRelativeBounds other);
39 bool operator!=(const AXRelativeBounds& other) const;
40 bool operator==(const AXRelativeBounds& other) const;
41
42 std::string ToString() const;
43
44 // The id of an ancestor node in the same AXTree that this object's
45 // bounding box is relative to, or -1 if there's no offset container.
47
48 // The relative bounding box of this node.
50
51 // An additional transform to apply to position this object and its subtree.
52 // NOTE: this member is a std::unique_ptr because it's rare and gfx::Transform
53 // takes up a fair amount of space. The assignment operator and copy
54 // constructor both make a duplicate of the owned pointer, so it acts more
55 // like a member than a pointer.
56 std::unique_ptr<gfx::Transform> transform;
57};
58
59AX_BASE_EXPORT std::ostream& operator<<(std::ostream& stream,
61
62} // namespace ui
63
64#endif // UI_ACCESSIBILITY_AX_RELATIVE_BOUNDS_H_
#define AX_BASE_EXPORT
Optional< SkRect > bounds
Definition: SkRecords.h:189
bool operator==(const AXEventIntent &a, const AXEventIntent &b)
const char * ToString(ax::mojom::Event event)
Definition: ax_enum_util.cc:9
std::ostream & operator<<(std::ostream &os, AXEventGenerator::Event event)
bool operator!=(const AXEventIntent &a, const AXEventIntent &b)
std::unique_ptr< gfx::Transform > transform