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; |
| 20 | import android.view.KeyEvent; |
| 21 | import android.view.inputmethod.CompletionInfo; |
Gilles Debunne | cf9cf2f | 2010-12-08 17:43:58 -0800 | [diff] [blame] | 22 | import android.view.inputmethod.CorrectionInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 23 | import android.view.inputmethod.ExtractedTextRequest; |
| 24 | |
| 25 | import com.android.internal.view.IInputContextCallback; |
| 26 | |
| 27 | /** |
| 28 | * Interface from an input method to the application, allowing it to perform |
| 29 | * edits on the current input field and other interactions with the application. |
| 30 | * {@hide} |
| 31 | */ |
| 32 | oneway interface IInputContext { |
| 33 | void getTextBeforeCursor(int length, int flags, int seq, IInputContextCallback callback); |
| 34 | |
| 35 | void getTextAfterCursor(int length, int flags, int seq, IInputContextCallback callback); |
| 36 | |
| 37 | void getCursorCapsMode(int reqModes, int seq, IInputContextCallback callback); |
| 38 | |
| 39 | void getExtractedText(in ExtractedTextRequest request, int flags, int seq, |
| 40 | IInputContextCallback callback); |
| 41 | |
| 42 | void deleteSurroundingText(int leftLength, int rightLength); |
| 43 | |
| 44 | void setComposingText(CharSequence text, int newCursorPosition); |
| 45 | |
| 46 | void finishComposingText(); |
| 47 | |
| 48 | void commitText(CharSequence text, int newCursorPosition); |
| 49 | |
| 50 | void commitCompletion(in CompletionInfo completion); |
| 51 | |
Gilles Debunne | cf9cf2f | 2010-12-08 17:43:58 -0800 | [diff] [blame] | 52 | void commitCorrection(in CorrectionInfo correction); |
| 53 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 54 | void setSelection(int start, int end); |
| 55 | |
| 56 | void performEditorAction(int actionCode); |
| 57 | |
| 58 | void performContextMenuAction(int id); |
| 59 | |
| 60 | void beginBatchEdit(); |
| 61 | |
| 62 | void endBatchEdit(); |
| 63 | |
| 64 | void reportFullscreenMode(boolean enabled); |
| 65 | |
| 66 | void sendKeyEvent(in KeyEvent event); |
| 67 | |
| 68 | void clearMetaKeyStates(int states); |
| 69 | |
| 70 | void performPrivateCommand(String action, in Bundle data); |
Amith Yamasani | a90b7f0 | 2010-08-25 18:27:20 -0700 | [diff] [blame] | 71 | |
| 72 | void setComposingRegion(int start, int end); |
| 73 | |
| 74 | void getSelectedText(int flags, int seq, IInputContextCallback callback); |
satok | adb4358 | 2011-03-09 10:08:47 +0900 | [diff] [blame] | 75 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 76 | } |