FileDocCategorySizeDatePackage
InputConnectionWrapper.javaAPI DocAndroid 1.5 API11779Wed May 06 22:41:56 BST 2009com.android.internal.view

InputConnectionWrapper

public class InputConnectionWrapper extends Object implements android.view.inputmethod.InputConnection

Fields Summary
private static final int
MAX_WAIT_TIME_MILLIS
private final com.android.internal.view.IInputContext
mIInputContext
Constructors Summary
public InputConnectionWrapper(com.android.internal.view.IInputContext inputContext)

        mIInputContext = inputContext;
    
Methods Summary
public booleanbeginBatchEdit()

        try {
            mIInputContext.beginBatchEdit();
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleanclearMetaKeyStates(int states)

        try {
            mIInputContext.clearMetaKeyStates(states);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleancommitCompletion(android.view.inputmethod.CompletionInfo text)

        try {
            mIInputContext.commitCompletion(text);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleancommitText(java.lang.CharSequence text, int newCursorPosition)

        try {
            mIInputContext.commitText(text, newCursorPosition);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleandeleteSurroundingText(int leftLength, int rightLength)

        try {
            mIInputContext.deleteSurroundingText(leftLength, rightLength);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleanendBatchEdit()

        try {
            mIInputContext.endBatchEdit();
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleanfinishComposingText()

        try {
            mIInputContext.finishComposingText();
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public intgetCursorCapsMode(int reqModes)

        int value = 0;
        try {
            InputContextCallback callback = InputContextCallback.getInstance();
            mIInputContext.getCursorCapsMode(reqModes, callback.mSeq, callback);
            synchronized (callback) {
                callback.waitForResultLocked();
                if (callback.mHaveValue) {
                    value = callback.mCursorCapsMode;
                }
            }
            callback.dispose();
        } catch (RemoteException e) {
            return 0;
        }
        return value;
    
public android.view.inputmethod.ExtractedTextgetExtractedText(android.view.inputmethod.ExtractedTextRequest request, int flags)

        ExtractedText value = null;
        try {
            InputContextCallback callback = InputContextCallback.getInstance();
            mIInputContext.getExtractedText(request, flags, callback.mSeq, callback);
            synchronized (callback) {
                callback.waitForResultLocked();
                if (callback.mHaveValue) {
                    value = callback.mExtractedText;
                }
            }
            callback.dispose();
        } catch (RemoteException e) {
            return null;
        }
        return value;
    
public java.lang.CharSequencegetTextAfterCursor(int length, int flags)

        CharSequence value = null;
        try {
            InputContextCallback callback = InputContextCallback.getInstance();
            mIInputContext.getTextAfterCursor(length, flags, callback.mSeq, callback);
            synchronized (callback) {
                callback.waitForResultLocked();
                if (callback.mHaveValue) {
                    value = callback.mTextAfterCursor;
                }
            }
            callback.dispose();
        } catch (RemoteException e) {
            return null;
        }
        return value;
    
public java.lang.CharSequencegetTextBeforeCursor(int length, int flags)

        CharSequence value = null;
        try {
            InputContextCallback callback = InputContextCallback.getInstance();
            mIInputContext.getTextBeforeCursor(length, flags, callback.mSeq, callback);
            synchronized (callback) {
                callback.waitForResultLocked();
                if (callback.mHaveValue) {
                    value = callback.mTextBeforeCursor;
                }
            }
            callback.dispose();
        } catch (RemoteException e) {
            return null;
        }
        return value;
    
public booleanperformContextMenuAction(int id)

        try {
            mIInputContext.performContextMenuAction(id);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleanperformEditorAction(int actionCode)

        try {
            mIInputContext.performEditorAction(actionCode);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleanperformPrivateCommand(java.lang.String action, android.os.Bundle data)

        try {
            mIInputContext.performPrivateCommand(action, data);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleanreportFullscreenMode(boolean enabled)

        try {
            mIInputContext.reportFullscreenMode(enabled);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleansendKeyEvent(android.view.KeyEvent event)

        try {
            mIInputContext.sendKeyEvent(event);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleansetComposingText(java.lang.CharSequence text, int newCursorPosition)

        try {
            mIInputContext.setComposingText(text, newCursorPosition);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleansetSelection(int start, int end)

        try {
            mIInputContext.setSelection(start, end);
            return true;
        } catch (RemoteException e) {
            return false;
        }