blob: c22799179b72ebb7ee023142ba08e978eabe4641 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2008 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
17package com.android.internal.view;
18
19import android.os.Bundle;
20import android.view.KeyEvent;
21import android.view.inputmethod.CompletionInfo;
Gilles Debunnecf9cf2f2010-12-08 17:43:58 -080022import android.view.inputmethod.CorrectionInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023import android.view.inputmethod.ExtractedTextRequest;
Yohei Yukawa152944f2016-06-10 19:04:34 -070024import android.view.inputmethod.InputContentInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025
26import com.android.internal.view.IInputContextCallback;
27
28/**
29 * Interface from an input method to the application, allowing it to perform
30 * edits on the current input field and other interactions with the application.
31 * {@hide}
32 */
33 oneway interface IInputContext {
34 void getTextBeforeCursor(int length, int flags, int seq, IInputContextCallback callback);
35
36 void getTextAfterCursor(int length, int flags, int seq, IInputContextCallback callback);
37
38 void getCursorCapsMode(int reqModes, int seq, IInputContextCallback callback);
39
40 void getExtractedText(in ExtractedTextRequest request, int flags, int seq,
41 IInputContextCallback callback);
Yohei Yukawac89e22a2016-01-13 22:48:14 -080042
43 void deleteSurroundingText(int beforeLength, int afterLength);
44 void deleteSurroundingTextInCodePoints(int beforeLength, int afterLength);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080045
46 void setComposingText(CharSequence text, int newCursorPosition);
47
48 void finishComposingText();
49
50 void commitText(CharSequence text, int newCursorPosition);
51
52 void commitCompletion(in CompletionInfo completion);
53
Gilles Debunnecf9cf2f2010-12-08 17:43:58 -080054 void commitCorrection(in CorrectionInfo correction);
55
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056 void setSelection(int start, int end);
57
58 void performEditorAction(int actionCode);
59
60 void performContextMenuAction(int id);
61
62 void beginBatchEdit();
63
64 void endBatchEdit();
Yohei Yukawa2bc66172017-02-08 11:13:25 -080065
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080066 void sendKeyEvent(in KeyEvent event);
67
68 void clearMetaKeyStates(int states);
69
70 void performPrivateCommand(String action, in Bundle data);
Amith Yamasania90b7f02010-08-25 18:27:20 -070071
72 void setComposingRegion(int start, int end);
73
74 void getSelectedText(int flags, int seq, IInputContextCallback callback);
satokadb43582011-03-09 10:08:47 +090075
Yohei Yukawa152944f2016-06-10 19:04:34 -070076 void requestUpdateCursorAnchorInfo(int cursorUpdateMode, int seq,
77 IInputContextCallback callback);
78
Yohei Yukawa45700fa2016-06-23 17:12:59 -070079 void commitContent(in InputContentInfo inputContentInfo, int flags, in Bundle opts, int sec,
Yohei Yukawa0023d0e2014-07-11 04:13:03 +090080 IInputContextCallback callback);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080081}