IInputMethodManager.aidl revision f9f01008624e2d28c15a90d942fa36f98c8c967d
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 */
32interface IInputMethodManager {
33    List<InputMethodInfo> getInputMethodList();
34    List<InputMethodInfo> getEnabledInputMethodList();
35    List<InputMethodSubtype> getEnabledInputMethodSubtypeList(in InputMethodInfo imi,
36            boolean allowsImplicitlySelectedSubtypes);
37    InputMethodSubtype getLastInputMethodSubtype();
38    // TODO: We should change the return type from List to List<Parcelable>
39    // Currently there is a bug that aidl doesn't accept List<Parcelable>
40    List getShortcutInputMethodsAndSubtypes();
41    void addClient(in IInputMethodClient client,
42            in IInputContext inputContext, int uid, int pid);
43    void removeClient(in IInputMethodClient client);
44
45    InputBindResult startInput(in IInputMethodClient client,
46            IInputContext inputContext, in EditorInfo attribute,
47            boolean initial, boolean needResult);
48    void finishInput(in IInputMethodClient client);
49    boolean showSoftInput(in IInputMethodClient client, int flags,
50            in ResultReceiver resultReceiver);
51    boolean hideSoftInput(in IInputMethodClient client, int flags,
52            in ResultReceiver resultReceiver);
53    void windowGainedFocus(in IInputMethodClient client, in IBinder windowToken,
54            boolean viewHasFocus, boolean isTextEditor,
55            int softInputMode, boolean first, int windowFlags);
56
57    void showInputMethodPickerFromClient(in IInputMethodClient client);
58    void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId);
59    void setInputMethod(in IBinder token, String id);
60    void setInputMethodAndSubtype(in IBinder token, String id, in InputMethodSubtype subtype);
61    void hideMySoftInput(in IBinder token, int flags);
62    void showMySoftInput(in IBinder token, int flags);
63    void updateStatusIcon(in IBinder token, String packageName, int iconId);
64    void setImeWindowStatus(in IBinder token, int vis, int backDisposition);
65    void registerSuggestionSpansForNotification(in SuggestionSpan[] spans);
66    boolean notifySuggestionPicked(in SuggestionSpan span, String originalString, int index);
67    InputMethodSubtype getCurrentInputMethodSubtype();
68    boolean setCurrentInputMethodSubtype(in InputMethodSubtype subtype);
69    boolean switchToLastInputMethod(in IBinder token);
70    boolean setInputMethodEnabled(String id, boolean enabled);
71}
72