nsIAccessibleEditableText 编辑
accessible/public/nsIAccessibleEditableText.idl
Scriptable 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
Attribute | Type | Description |
associatedEditor |
| 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论