• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2015 Google Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
6 * the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 */
16
17syntax = "proto2";
18
19package com.google.android.apps.common.testing.accessibility.framework.uielement.proto;
20
21import "com/google/android/apps/common/testing/accessibility/framework/uielement/AndroidFramework.proto";
22
23option java_package = "com.google.android.apps.common.testing.accessibility.framework.uielement.proto";
24option java_outer_classname = "AccessibilityHierarchyProtos";
25
26// Wire format for an AccessibilityHierarchy
27// Next index: 6
28message AccessibilityHierarchyProto {
29  optional DeviceStateProto device_state = 1;
30  repeated WindowHierarchyElementProto windows = 2;
31  optional int32 active_window_id = 3 [default = -1];
32  optional ViewElementClassNamesProto view_element_class_names = 4;
33  optional AccessibilityHierarchyOriginProto origin = 5;
34}
35
36// Wire format for ViewElementClassNames
37// Next index: 2
38message ViewElementClassNamesProto {
39  map<string, int32> class_name = 1;
40}
41
42// Wire format for a DeviceState
43// Next index: 6
44message DeviceStateProto {
45  optional DisplayInfoProto default_display_info = 1;
46  optional int32 sdk_version = 2;
47
48  // An IETF BCP 47 language tag representing the locale at the time the app
49  // was launched.
50  optional string locale = 3;
51  optional float font_scale = 4;
52  optional bool feature_watch = 5;
53}
54
55// Wire format for a DisplayInfo
56// Next index = 3;
57message DisplayInfoProto {
58  optional DisplayInfoMetricsProto metrics_without_decoration = 1;
59  optional DisplayInfoMetricsProto real_metrics = 2;
60}
61
62// Wire format for a DisplayInfo.Metrics
63// Next index: 8
64message DisplayInfoMetricsProto {
65  optional float density = 1;
66  optional float scaled_density = 2;
67  optional float x_dpi = 3;
68  optional float y_dpi = 4;
69  optional int32 density_dpi = 5;
70  optional int32 height_pixels = 6;
71  optional int32 width_pixels = 7;
72}
73
74// Wire format for a WindowHierarchyElement
75// Next index: 12
76message WindowHierarchyElementProto {
77  // Bookkeeping
78  optional int32 id = 1 [default = -1];
79  optional int32 parent_id = 2 [default = -1];
80  repeated int32 child_ids = 3;
81  repeated ViewHierarchyElementProto views = 4;
82
83  // Window properties
84  optional int32 window_id = 5;
85  optional int32 layer = 6;
86  optional int32 type = 7;
87  optional bool focused = 8;
88  optional bool accessibility_focused = 9;
89  optional bool active = 10;
90  optional RectProto bounds_in_screen = 11;
91}
92
93// Wire format for a ViewHierarchyElement
94// Next index: 45
95message ViewHierarchyElementProto {
96  // Bookkeeping
97  optional int32 id = 1 [default = -1];
98  optional int32 parent_id = 2 [default = -1];
99  repeated int32 child_ids = 3;
100
101  // View properties
102  optional string package_name = 4;
103  optional string class_name = 5;
104  optional string resource_name = 6;
105  optional string test_tag = 44;
106  optional CharSequenceProto content_description = 7;
107  optional CharSequenceProto text = 8;
108  optional CharSequenceProto state_description = 43;
109  optional bool important_for_accessibility = 9;
110  optional bool visible_to_user = 10;
111  optional bool clickable = 11;
112  optional bool long_clickable = 12;
113  optional bool focusable = 13;
114  optional bool editable = 14;
115  optional bool scrollable = 15;
116  optional bool can_scroll_forward = 16;
117  optional bool can_scroll_backward = 17;
118  optional bool checkable = 18;
119  optional bool has_touch_delegate = 19;
120  optional RectProto bounds_in_screen = 20;
121  optional float text_size = 21;
122  optional int32 text_color = 22;
123  optional int32 background_drawable_color = 23;
124  optional int32 typeface_style = 24;
125  optional bool enabled = 25;
126  optional int64 labeled_by_id = 26;
127  optional int32 nonclipped_height = 27;
128  optional int32 nonclipped_width = 28;
129  optional bool checked = 29;
130  optional string accessibility_class_name = 30;
131  optional int64 accessibility_traversal_before_id = 31;
132  optional int64 accessibility_traversal_after_id = 32;
133
134  // Integers that identify class names in ViewElementClassNamesProto
135  repeated int32 superclasses = 33;
136  optional int32 drawing_order = 34;
137  repeated RectProto touch_delegate_bounds = 35;
138
139  // Accessibility actions exposed by the view.
140  repeated ViewHierarchyActionProto actions = 36;
141  optional LayoutParamsProto layout_params = 37;
142  optional CharSequenceProto hint_text = 38;
143  optional int32 hint_text_color = 39;
144  repeated RectProto text_character_locations = 40;
145  optional int32 text_size_unit = 41;
146  optional bool screen_reader_focusable = 42;
147}
148
149// Wire format for a ViewHierarchyAction
150// Next index: 3
151message ViewHierarchyActionProto {
152  optional int32 action_id = 1;
153  optional string action_label = 2;
154}
155
156// Original data source from which the AccessibilityHierarchy was constructed.
157// Next index: 5
158enum AccessibilityHierarchyOriginProto {
159  ORIGIN_UNSPECIFIED = 0;
160  ORIGIN_VIEWS = 1;
161  ORIGIN_ACCESSIBILITY_NODE_INFOS = 2;
162  ORIGIN_ACCESSIBILITY_NODE_INFOS_AND_VIEWS = 4;
163  ORIGIN_WINDOW_LIST = 3;
164}
165