OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 // Next MinVersion: 1 |
| 6 |
| 7 module arc.mojom; |
| 8 |
| 9 import "mojo/common/string16.mojom"; |
| 10 import "screen_rect.mojom"; |
| 11 |
| 12 // Represents the start and end unicode char indices of the selected |
| 13 // portion of the text [start, end). |
| 14 struct TextSelection { |
| 15 int32 start_selection; |
| 16 int32 end_selection; |
| 17 }; |
| 18 |
| 19 // Represents view structure to be passed to ARC. The view |
| 20 // structure is synthesized from the AXStructure, which |
| 21 // is a simplified representation of the DOM tree. We |
| 22 // map each node of the AXStructure into a view element. |
| 23 // The naming convention of the fields kept consistent with |
| 24 // AccessibilitySnapshotNode.java used in Android Chromium. |
| 25 struct VoiceInteractionStructure { |
| 26 // Geometry of the view in pixels |
| 27 ScreenRect rect; |
| 28 |
| 29 // Text of the view. |
| 30 mojo.common.mojom.String16 text; |
| 31 |
| 32 // Text properties |
| 33 float text_size; |
| 34 int32 color; |
| 35 int32 bgcolor; |
| 36 bool bold; |
| 37 bool italic; |
| 38 bool underline; |
| 39 bool line_through; |
| 40 |
| 41 // Selected portion of the text. |
| 42 TextSelection? selection; |
| 43 |
| 44 // Fake Android view class name of the element. Each node is assigned |
| 45 // a closest approximation of Android's views. |
| 46 string class_name; |
| 47 |
| 48 // Children of current node |
| 49 array<VoiceInteractionStructure> children; |
| 50 }; |
| 51 |
| 52 // Handles voice interaction queries from Android. |
| 53 // Next method ID: 1 |
| 54 interface VoiceInteractionArcHomeHost { |
| 55 // Returns view hierarchy of current window represented as |
| 56 // VoiceInteractionStructure. Returns empty if the request |
| 57 // fails. |
| 58 GetVoiceInteractionStructure@1() => (VoiceInteractionStructure? structure); |
| 59 }; |
| 60 |
| 61 // Connects with ArcHome. |
| 62 // Next method ID: 1 |
| 63 interface VoiceInteractionArcHomeInstance { |
| 64 Init@0(VoiceInteractionArcHomeHost host_ptr); |
| 65 }; |
OLD | NEW |