1/* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of 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, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17syntax = "proto2"; 18 19package perfetto.protos; 20 21// Represents a {@link android.view.inputmethod.InputConnection} object 22message InputConnectionProto { 23 // string editable_text 24 reserved 1; 25 // string selected_text 26 reserved 2; 27 optional int32 selected_text_start = 3; 28 optional int32 selected_text_end = 4; 29 optional int32 cursor_caps_mode = 5; 30} 31 32// Shows information about parameters and result for method calls to 33// {@link android.view.inputmethod.InputConnection} 34message InputConnectionCallProto { 35 oneof method_call { 36 GetTextBeforeCursor get_text_before_cursor = 1; 37 GetTextAfterCursor get_text_after_cursor = 2; 38 GetSelectedText get_selected_text = 3; 39 GetSurroundingText get_surrounding_text = 4; 40 GetCursorCapsMode get_cursor_caps_mode = 5; 41 GetExtractedText get_extracted_text = 6; 42 } 43 44 message GetTextBeforeCursor { 45 optional int32 length = 1; 46 optional int32 flags = 2; 47 // string result 48 reserved 3; 49 } 50 51 message GetTextAfterCursor { 52 optional int32 length = 1; 53 optional int32 flags = 2; 54 // string result 55 reserved 3; 56 } 57 58 message GetSelectedText { 59 optional int32 flags = 1; 60 // string result 61 reserved 2; 62 } 63 64 message GetSurroundingText { 65 optional int32 before_length = 1; 66 optional int32 after_length = 2; 67 optional int32 flags = 3; 68 optional SurroundingText result = 4; 69 70 message SurroundingText { 71 // string text 72 reserved 1; 73 optional int32 selection_start = 2; 74 optional int32 selection_end = 3; 75 optional int32 offset = 4; 76 } 77 } 78 79 message GetCursorCapsMode { 80 optional int32 req_modes = 1; 81 optional int32 result = 2; 82 } 83 84 message GetExtractedText { 85 optional ExtractedTextRequest request = 1; 86 optional int32 flags = 2; 87 // string result 88 reserved 3; 89 90 message ExtractedTextRequest { 91 optional int32 token = 1; 92 optional int32 flags = 2; 93 optional int32 hint_max_lines = 3; 94 optional int32 hint_max_chars = 4; 95 } 96 } 97}