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; 22 import android.view.inputmethod.ExtractedTextRequest; 23 24 import com.android.internal.view.IInputContextCallback; 25 26 /** 27 * Interface from an input method to the application, allowing it to perform 28 * edits on the current input field and other interactions with the application. 29 * {@hide} 30 */ 31 oneway interface IInputContext { getTextBeforeCursor(int length, int flags, int seq, IInputContextCallback callback)32 void getTextBeforeCursor(int length, int flags, int seq, IInputContextCallback callback); 33 getTextAfterCursor(int length, int flags, int seq, IInputContextCallback callback)34 void getTextAfterCursor(int length, int flags, int seq, IInputContextCallback callback); 35 getCursorCapsMode(int reqModes, int seq, IInputContextCallback callback)36 void getCursorCapsMode(int reqModes, int seq, IInputContextCallback callback); 37 getExtractedText(in ExtractedTextRequest request, int flags, int seq, IInputContextCallback callback)38 void getExtractedText(in ExtractedTextRequest request, int flags, int seq, 39 IInputContextCallback callback); 40 deleteSurroundingText(int leftLength, int rightLength)41 void deleteSurroundingText(int leftLength, int rightLength); 42 setComposingText(CharSequence text, int newCursorPosition)43 void setComposingText(CharSequence text, int newCursorPosition); 44 finishComposingText()45 void finishComposingText(); 46 commitText(CharSequence text, int newCursorPosition)47 void commitText(CharSequence text, int newCursorPosition); 48 commitCompletion(in CompletionInfo completion)49 void commitCompletion(in CompletionInfo completion); 50 setSelection(int start, int end)51 void setSelection(int start, int end); 52 performEditorAction(int actionCode)53 void performEditorAction(int actionCode); 54 performContextMenuAction(int id)55 void performContextMenuAction(int id); 56 beginBatchEdit()57 void beginBatchEdit(); 58 endBatchEdit()59 void endBatchEdit(); 60 reportFullscreenMode(boolean enabled)61 void reportFullscreenMode(boolean enabled); 62 sendKeyEvent(in KeyEvent event)63 void sendKeyEvent(in KeyEvent event); 64 clearMetaKeyStates(int states)65 void clearMetaKeyStates(int states); 66 performPrivateCommand(String action, in Bundle data)67 void performPrivateCommand(String action, in Bundle data); 68 setComposingRegion(int start, int end)69 void setComposingRegion(int start, int end); 70 getSelectedText(int flags, int seq, IInputContextCallback callback)71 void getSelectedText(int flags, int seq, IInputContextCallback callback); 72 } 73