| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library fuchsia.accessibility.semantics; |
| |
| using fuchsia.ui.gfx; |
| |
| // TODO(SCN-814) Figure out how we want to serialize data. |
| |
| /// Represents the purpose of a ui element; ex. button, text area. |
| /// Currently not being used. Will be expanded in the future. |
| enum Role { |
| NONE = 0; |
| }; |
| |
| /// Represents actions that can be applied to Nodes. |
| enum Action { |
| GAIN_ACCESSIBILITY_FOCUS = 1; |
| LOSE_ACCESSIBILITY_FOCUS = 2; |
| TAP = 3; |
| }; |
| |
| /// Accessibility data for an UI element. |
| table Data { |
| 1: Role role; |
| 2: string label; |
| // Local bounding box of this element. |
| 3: fuchsia.ui.gfx.BoundingBox location; |
| // Transform from parent coordinate space to local space. |
| 4: fuchsia.ui.gfx.mat4 transform; |
| }; |
| |
| // Wrapper for accessibility data to store structure of UI tree. In progress. |
| table Node { |
| // Node id identifying position in a front-end's local UI structure. |
| // We assume 0 to be the root node. |
| 1: uint32 node_id; |
| 2: vector<uint32> children_traversal_order; |
| 3: vector<uint32> children_hit_test_order; |
| 4: Data data; |
| }; |