An interface for editing text of an accessible object. The operations it supports includes setting text attributes and text contents while also replacing old text of an object with new text. It also includes and support basic operations such as, inserting text, copying text, cutting text, pasting text and deleting text at the specified position.
Inherits from:
nsISupports
Last changed in Gecko 1.9 (Firefox 3)
Method overview
void copyText(in long startPos, in long endPos); |
void cutText(in long startPos, in long endPos); |
void deleteText(in long startPos, in long endPos); |
void insertText(in AString text, in long position); |
void pasteText(in long position); |
void setAttributes(in long startPos, in long endPos, in nsISupports attributes); Unimplemented |
void setTextContents(in AString text); |
Attributes
associatedEditor |
nsIEditor
|
Returns an editor associated with the accessible. Read only. Native code only! |
Methods
copyText()
Copies the text range into the clipboard.
void copyText(
in long startPos,
in long endPos
);
Parameters
startPos
- Start offset of the text to be copied into the clipboard.
endPos
- End offset of the text to be copied into the clipboard.
Exceptions thrown
- NS_ERROR_FAILURE
- Indicates the text cannot be copied into the clipboard.
cutText()
Deletes a range of text and copies it to the clipboard.
void cutText(
in long startPos,
in long endPos
);
Parameters
startPos
- Start offset of the text to be deleted and copied to clipboard.
endPos
- End offset of the text to be copied into the clipboard.
Exceptions thrown
- NS_ERROR_FAILURE
- Indicates the text cannot be deleted or copied into the clipboard.
deleteText()
Deletes a range of text.
void deleteText(
in long startPos,
in long endPos
);
Parameters
startPos
- Start offset of the text to be deleted.
endPos
- End offset of the text to be deleted.
Exceptions thrown
- NS_ERROR_FAILURE
- Indicates the text cannot be deleted.
insertText()
Inserts text at the specified position.
void insertText(
in AString text,
in long position
);
Parameters
text
- Text to be inserted.
position
- The offset at which to insert the text.
Exceptions thrown
- NS_ERROR_FAILURE
- Indicates the text cannot be inserted.
pasteText()
Pastes text from the clipboard.
void pasteText(
in long position
);
Parameters
position
- The offset at which to insert the text from the system clipboard into the text represented by this object.
Exceptions thrown
- NS_ERROR_FAILURE
- Indicates the text cannot be pasted from the clipboard.
setAttributes()
Sets the attributes for the text between the two given indices. The old attributes are replaced by the new list of attributes. For example, sets font styles, such as italic, bold, and so on.
void setAttributes(
in long startPos,
in long endPos,
in nsISupports attributes
);
Parameters
startPos
- The start index of the text whose attributes are modified.
endPos
- The end index of the text whose attributes are modified.
attributes
- The set of attributes that replaces the old list of attributes of the specified text portion.
Exceptions thrown
- NS_ERROR_NOT_IMPLEMENTED
- Always. The method is not implemented.
setTextContents()
Replaces the text represented by this object with the given text.
void setTextContents(
in AString text
);
Parameters
text
- The text that will replace the old text.
Exceptions thrown
- NS_ERROR_FAILURE
- Indicates the text cannot be replaced.