The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.internal.view; |
| 18 | |
| 19 | import android.os.Bundle; |
Yohei Yukawa | e77386e | 2018-01-23 10:39:32 -0800 | [diff] [blame] | 20 | import android.os.LocaleList; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 21 | import android.view.KeyEvent; |
| 22 | import android.view.inputmethod.CompletionInfo; |
Gilles Debunne | cf9cf2f | 2010-12-08 17:43:58 -0800 | [diff] [blame] | 23 | import android.view.inputmethod.CorrectionInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 24 | import android.view.inputmethod.ExtractedTextRequest; |
Yohei Yukawa | 152944f | 2016-06-10 19:04:34 -0700 | [diff] [blame] | 25 | import android.view.inputmethod.InputContentInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 26 | |
| 27 | import com.android.internal.view.IInputContextCallback; |
| 28 | |
| 29 | /** |
| 30 | * Interface from an input method to the application, allowing it to perform |
| 31 | * edits on the current input field and other interactions with the application. |
| 32 | * {@hide} |
| 33 | */ |
| 34 | oneway interface IInputContext { |
| 35 | void getTextBeforeCursor(int length, int flags, int seq, IInputContextCallback callback); |
| 36 | |
| 37 | void getTextAfterCursor(int length, int flags, int seq, IInputContextCallback callback); |
| 38 | |
| 39 | void getCursorCapsMode(int reqModes, int seq, IInputContextCallback callback); |
| 40 | |
| 41 | void getExtractedText(in ExtractedTextRequest request, int flags, int seq, |
| 42 | IInputContextCallback callback); |
Yohei Yukawa | c89e22a | 2016-01-13 22:48:14 -0800 | [diff] [blame] | 43 | |
| 44 | void deleteSurroundingText(int beforeLength, int afterLength); |
| 45 | void deleteSurroundingTextInCodePoints(int beforeLength, int afterLength); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 46 | |
| 47 | void setComposingText(CharSequence text, int newCursorPosition); |
| 48 | |
| 49 | void finishComposingText(); |
| 50 | |
| 51 | void commitText(CharSequence text, int newCursorPosition); |
| 52 | |
| 53 | void commitCompletion(in CompletionInfo completion); |
| 54 | |
Gilles Debunne | cf9cf2f | 2010-12-08 17:43:58 -0800 | [diff] [blame] | 55 | void commitCorrection(in CorrectionInfo correction); |
| 56 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | void setSelection(int start, int end); |
| 58 | |
| 59 | void performEditorAction(int actionCode); |
| 60 | |
| 61 | void performContextMenuAction(int id); |
| 62 | |
| 63 | void beginBatchEdit(); |
| 64 | |
| 65 | void endBatchEdit(); |
Yohei Yukawa | 2bc6617 | 2017-02-08 11:13:25 -0800 | [diff] [blame] | 66 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 67 | void sendKeyEvent(in KeyEvent event); |
| 68 | |
| 69 | void clearMetaKeyStates(int states); |
| 70 | |
| 71 | void performPrivateCommand(String action, in Bundle data); |
Amith Yamasani | a90b7f0 | 2010-08-25 18:27:20 -0700 | [diff] [blame] | 72 | |
| 73 | void setComposingRegion(int start, int end); |
| 74 | |
| 75 | void getSelectedText(int flags, int seq, IInputContextCallback callback); |
satok | adb4358 | 2011-03-09 10:08:47 +0900 | [diff] [blame] | 76 | |
Yohei Yukawa | 152944f | 2016-06-10 19:04:34 -0700 | [diff] [blame] | 77 | void requestUpdateCursorAnchorInfo(int cursorUpdateMode, int seq, |
| 78 | IInputContextCallback callback); |
| 79 | |
Yohei Yukawa | 45700fa | 2016-06-23 17:12:59 -0700 | [diff] [blame] | 80 | void commitContent(in InputContentInfo inputContentInfo, int flags, in Bundle opts, int sec, |
Yohei Yukawa | 0023d0e | 2014-07-11 04:13:03 +0900 | [diff] [blame] | 81 | IInputContextCallback callback); |
Yohei Yukawa | e77386e | 2018-01-23 10:39:32 -0800 | [diff] [blame] | 82 | |
| 83 | void reportLanguageHint(in LocaleList languageHint); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 84 | } |