Sequenceablepublic class EditingText extends Object implements Sequenceable
The content to be transferred to the input method can be all or updated text in the application editor. If all texts are transferred, the input method only needs to display the text directly in its UI. If updated text are transferred, the input method needs to update the content displayed in its UI in accordance with the transferred text. This class ensures the content consistency between the application editor and the input method.
SystemCapability.Miscservices#INPUTMETHODSequenceable.Producer<T>| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
FLAG_SELECTING |
Indicates that the text are selected.
|
static int |
FLAG_SINGLE_LINE |
Indicates that the text can be edited only in a single line.
|
| 构造器 | 说明 |
|---|---|
EditingText() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getChangedEnd() |
Obtains the end index of the changed text in the content of the application editor.
|
int |
getChangedStart() |
Obtains the start index of the changed text in the content of the application editor.
|
int |
getFlags() |
Obtains the additional bit flags of the
EditingText#getTextContent() text. |
int |
getOffset() |
Obtains the start index of the
EditingText#getTextContent() text in the content of the application
editor. |
String |
getPrompt() |
Obtains the default hint text displayed in the application editor.
|
int |
getSelectionEnd() |
Obtains the end index of the selected text in the
EditingText#getTextContent() text. |
int |
getSelectionStart() |
Obtains the start index of the selected text in the
EditingText#getTextContent() text. |
String |
getTextContent() |
Obtains all or updated text in the application editor.
|
boolean |
marshalling(Parcel out) |
Marshals this
Sequenceable object into a Parcel. |
void |
setChangedEnd(int changedEnd) |
Sets the end index of the changed text in the content of the application editor.
|
void |
setChangedStart(int changedStart) |
Sets the start index of the changed text in the content of the application editor.
|
void |
setFlags(int flags) |
Sets the additional bit flags of the
EditingText#getTextContent() text. |
void |
setOffset(int offset) |
Sets the start index of the
EditingText#getTextContent() text in the content of the application editor. |
void |
setPrompt(String prompt) |
Sets the default hint text displayed in the application editor.
|
void |
setSelectionEnd(int selectionEnd) |
Sets the end index of the selected text in the
EditingText#getTextContent() text. |
void |
setSelectionStart(int selectionStart) |
Sets the start index of the selected text in the
EditingText#getTextContent() text. |
void |
setTextContent(String textContent) |
Sets all or updated text in the application editor.
|
boolean |
unmarshalling(Parcel in) |
Unmarshals this
Sequenceable object from a Parcel. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasFileDescriptorpublic static final int FLAG_SELECTING
public static final int FLAG_SINGLE_LINE
public boolean marshalling(Parcel out)
SequenceableSequenceable object into a Parcel.marshalling 在接口中 Sequenceableout - Indicates the Parcel object to which the Sequenceable
object will be marshaled..true if the marshalling is successful; returns false otherwise.public boolean unmarshalling(Parcel in)
SequenceableSequenceable object from a Parcel.unmarshalling 在接口中 Sequenceablein - Indicates the Parcel object into which the Sequenceable
object has been marshaled.true if the unmarshalling is successful; returns false otherwise.public String getTextContent()
public void setTextContent(String textContent)
textContent - Indicates the text to transfer.public int getOffset()
EditingText#getTextContent() text in the content of the application
editor.EditingText#getTextContent() text in the content of the
application editor.public void setOffset(int offset)
EditingText#getTextContent() text in the content of the application editor.offset - Indicates the start index to set for the EditingText#getTextContent() text. The value
cannot be smaller than 0. If a value smaller than 0 is set, 0 is used.
The default value is 0.public int getChangedStart()
-1 if all the text are changed.public void setChangedStart(int changedStart)
changedStart - Indicates the start index to set for the changed text. Set this parameter to -1
if all the text are changed.public int getChangedEnd()
public void setChangedEnd(int changedEnd)
changedEnd - Indicates the end index to set for the changed text.public int getSelectionStart()
EditingText#getTextContent() text.
The actual start index of the selected text in the application editor is the sum of the EditingText#getOffset() value and the return value of this method.
EditingText#getTextContent() text.public void setSelectionStart(int selectionStart)
EditingText#getTextContent() text.selectionStart - Indicates the start index to set for the selected text in the EditingText#getTextContent() text.public int getSelectionEnd()
EditingText#getTextContent() text.
The actual end index of the selected text in the application editor is the sum of the the return value of
EditingText#getOffset() and the return value of this method.
EditingText#getTextContent() text.public void setSelectionEnd(int selectionEnd)
EditingText#getTextContent() text.selectionEnd - Indicates the end index to set for the selected texts in the EditingText#getTextContent() text.public int getFlags()
EditingText#getTextContent() text.EditingText#getTextContent() text.public void setFlags(int flags)
EditingText#getTextContent() text.flags - Indicates the additional bit flags to set. The value is determined by the static member variables
FLAG_SINGLE_LINE and FLAG_SELECTING in this class. When bit 0 of flags is 1, the
current text can be edited only in a single line. When bit 1 of flags is 1, the
current text enter the selection mode, which is possible only when the hardware keyboard is
connected and the Shift key is latched.public String getPrompt()
public void setPrompt(String prompt)
prompt - Indicates the default hint text to set.