1 /*
2  * Copyright (C) 2022 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 
17 package com.android.internal.inputmethod;
18 
19 import android.view.KeyEvent;
20 import android.view.inputmethod.TextAttribute;
21 
22 import com.android.internal.infra.AndroidFuture;
23 import com.android.internal.inputmethod.InputConnectionCommandHeader;
24 
25 /**
26  * Interface from A11y IMEs to the application, allowing it to perform edits on the current input
27  * field and other interactions with the application.
28  */
29 oneway interface IRemoteAccessibilityInputConnection {
commitText(in InputConnectionCommandHeader header, CharSequence text, int newCursorPosition, in TextAttribute textAttribute)30     void commitText(in InputConnectionCommandHeader header, CharSequence text,
31             int newCursorPosition, in TextAttribute textAttribute);
32 
setSelection(in InputConnectionCommandHeader header, int start, int end)33     void setSelection(in InputConnectionCommandHeader header, int start, int end);
34 
getSurroundingText(in InputConnectionCommandHeader header, int beforeLength, int afterLength, int flags, in AndroidFuture future )35     void getSurroundingText(in InputConnectionCommandHeader header, int beforeLength,
36             int afterLength, int flags, in AndroidFuture future /* T=SurroundingText */);
37 
deleteSurroundingText(in InputConnectionCommandHeader header, int beforeLength, int afterLength)38     void deleteSurroundingText(in InputConnectionCommandHeader header, int beforeLength,
39             int afterLength);
40 
sendKeyEvent(in InputConnectionCommandHeader header, in KeyEvent event)41     void sendKeyEvent(in InputConnectionCommandHeader header, in KeyEvent event);
42 
performEditorAction(in InputConnectionCommandHeader header, int actionCode)43     void performEditorAction(in InputConnectionCommandHeader header, int actionCode);
44 
performContextMenuAction(in InputConnectionCommandHeader header, int id)45     void performContextMenuAction(in InputConnectionCommandHeader header, int id);
46 
getCursorCapsMode(in InputConnectionCommandHeader header, int reqModes, in AndroidFuture future )47     void getCursorCapsMode(in InputConnectionCommandHeader header, int reqModes,
48             in AndroidFuture future /* T=Integer */);
49 
clearMetaKeyStates(in InputConnectionCommandHeader header, int states)50     void clearMetaKeyStates(in InputConnectionCommandHeader header, int states);
51 }
52