Home | History | Annotate | Download | only in view
      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
     38     List<InputMethodInfo> getInputMethodList();
     39     // TODO: Use ParceledListSlice instead
     40     List<InputMethodInfo> getEnabledInputMethodList();
     41     List<InputMethodSubtype> getEnabledInputMethodSubtypeList(in String imiId,
     42             boolean allowsImplicitlySelectedSubtypes);
     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>
     46     List getShortcutInputMethodsAndSubtypes();
     47     void addClient(in IInputMethodClient client,
     48             in IInputContext inputContext, int uid, int pid);
     49     void removeClient(in IInputMethodClient client);
     50 
     51     void finishInput(in IInputMethodClient client);
     52     boolean showSoftInput(in IInputMethodClient client, int flags,
     53             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.
     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 
     65     void showInputMethodPickerFromClient(in IInputMethodClient client,
     66             int auxiliarySubtypeMode);
     67     void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId);
     68     void setInputMethod(in IBinder token, String id);
     69     void setInputMethodAndSubtype(in IBinder token, String id, in InputMethodSubtype subtype);
     70     void hideMySoftInput(in IBinder token, int flags);
     71     void showMySoftInput(in IBinder token, int flags);
     72     void updateStatusIcon(in IBinder token, String packageName, int iconId);
     73     void setImeWindowStatus(in IBinder token, in IBinder startInputToken, int vis,
     74             int backDisposition);
     75     void registerSuggestionSpansForNotification(in SuggestionSpan[] spans);
     76     boolean notifySuggestionPicked(in SuggestionSpan span, String originalString, int index);
     77     InputMethodSubtype getCurrentInputMethodSubtype();
     78     boolean setCurrentInputMethodSubtype(in InputMethodSubtype subtype);
     79     boolean switchToLastInputMethod(in IBinder token);
     80     boolean switchToNextInputMethod(in IBinder token, boolean onlyCurrentIme);
     81     boolean shouldOfferSwitchingToNextInputMethod(in IBinder token);
     82     boolean setInputMethodEnabled(String id, boolean enabled);
     83     void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes);
     84     int getInputMethodWindowVisibleHeight();
     85     void clearLastInputMethodWindowForTransition(in IBinder token);
     86 
     87     IInputContentUriToken createInputContentUriToken(in IBinder token, in Uri contentUri,
     88             in String packageName);
     89 
     90     void reportFullscreenMode(in IBinder token, boolean fullscreen);
     91 
     92     oneway void notifyUserAction(int sequenceNumber);
     93 }
     94