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.ResultReceiver;
20 import android.text.style.SuggestionSpan;
21 import android.view.inputmethod.InputMethodInfo;
22 import android.view.inputmethod.InputMethodSubtype;
23 import android.view.inputmethod.EditorInfo;
24 import com.android.internal.view.InputBindResult;
25 import com.android.internal.view.IInputContext;
26 import 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  */
34 interface IInputMethodManager {
35     // TODO: Use ParceledListSlice instead
getInputMethodList()36     List<InputMethodInfo> getInputMethodList();
37     // TODO: Use ParceledListSlice instead
getEnabledInputMethodList()38     List<InputMethodInfo> getEnabledInputMethodList();
getEnabledInputMethodSubtypeList(in String imiId, boolean allowsImplicitlySelectedSubtypes)39     List<InputMethodSubtype> getEnabledInputMethodSubtypeList(in String imiId,
40             boolean allowsImplicitlySelectedSubtypes);
getLastInputMethodSubtype()41     InputMethodSubtype getLastInputMethodSubtype();
42     // TODO: We should change the return type from List to List<Parcelable>
43     // Currently there is a bug that aidl doesn't accept List<Parcelable>
getShortcutInputMethodsAndSubtypes()44     List getShortcutInputMethodsAndSubtypes();
addClient(in IInputMethodClient client, in IInputContext inputContext, int uid, int pid)45     void addClient(in IInputMethodClient client,
46             in IInputContext inputContext, int uid, int pid);
removeClient(in IInputMethodClient client)47     void removeClient(in IInputMethodClient client);
48 
startInput(in IInputMethodClient client, IInputContext inputContext, in EditorInfo attribute, int controlFlags)49     InputBindResult startInput(in IInputMethodClient client,
50             IInputContext inputContext, in EditorInfo attribute, int controlFlags);
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     // Report that a window has gained focus.  If 'attribute' is non-null,
57     // this will also do a startInput.
windowGainedFocus(in IInputMethodClient client, in IBinder windowToken, int controlFlags, int softInputMode, int windowFlags, in EditorInfo attribute, IInputContext inputContext)58     InputBindResult windowGainedFocus(in IInputMethodClient client, in IBinder windowToken,
59             int controlFlags, int softInputMode, int windowFlags,
60             in EditorInfo attribute, IInputContext inputContext);
61 
showInputMethodPickerFromClient(in IInputMethodClient client)62     void showInputMethodPickerFromClient(in IInputMethodClient client);
showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId)63     void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId);
setInputMethod(in IBinder token, String id)64     void setInputMethod(in IBinder token, String id);
setInputMethodAndSubtype(in IBinder token, String id, in InputMethodSubtype subtype)65     void setInputMethodAndSubtype(in IBinder token, String id, in InputMethodSubtype subtype);
hideMySoftInput(in IBinder token, int flags)66     void hideMySoftInput(in IBinder token, int flags);
showMySoftInput(in IBinder token, int flags)67     void showMySoftInput(in IBinder token, int flags);
updateStatusIcon(in IBinder token, String packageName, int iconId)68     void updateStatusIcon(in IBinder token, String packageName, int iconId);
setImeWindowStatus(in IBinder token, int vis, int backDisposition)69     void setImeWindowStatus(in IBinder token, int vis, int backDisposition);
registerSuggestionSpansForNotification(in SuggestionSpan[] spans)70     void registerSuggestionSpansForNotification(in SuggestionSpan[] spans);
notifySuggestionPicked(in SuggestionSpan span, String originalString, int index)71     boolean notifySuggestionPicked(in SuggestionSpan span, String originalString, int index);
getCurrentInputMethodSubtype()72     InputMethodSubtype getCurrentInputMethodSubtype();
setCurrentInputMethodSubtype(in InputMethodSubtype subtype)73     boolean setCurrentInputMethodSubtype(in InputMethodSubtype subtype);
switchToLastInputMethod(in IBinder token)74     boolean switchToLastInputMethod(in IBinder token);
switchToNextInputMethod(in IBinder token, boolean onlyCurrentIme)75     boolean switchToNextInputMethod(in IBinder token, boolean onlyCurrentIme);
shouldOfferSwitchingToNextInputMethod(in IBinder token)76     boolean shouldOfferSwitchingToNextInputMethod(in IBinder token);
setInputMethodEnabled(String id, boolean enabled)77     boolean setInputMethodEnabled(String id, boolean enabled);
setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes)78     void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes);
getInputMethodWindowVisibleHeight()79     int getInputMethodWindowVisibleHeight();
notifyUserAction(int sequenceNumber)80     oneway void notifyUserAction(int sequenceNumber);
81 }
82