java.lang.Object | |
↳ | android.view.inputmethod.BaseInputConnection |
Base class for implementors of the InputConnection interface, taking care
of most of the common behavior for providing a connection to an Editable.
Implementors of this class will want to be sure to implement
getEditable()
to provide access to their own editable object.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.view.inputmethod.InputConnection
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Default implementation does nothing.
| |||||||||||
Default implementation uses
MetaKeyKeyListener.clearMetaKeyState(long, int) to clear the state. | |||||||||||
Default implementation does nothing.
| |||||||||||
Default implementation replaces any existing composing text with
the given text.
| |||||||||||
The default implementation performs the deletion around the current
selection position of the editable text.
| |||||||||||
Default implementation does nothing.
| |||||||||||
The default implementation removes the composing state from the
current editable text.
| |||||||||||
The default implementation uses TextUtils.getCapsMode to get the
cursor caps mode for the current selection position in the editable
text, unless in dummy mode in which case 0 is always returned.
| |||||||||||
Return the target of edit operations.
| |||||||||||
The default implementation always returns null.
| |||||||||||
The default implementation returns the text currently selected, or null if none is
selected.
| |||||||||||
The default implementation returns the given amount of text from the
current cursor position in the buffer.
| |||||||||||
The default implementation returns the given amount of text from the
current cursor position in the buffer.
| |||||||||||
The default implementation does nothing.
| |||||||||||
The default implementation turns this into the enter key.
| |||||||||||
The default implementation does nothing.
| |||||||||||
Updates InputMethodManager with the current fullscreen mode.
| |||||||||||
Provides standard implementation for sending a key event to the window
attached to the input connection's view.
| |||||||||||
Mark a certain region of text as composing text.
| |||||||||||
The default implementation places the given text into the editable,
replacing any existing composing text.
| |||||||||||
The default implementation changes the selection position in the
current editable text.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
From interface android.view.inputmethod.InputConnection
|
Default implementation uses
MetaKeyKeyListener.clearMetaKeyState(long, int)
to clear the state.
states | The states to be cleared, may be one or more bits as
per KeyEvent.getMetaState() . |
---|
Default implementation does nothing.
text | The committed completion. |
---|
Default implementation replaces any existing composing text with the given text. In addition, only if dummy mode, a key event is sent for the new text and the current editable buffer cleared.
text | The committed text. |
---|---|
newCursorPosition | The new cursor position around the text. If > 0, this is relative to the end of the text - 1; if <= 0, this is relative to the start of the text. So a value of 1 will always advance you to the position after the full text being inserted. Note that this means you can't position the cursor within the text, because the editor can make modifications to the text you are providing so it is not possible to correctly specify locations there. |
The default implementation performs the deletion around the current selection position of the editable text.
leftLength | The number of characters to be deleted before the current cursor position. |
---|---|
rightLength | The number of characters to be deleted after the current cursor position. |
The default implementation removes the composing state from the current editable text. In addition, only if dummy mode, a key event is sent for the new text and the current editable buffer cleared.
The default implementation uses TextUtils.getCapsMode to get the cursor caps mode for the current selection position in the editable text, unless in dummy mode in which case 0 is always returned.
reqModes | The desired modes to retrieve, as defined by
TextUtils.getCapsMode . These
constants are defined so that you can simply pass the current
TextBoxAttribute.contentType value
directly in to here. |
---|
Return the target of edit operations. The default implementation returns its own fake editable that is just used for composing text; subclasses that are real text editors should override this and supply their own.
The default implementation always returns null.
request | Description of how the text should be returned. |
---|---|
flags | Additional options to control the client, either 0 or
GET_EXTRACTED_TEXT_MONITOR . |
The default implementation returns the text currently selected, or null if none is selected.
flags | Supplies additional options controlling how the text is
returned. May be either 0 or GET_TEXT_WITH_STYLES . |
---|
The default implementation returns the given amount of text from the current cursor position in the buffer.
length | The expected length of the text. |
---|---|
flags | Supplies additional options controlling how the text is
returned. May be either 0 or GET_TEXT_WITH_STYLES . |
The default implementation returns the given amount of text from the current cursor position in the buffer.
length | The expected length of the text. |
---|---|
flags | Supplies additional options controlling how the text is
returned. May be either 0 or GET_TEXT_WITH_STYLES . |
The default implementation does nothing.
The default implementation turns this into the enter key.
actionCode | This must be one of the action constants for
EditorInfo.editorType , such as
EditorInfo.EDITOR_ACTION_GO . |
---|
The default implementation does nothing.
action | Name of the command to be performed. This must be a scoped name, i.e. prefixed with a package name you own, so that different developers will not create conflicting commands. |
---|---|
data | Any data to include with the command. |
Updates InputMethodManager with the current fullscreen mode.
Provides standard implementation for sending a key event to the window attached to the input connection's view.
event | The key event. |
---|
Mark a certain region of text as composing text. Any composing text set previously will be removed automatically. The default style for composing text is used.
start | the position in the text at which the composing region begins |
---|---|
end | the position in the text at which the composing region ends |
The default implementation places the given text into the editable, replacing any existing composing text. The new text is marked as in a composing state with the composing style.
text | The composing text with styles if necessary. If no style object attached to the text, the default style for composing text is used. See {#link android.text.Spanned} for how to attach style object to the text. {#link android.text.SpannableString} and {#link android.text.SpannableStringBuilder} are two implementations of the interface {#link android.text.Spanned}. |
---|---|
newCursorPosition | The new cursor position around the text. If > 0, this is relative to the end of the text - 1; if <= 0, this is relative to the start of the text. So a value of 1 will always advance you to the position after the full text being inserted. Note that this means you can't position the cursor within the text, because the editor can make modifications to the text you are providing so it is not possible to correctly specify locations there. |
The default implementation changes the selection position in the current editable text.