nsISelection2 编辑
content/base/public/nsISelection2.idl
Scriptable Please add a summary to this article. 1.0 66 Introduced Gecko 1.8 Obsolete Gecko 8.0 Inherits from: nsISelection
Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)In Gecko 8.0 this Interface was merged into the nsISelectionPrivate
interface.
Method overview
void GetRangesForInterval(in nsIDOMNode beginNode, in PRInt32 beginOffset, in nsIDOMNode endNode, in PRInt32 endOffset, in PRBool allowAdjacent, out PRUint32 resultCount, [retval, array, size_is(resultCount)] out nsIDOMRange results); |
void GetRangesForIntervalCOMArray(in nsIDOMNode beginNode, in PRInt32 beginOffset, in nsIDOMNode endNode, in PRInt32 endOffset, in PRBool allowAdjacent, in RangeArray results); Native code only! |
void scrollIntoView(in short aRegion, in boolean aIsSynchronous, in short aVPercent, in short aHPercent); |
Attributes
Attribute | Type | Description |
type | short | Returns the type of the selection (see nsISelectionController for available constants). Read only. |
Methods
GetRangesForInterval()
Return array of ranges intersecting with the given DOM interval.
void GetRangesForInterval( in nsIDOMNode beginNode, in PRInt32 beginOffset, in nsIDOMNode endNode, in PRInt32 endOffset, in PRBool allowAdjacent, out PRUint32 resultCount, [retval, array, size_is(resultCount)] out nsIDOMRange results );
Parameters
beginNode
beginOffset
endNode
endOffset
- These four parameters represent the range to compare against the selection.
allowAdjacent
- Specifies whether the returned ranges are allowed to touch the input range rather than merely overlapping it.
resultCount
- Returns the number of ranges that overlap (or touch) the input range.
results
- Returns the ranges that overlap (or touch) the input range.
GetRangesForIntervalCOMArray
void GetRangesForIntervalCOMArray( in nsIDOMNode beginNode, in PRInt32 beginOffset, in nsIDOMNode endNode, in PRInt32 endOffset, in PRBool allowAdjacent, in RangeArray results );
Parameters
beginNode
beginOffset
endNode
endOffset
- These four parameters represent the range to compare against the selection.
allowAdjacent
- Specifies whether the returned ranges are allowed to touch the input range rather than merely overlapping it.
results
- Returns the ranges that overlap (or touch) the input range.
scrollIntoView()
Scrolls a region of the selection, so that it is visible in the scrolled view.
void scrollIntoView( in short aRegion, in boolean aIsSynchronous, in short aVPercent, in short aHPercent );
Parameters
aRegion
- The region inside the selection to scroll into view (see selection region constants defined in
nsISelectionController
). aIsSynchronous
- When
true
, scrolls the selection into view before returning. Iffalse
, posts a request which is processed at some point after the method returns. aVPercent
- How to align the frame vertically. A value of 0 means the frame's upper edge is aligned with the top edge of the visible area. A value of 100 means the frame's bottom edge is aligned with the bottom edge of the visible area. For values in between, the point "aVPercent" down the frame is placed at the point "aVPercent" down the visible area. A value of 50 centers the frame vertically. A value of -1 means move the frame the minimum amount necessary in order for the entire frame to be visible vertically (if possible).
aHPercent
- How to align the frame horizontally. A value of 0 means the frame's left edge is aligned with the left edge of the visible area. A value of 100 means the frame's right edge is aligned with the right edge of the visible area. For values in between, the point "aHPercent" across the frame is placed at the point "aHPercent" across the visible area. A value of 50 centers the frame horizontally . A value of -1 means move the frame the minimum amount necessary in order for the entire frame to be visible horizontally (if possible).
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论