IAccessible2 API  Version 1.3
Public Member Functions | List of all members
IAccessibleHyperlink Interface Reference

This interface represents hyperlinks. More...

import "AccessibleHyperlink.idl";

Inheritance diagram for IAccessibleHyperlink:
IAccessibleAction

Public Member Functions

HRESULT anchor ([in] long index,[out, retval] VARIANT *anchor)
 Returns an object that represents the link anchor, as appropriate for the link at the specified index. More...
 
HRESULT anchorTarget ([in] long index,[out, retval] VARIANT *anchorTarget)
 Returns an object representing the target of the link, as appropriate for the link at the specified index. More...
 
HRESULT startIndex ([out, retval] long *index)
 Returns the 0 based character offset at which the textual representation of the hyperlink starts. More...
 
HRESULT endIndex ([out, retval] long *index)
 Returns the 0 based character offset at which the textual representation of the hyperlink ends. More...
 
HRESULT valid ([out, retval] boolean *valid)
 Returns whether the target object referenced by this link is still valid. More...
 
- Public Member Functions inherited from IAccessibleAction
HRESULT nActions ([out, retval] long *nActions)
 Returns the number of accessible actions available in this object. More...
 
HRESULT doAction ([in] long actionIndex)
 Performs the specified Action on the object. More...
 
HRESULT description ([in] long actionIndex,[out, retval] BSTR *description)
 Returns a description of the specified action of the object. More...
 
HRESULT keyBinding ([in] long actionIndex,[in] long nMaxBindings,[out, size_is(, nMaxBindings), length_is(,*nBindings)] BSTR **keyBindings,[out, retval] long *nBindings)
 Returns an array of BSTRs describing one or more key bindings, if there are any, associated with the specified action. More...
 
HRESULT name ([in] long actionIndex,[out, retval] BSTR *name)
 Returns the non-localized name of specified action. More...
 
HRESULT localizedName ([in] long actionIndex,[out, retval] BSTR *localizedName)
 Returns the localized name of specified action. More...
 

Detailed Description

This interface represents hyperlinks.

This interface represents a hyperlink associated with a single substring of text or single non-text object. Non-text objects can have either a single link or a collection of links such as when the non-text object is an image map.

Linked objects and anchors are implementation dependent. This interface is derived from IAccessibleAction. IAccessibleAction::nActions is one greater than the maximum value for the indices used with the methods of this interface.

Furthermore, the object that implements this interface has to be connected implicitly or explicitly with an object that implements IAccessibleText. IAccessibleHyperlink::startIndex and IAccessibleHyperlink::endIndex are indices with respect to the text exposed by IAccessibleText.

This interface provides access to a single object which can have multiple actions. An example is an image map which is an image with multiple links each of which is associated with a separate non-overlapping area of the image. This interface could also be applied to other kinds of objects with multiple actions such as "smart tags" which are objects, typically strings, which have multiple actions such as "Activate URI", "Bookmark URI", etc.

An interesting use case is an image map where each area is associated with multiple actions, e.g. an image map of smart tags. In this case you would have to implement two levels of accessible hyperlinks. The first level hyperlinks would only implement anchor and anchorTarget. The anchors would all reference the image object. The anchorTargets would reference the second level accessible hyperlink objects. None of the IAccessibleAction methods would be implemented on the first level hyperlink objects. The second level hyperlink objects would implement the IAccessibleAction methods. Their anchors would also reference the image object and their anchorTargets would reference URLs or the objects that would be activated.

This use case demonstrates that in some cases there is no need for IAccessibleHyperlink to derive from IAccessibleAction. As a result it may be removed in a later version of the IDL and it is suggested that implementations should not rely on the inheritance.

Member Function Documentation

HRESULT IAccessibleHyperlink::anchor ( [in] long  index,
[out, retval] VARIANT *  anchor 
)
get

Returns an object that represents the link anchor, as appropriate for the link at the specified index.

Parameters
[in]indexA 0 based index identifies the anchor when, as in the case of an image map, there is more than one link represented by this object. The valid maximal index is indicated by IAccessibleAction::nActions.
[out]anchorThis is an implementation dependent value. For example, for a text link this method could return the substring of the containing string where the substring is overridden with link behavior, and for an image link this method could return an IUnknown VARIANT for IAccessibleImage. See the section about VARIANTs for additional information.
Return values
S_OK
E_INVALIDARGif bad [in] passed
HRESULT IAccessibleHyperlink::anchorTarget ( [in] long  index,
[out, retval] VARIANT *  anchorTarget 
)
get

Returns an object representing the target of the link, as appropriate for the link at the specified index.

Parameters
[in]indexA 0 based index identifies the anchor when, as in the case of an image map, there is more than one link represented by this object. The valid maximal index is indicated by IAccessibleAction::nActions.
[out]anchorTargetThis is an implementation dependent value. For example this method could return a BSTR VARIANT of the URI. Alternatively this method could return an IUnknown VARIANT of a COM interface representing a target object to be activated when the link is activated. See the section about VARIANTs for additional information.
Return values
S_OK
E_INVALIDARGif bad [in] passed
HRESULT IAccessibleHyperlink::endIndex ( [out, retval] long *  index)
get

Returns the 0 based character offset at which the textual representation of the hyperlink ends.

The returned value is related to the IAccessibleText interface of the object that owns this hyperlink. The character at the index is not part of the hypertext.

Parameters
[out]index
Return values
S_OK
HRESULT IAccessibleHyperlink::startIndex ( [out, retval] long *  index)
get

Returns the 0 based character offset at which the textual representation of the hyperlink starts.

The returned value is related to the IAccessibleText interface of the object that owns this hyperlink.

Parameters
[out]index
Return values
S_OK
HRESULT IAccessibleHyperlink::valid ( [out, retval] boolean *  valid)
get

Returns whether the target object referenced by this link is still valid.

This is a volatile state that may change without sending an appropriate event. Returns TRUE if the referenced target is still valid and FALSE otherwise.

This has also been used to indicate whether or not the URI of the anchorTarget is malformed.

Parameters
[out]validIf false, one or more of the object's links are invalid. If true, all of the object's links are valid.
Return values
S_OK
S_FALSEif there is nothing to return, [out] value is FALSE
Note
This method is not being used, is deprecated, and should not be implemented or used. It is likely that this method will be removed in a later version of the IDL.

The documentation for this interface was generated from the following file:
Generated on Wed Jul 10 2013 09:47:25 for IAccessible2 API Version 1.3 by  doxygen 1.8.3.1