blob: fdc6a2e4bb7a37948e9cd60c99faa04105a292dc [file] [log] [blame]
// Copyright 2018 The Feed Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto2";
import "src/main/proto/search/now/ui/piet/binding_refs.proto";
import "src/main/proto/search/now/ui/piet/text.proto";
package search.now.ui.piet;
option optimize_for=LITE_RUNTIME;
option java_package = "com.google.search.now.ui.piet";
option java_outer_classname = "AccessibilityProto";
option cc_enable_arenas = true;
// Defines accessibility related attributes for Piet elements.
message Accessibility {
oneof description_data {
// A string that may be spoken by the system. (TalkBack on Android,
// VoiceOver on iOS, browser on Web)
ParameterizedText description = 1;
// In case this is coming from a template.
ParameterizedTextBindingRef description_binding = 3;
}
// Roles that this UI element plays in the UI. These annotations will be used
// by the accessibility framework for applying role-specific treatments.
repeated AccessibilityRole roles = 2;
oneof accessibility_id_data {
// A string that uniquely identifies this UI element. This is used by
// automated UI testing frameworks. The identifier's scope is determined by
// the test framework, which typically allows searching by identifier across
// an element type or within a container.
// NOTE: parameters are not supported for accessibility_id. Only the 'text'
// field should be used to specify the identifier.
ParameterizedText accessibility_id = 4;
// ID coming from a template.
ParameterizedTextBindingRef accessibility_id_binding = 5;
}
oneof context_data {
// A string that may be spoken by the system that describes the result of an
// action. For example, "Opens the article." This provides additional
// context over the description.
// NOTE: Only supported by iOS and maps to accessibilityHint on an
// accessible element.
ParameterizedText context = 6;
// In case this is coming from a template.
ParameterizedTextBindingRef context_binding = 7;
}
}
// Semantic roles played by a UI element related to accessibility.
enum AccessibilityRole {
// No special role. The default value, maps to 0.
ACCESSIBILITY_ROLE_UNSPECIFIED = 0;
// Indicates that the UI element is a list containing other elements.
LIST = 1;
// Indicates that the UI element is a header for a section.
HEADER = 2;
}