FileDocCategorySizeDatePackage
IInputMethodSessionWrapper.javaAPI DocAndroid 1.5 API6557Wed May 06 22:41:54 BST 2009android.inputmethodservice

IInputMethodSessionWrapper

public class IInputMethodSessionWrapper extends IInputMethodSession.Stub implements HandlerCaller.Callback

Fields Summary
private static final String
TAG
private static final boolean
DEBUG
private static final int
DO_FINISH_INPUT
private static final int
DO_DISPLAY_COMPLETIONS
private static final int
DO_UPDATE_EXTRACTED_TEXT
private static final int
DO_DISPATCH_KEY_EVENT
private static final int
DO_DISPATCH_TRACKBALL_EVENT
private static final int
DO_UPDATE_SELECTION
private static final int
DO_UPDATE_CURSOR
private static final int
DO_APP_PRIVATE_COMMAND
private static final int
DO_TOGGLE_SOFT_INPUT
final com.android.internal.os.HandlerCaller
mCaller
final android.view.inputmethod.InputMethodSession
mInputMethodSession
Constructors Summary
public IInputMethodSessionWrapper(android.content.Context context, android.view.inputmethod.InputMethodSession inputMethodSession)

        mCaller = new HandlerCaller(context, this);
        mInputMethodSession = inputMethodSession;
    
Methods Summary
public voidappPrivateCommand(java.lang.String action, android.os.Bundle data)

        mCaller.executeOrSendMessage(mCaller.obtainMessageOO(DO_APP_PRIVATE_COMMAND, action, data));
    
public voiddispatchKeyEvent(int seq, android.view.KeyEvent event, com.android.internal.view.IInputMethodCallback callback)

        mCaller.executeOrSendMessage(mCaller.obtainMessageIOO(DO_DISPATCH_KEY_EVENT, seq,
                event, callback));
    
public voiddispatchTrackballEvent(int seq, android.view.MotionEvent event, com.android.internal.view.IInputMethodCallback callback)

        mCaller.executeOrSendMessage(mCaller.obtainMessageIOO(DO_DISPATCH_TRACKBALL_EVENT, seq,
                event, callback));
    
public voiddisplayCompletions(android.view.inputmethod.CompletionInfo[] completions)

        mCaller.executeOrSendMessage(mCaller.obtainMessageO(
                DO_DISPLAY_COMPLETIONS, completions));
    
public voidexecuteMessage(android.os.Message msg)

        switch (msg.what) {
            case DO_FINISH_INPUT:
                mInputMethodSession.finishInput();
                return;
            case DO_DISPLAY_COMPLETIONS:
                mInputMethodSession.displayCompletions((CompletionInfo[])msg.obj);
                return;
            case DO_UPDATE_EXTRACTED_TEXT:
                mInputMethodSession.updateExtractedText(msg.arg1,
                        (ExtractedText)msg.obj);
                return;
            case DO_DISPATCH_KEY_EVENT: {
                HandlerCaller.SomeArgs args = (HandlerCaller.SomeArgs)msg.obj;
                mInputMethodSession.dispatchKeyEvent(msg.arg1,
                        (KeyEvent)args.arg1,
                        new InputMethodEventCallbackWrapper(
                                (IInputMethodCallback)args.arg2));
                mCaller.recycleArgs(args);
                return;
            }
            case DO_DISPATCH_TRACKBALL_EVENT: {
                HandlerCaller.SomeArgs args = (HandlerCaller.SomeArgs)msg.obj;
                mInputMethodSession.dispatchTrackballEvent(msg.arg1,
                        (MotionEvent)args.arg1,
                        new InputMethodEventCallbackWrapper(
                                (IInputMethodCallback)args.arg2));
                mCaller.recycleArgs(args);
                return;
            }
            case DO_UPDATE_SELECTION: {
                HandlerCaller.SomeArgs args = (HandlerCaller.SomeArgs)msg.obj;
                mInputMethodSession.updateSelection(args.argi1, args.argi2,
                        args.argi3, args.argi4, args.argi5, args.argi6);
                mCaller.recycleArgs(args);
                return;
            }
            case DO_UPDATE_CURSOR: {
                mInputMethodSession.updateCursor((Rect)msg.obj);
                return;
            }
            case DO_APP_PRIVATE_COMMAND: {
                HandlerCaller.SomeArgs args = (HandlerCaller.SomeArgs)msg.obj;
                mInputMethodSession.appPrivateCommand((String)args.arg1,
                        (Bundle)args.arg2);
                mCaller.recycleArgs(args);
                return;
            }
            case DO_TOGGLE_SOFT_INPUT: {
                mInputMethodSession.toggleSoftInput(msg.arg1, msg.arg2);
                return;
            }
        }
        Log.w(TAG, "Unhandled message code: " + msg.what);
    
public voidfinishInput()

        mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_FINISH_INPUT));
    
public android.view.inputmethod.InputMethodSessiongetInternalInputMethodSession()

        return mInputMethodSession;
    
public voidtoggleSoftInput(int showFlags, int hideFlags)

        mCaller.executeOrSendMessage(mCaller.obtainMessageII(DO_TOGGLE_SOFT_INPUT, showFlags, hideFlags));
    
public voidupdateCursor(android.graphics.Rect newCursor)

        mCaller.executeOrSendMessage(mCaller.obtainMessageO(DO_UPDATE_CURSOR,
                newCursor));
    
public voidupdateExtractedText(int token, android.view.inputmethod.ExtractedText text)

        mCaller.executeOrSendMessage(mCaller.obtainMessageIO(
                DO_UPDATE_EXTRACTED_TEXT, token, text));
    
public voidupdateSelection(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd, int candidatesStart, int candidatesEnd)

        mCaller.executeOrSendMessage(mCaller.obtainMessageIIIIII(DO_UPDATE_SELECTION,
                oldSelStart, oldSelEnd, newSelStart, newSelEnd,
                candidatesStart, candidatesEnd));