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.net.Uri; 20 import android.os.ResultReceiver; 21 import android.text.style.SuggestionSpan; 22 import android.view.inputmethod.InputMethodInfo; 23 import android.view.inputmethod.InputMethodSubtype; 24 import android.view.inputmethod.EditorInfo; 25 import com.android.internal.inputmethod.IInputContentUriToken; 26 import com.android.internal.view.InputBindResult; 27 import com.android.internal.view.IInputContext; 28 import com.android.internal.view.IInputMethodClient; 29 30 /** 31 * Public interface to the global input method manager, used by all client 32 * applications. 33 * You need to update BridgeIInputMethodManager.java as well when changing 34 * this file. 35 */ 36 interface IInputMethodManager { 37 // TODO: Use ParceledListSlice instead getInputMethodList()38 List<InputMethodInfo> getInputMethodList(); 39 // TODO: Use ParceledListSlice instead getEnabledInputMethodList()40 List<InputMethodInfo> getEnabledInputMethodList(); getEnabledInputMethodSubtypeList(in String imiId, boolean allowsImplicitlySelectedSubtypes)41 List<InputMethodSubtype> getEnabledInputMethodSubtypeList(in String imiId, 42 boolean allowsImplicitlySelectedSubtypes); getLastInputMethodSubtype()43 InputMethodSubtype getLastInputMethodSubtype(); 44 // TODO: We should change the return type from List to List<Parcelable> 45 // Currently there is a bug that aidl doesn't accept List<Parcelable> getShortcutInputMethodsAndSubtypes()46 List getShortcutInputMethodsAndSubtypes(); addClient(in IInputMethodClient client, in IInputContext inputContext, int uid, int pid)47 void addClient(in IInputMethodClient client, 48 in IInputContext inputContext, int uid, int pid); removeClient(in IInputMethodClient client)49 void removeClient(in IInputMethodClient client); 50 finishInput(in IInputMethodClient client)51 void finishInput(in IInputMethodClient client); showSoftInput(in IInputMethodClient client, int flags, in ResultReceiver resultReceiver)52 boolean showSoftInput(in IInputMethodClient client, int flags, 53 in ResultReceiver resultReceiver); hideSoftInput(in IInputMethodClient client, int flags, in ResultReceiver resultReceiver)54 boolean hideSoftInput(in IInputMethodClient client, int flags, 55 in ResultReceiver resultReceiver); 56 // If windowToken is null, this just does startInput(). Otherwise this reports that a window 57 // has gained focus, and if 'attribute' is non-null then also does startInput. startInputOrWindowGainedFocus( int startInputReason, in IInputMethodClient client, in IBinder windowToken, int controlFlags, int softInputMode, int windowFlags, in EditorInfo attribute, IInputContext inputContext, int missingMethodFlags)58 InputBindResult startInputOrWindowGainedFocus( 59 /* @InputMethodClient.StartInputReason */ int startInputReason, 60 in IInputMethodClient client, in IBinder windowToken, int controlFlags, 61 /* @android.view.WindowManager.LayoutParams.SoftInputModeFlags */ int softInputMode, 62 int windowFlags, in EditorInfo attribute, IInputContext inputContext, 63 /* @InputConnectionInspector.MissingMethodFlags */ int missingMethodFlags); 64 showInputMethodPickerFromClient(in IInputMethodClient client, int auxiliarySubtypeMode)65 void showInputMethodPickerFromClient(in IInputMethodClient client, 66 int auxiliarySubtypeMode); showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId)67 void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId); setInputMethod(in IBinder token, String id)68 void setInputMethod(in IBinder token, String id); setInputMethodAndSubtype(in IBinder token, String id, in InputMethodSubtype subtype)69 void setInputMethodAndSubtype(in IBinder token, String id, in InputMethodSubtype subtype); hideMySoftInput(in IBinder token, int flags)70 void hideMySoftInput(in IBinder token, int flags); showMySoftInput(in IBinder token, int flags)71 void showMySoftInput(in IBinder token, int flags); updateStatusIcon(in IBinder token, String packageName, int iconId)72 void updateStatusIcon(in IBinder token, String packageName, int iconId); setImeWindowStatus(in IBinder token, in IBinder startInputToken, int vis, int backDisposition)73 void setImeWindowStatus(in IBinder token, in IBinder startInputToken, int vis, 74 int backDisposition); registerSuggestionSpansForNotification(in SuggestionSpan[] spans)75 void registerSuggestionSpansForNotification(in SuggestionSpan[] spans); notifySuggestionPicked(in SuggestionSpan span, String originalString, int index)76 boolean notifySuggestionPicked(in SuggestionSpan span, String originalString, int index); getCurrentInputMethodSubtype()77 InputMethodSubtype getCurrentInputMethodSubtype(); setCurrentInputMethodSubtype(in InputMethodSubtype subtype)78 boolean setCurrentInputMethodSubtype(in InputMethodSubtype subtype); switchToLastInputMethod(in IBinder token)79 boolean switchToLastInputMethod(in IBinder token); switchToNextInputMethod(in IBinder token, boolean onlyCurrentIme)80 boolean switchToNextInputMethod(in IBinder token, boolean onlyCurrentIme); shouldOfferSwitchingToNextInputMethod(in IBinder token)81 boolean shouldOfferSwitchingToNextInputMethod(in IBinder token); setInputMethodEnabled(String id, boolean enabled)82 boolean setInputMethodEnabled(String id, boolean enabled); setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes)83 void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes); getInputMethodWindowVisibleHeight()84 int getInputMethodWindowVisibleHeight(); clearLastInputMethodWindowForTransition(in IBinder token)85 void clearLastInputMethodWindowForTransition(in IBinder token); 86 createInputContentUriToken(in IBinder token, in Uri contentUri, in String packageName)87 IInputContentUriToken createInputContentUriToken(in IBinder token, in Uri contentUri, 88 in String packageName); 89 reportFullscreenMode(in IBinder token, boolean fullscreen)90 void reportFullscreenMode(in IBinder token, boolean fullscreen); 91 notifyUserAction(int sequenceNumber)92 oneway void notifyUserAction(int sequenceNumber); 93 } 94