1/* 2 * Copyright (C) 2020 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 19import "frameworks/base/core/proto/android/privacy.proto"; 20 21package android.view.inputmethod; 22 23option java_multiple_files = true; 24 25/** 26 * Represents a {@link android.view.inputmethod.InputConnection} object. 27 */ 28message InputConnectionProto { 29 optional string editable_text = 1 [(.android.privacy).dest = DEST_LOCAL]; 30 optional string selected_text = 2 [(.android.privacy).dest = DEST_LOCAL]; 31 optional int32 selected_text_start = 3; 32 optional int32 selected_text_end = 4; 33 optional int32 cursor_caps_mode = 5; 34} 35 36/** 37 * Shows information about parameters and result for method calls to 38 * {@link android.view.inputmethod.InputConnection}. 39 */ 40message InputConnectionCallProto { 41 oneof method_call { 42 GetTextBeforeCursor get_text_before_cursor = 1; 43 GetTextAfterCursor get_text_after_cursor = 2; 44 GetSelectedText get_selected_text = 3; 45 GetSurroundingText get_surrounding_text = 4; 46 GetCursorCapsMode get_cursor_caps_mode = 5; 47 GetExtractedText get_extracted_text = 6; 48 } 49 50 message GetTextBeforeCursor { 51 optional int32 length = 1; 52 optional int32 flags = 2; 53 optional string result = 3 [(.android.privacy).dest = DEST_LOCAL]; 54 } 55 56 message GetTextAfterCursor { 57 optional int32 length = 1; 58 optional int32 flags = 2; 59 optional string result = 3 [(.android.privacy).dest = DEST_LOCAL]; 60 } 61 62 message GetSelectedText { 63 optional int32 flags = 1; 64 optional string result = 2 [(.android.privacy).dest = DEST_LOCAL]; 65 } 66 67 message GetSurroundingText { 68 optional int32 before_length = 1; 69 optional int32 after_length = 2; 70 optional int32 flags = 3; 71 optional SurroundingText result = 4; 72 73 message SurroundingText { 74 optional string text = 1 [(.android.privacy).dest = DEST_LOCAL]; 75 optional int32 selection_start = 2; 76 optional int32 selection_end = 3; 77 optional int32 offset = 4; 78 } 79 } 80 81 message GetCursorCapsMode { 82 optional int32 req_modes = 1; 83 optional int32 result = 2; 84 } 85 86 message GetExtractedText { 87 optional ExtractedTextRequest request = 1; 88 optional int32 flags = 2; 89 optional string result = 3 [(.android.privacy).dest = DEST_LOCAL]; 90 91 message ExtractedTextRequest { 92 optional int32 token = 1; 93 optional int32 flags = 2; 94 optional int32 hint_max_lines = 3; 95 optional int32 hint_max_chars = 4; 96 } 97 } 98}