IAccessibleHypertext 编辑

other-licenses/ia2/AccessibleHypertext.idlNot scriptable This interface exposes information about hypertext in a document. 1.0 66 Introduced Gecko 1.9 Inherits from: IAccessibleText Last changed in Gecko 1.9 (Firefox 3)

The IAccessibleHypertext interface is the main interface to expose hyperlinks in a document, typically a text document, that are used to reference other documents. A typical implementation is to implement this interface on the smallest text object such as a paragraph of text.

Method overview

[propget] HRESULT hyperlink([in] long index, [out] IAccessibleHyperlink hyperlink );
[propget] HRESULT hyperlinkIndex([in] long charIndex, [out] long hyperlinkIndex );
[propget] HRESULT nHyperlinks([out] long hyperlinkCount );

Methods

hyperlink()

Returns the specified link. The returned IAccessibleHyperlink object encapsulates the hyperlink and provides several kinds of information describing it.

[propget] HRESULT hyperlink(
  [in] long index,
  [out] IAccessibleHyperlink hyperlink
);
Parameters
index
This 0 based index specifies the hyperlink to return.
hyperlink
If the given index is valid, that is it lies in the interval from 0 to the number of links minus one, a reference to the specified hyperlink object is returned. If the index is invalid then a null pointer is returned.
Return value

E_INVALIDARG if bad [in] passed, [out] value is null. S_OK.

hyperlinkIndex()

Returns the index of the hyperlink that is associated with this character index. This is the case when a link spans the given character index.

[propget] HRESULT hyperlinkIndex(
  [in] long charIndex,
  [out] long hyperlinkIndex
);
Parameters
charIndex
A 0 based index of the character for which to return the link index. If IAccessibleText is used to represent the text containing the link, then the character index is only valid if it is greater than or equal to zero and lower than the number of characters in the text.
hyperlinkIndex
The 0 based index of the hyperlink that is associated with this character index, or -1 if charIndex is not on a link.
Return value

E_INVALIDARG if bad [in] passed, [out] value is null. S_FALSE if there is nothing to return, [out] value is -1. S_OK.

nHyperlinks()

Returns the number of links and link groups contained within this hypertext paragraph.

[propget] HRESULT nHyperlinks(
  [out] long hyperlinkCount
);
Parameters
hyperlinkCount
The number of links and link groups within this hypertext paragraph. Returns 0 if there is no link.
Return value

S_OK.

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:71 次

字数:4440

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文