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.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  */
     32 interface 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, int controlFlags);
     47     void finishInput(in IInputMethodClient client);
     48     boolean showSoftInput(in IInputMethodClient client, int flags,
     49             in ResultReceiver resultReceiver);
     50     boolean hideSoftInput(in IInputMethodClient client, int flags,
     51             in ResultReceiver resultReceiver);
     52     // Report that a window has gained focus.  If 'attribute' is non-null,
     53     // this will also do a startInput.
     54     InputBindResult windowGainedFocus(in IInputMethodClient client, in IBinder windowToken,
     55             int controlFlags, int softInputMode, int windowFlags,
     56             in EditorInfo attribute, IInputContext inputContext);
     57 
     58     void showInputMethodPickerFromClient(in IInputMethodClient client);
     59     void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId);
     60     void setInputMethod(in IBinder token, String id);
     61     void setInputMethodAndSubtype(in IBinder token, String id, in InputMethodSubtype subtype);
     62     void hideMySoftInput(in IBinder token, int flags);
     63     void showMySoftInput(in IBinder token, int flags);
     64     void updateStatusIcon(in IBinder token, String packageName, int iconId);
     65     void setImeWindowStatus(in IBinder token, int vis, int backDisposition);
     66     void registerSuggestionSpansForNotification(in SuggestionSpan[] spans);
     67     boolean notifySuggestionPicked(in SuggestionSpan span, String originalString, int index);
     68     InputMethodSubtype getCurrentInputMethodSubtype();
     69     boolean setCurrentInputMethodSubtype(in InputMethodSubtype subtype);
     70     boolean switchToLastInputMethod(in IBinder token);
     71     boolean switchToNextInputMethod(in IBinder token, boolean onlyCurrentIme);
     72     boolean setInputMethodEnabled(String id, boolean enabled);
     73     oneway void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes);
     74 }
     75