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 17package com.android.internal.view; 18 19import android.os.ResultReceiver; 20import android.text.style.SuggestionSpan; 21import android.view.inputmethod.InputMethodInfo; 22import android.view.inputmethod.InputMethodSubtype; 23import android.view.inputmethod.EditorInfo; 24import com.android.internal.view.InputBindResult; 25import com.android.internal.view.IInputContext; 26import com.android.internal.view.IInputMethodClient; 27 28/** 29 * Public interface to the global input method manager, used by all client 30 * applications. 31 * You need to update BridgeIInputMethodManager.java as well when changing 32 * this file. 33 */ 34interface IInputMethodManager { 35 List<InputMethodInfo> getInputMethodList(); 36 List<InputMethodInfo> getEnabledInputMethodList(); 37 List<InputMethodSubtype> getEnabledInputMethodSubtypeList(in String imiId, 38 boolean allowsImplicitlySelectedSubtypes); 39 InputMethodSubtype getLastInputMethodSubtype(); 40 // TODO: We should change the return type from List to List<Parcelable> 41 // Currently there is a bug that aidl doesn't accept List<Parcelable> 42 List getShortcutInputMethodsAndSubtypes(); 43 void addClient(in IInputMethodClient client, 44 in IInputContext inputContext, int uid, int pid); 45 void removeClient(in IInputMethodClient client); 46 47 InputBindResult startInput(in IInputMethodClient client, 48 IInputContext inputContext, in EditorInfo attribute, int controlFlags); 49 void finishInput(in IInputMethodClient client); 50 boolean showSoftInput(in IInputMethodClient client, int flags, 51 in ResultReceiver resultReceiver); 52 boolean hideSoftInput(in IInputMethodClient client, int flags, 53 in ResultReceiver resultReceiver); 54 // Report that a window has gained focus. If 'attribute' is non-null, 55 // this will also do a startInput. 56 InputBindResult windowGainedFocus(in IInputMethodClient client, in IBinder windowToken, 57 int controlFlags, int softInputMode, int windowFlags, 58 in EditorInfo attribute, IInputContext inputContext); 59 60 void showInputMethodPickerFromClient(in IInputMethodClient client); 61 void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId); 62 void setInputMethod(in IBinder token, String id); 63 void setInputMethodAndSubtype(in IBinder token, String id, in InputMethodSubtype subtype); 64 void hideMySoftInput(in IBinder token, int flags); 65 void showMySoftInput(in IBinder token, int flags); 66 void updateStatusIcon(in IBinder token, String packageName, int iconId); 67 void setImeWindowStatus(in IBinder token, int vis, int backDisposition); 68 void registerSuggestionSpansForNotification(in SuggestionSpan[] spans); 69 boolean notifySuggestionPicked(in SuggestionSpan span, String originalString, int index); 70 InputMethodSubtype getCurrentInputMethodSubtype(); 71 boolean setCurrentInputMethodSubtype(in InputMethodSubtype subtype); 72 boolean switchToLastInputMethod(in IBinder token); 73 boolean switchToNextInputMethod(in IBinder token, boolean onlyCurrentIme); 74 boolean shouldOfferSwitchingToNextInputMethod(in IBinder token); 75 boolean setInputMethodEnabled(String id, boolean enabled); 76 oneway void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes); 77} 78