michael@0: /************************************************************************* michael@0: * michael@0: * File Name (AccessibleHyperlink.idl) michael@0: * michael@0: * IAccessible2 IDL Specification michael@0: * michael@0: * Copyright (c) 2007, 2010 Linux Foundation michael@0: * Copyright (c) 2006 IBM Corporation michael@0: * Copyright (c) 2000, 2006 Sun Microsystems, Inc. michael@0: * All rights reserved. michael@0: * michael@0: * michael@0: * Redistribution and use in source and binary forms, with or without michael@0: * modification, are permitted provided that the following conditions michael@0: * are met: michael@0: * michael@0: * 1. Redistributions of source code must retain the above copyright michael@0: * notice, this list of conditions and the following disclaimer. michael@0: * michael@0: * 2. Redistributions in binary form must reproduce the above michael@0: * copyright notice, this list of conditions and the following michael@0: * disclaimer in the documentation and/or other materials michael@0: * provided with the distribution. michael@0: * michael@0: * 3. Neither the name of the Linux Foundation nor the names of its michael@0: * contributors may be used to endorse or promote products michael@0: * derived from this software without specific prior written michael@0: * permission. michael@0: * michael@0: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND michael@0: * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, michael@0: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@0: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE michael@0: * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR michael@0: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@0: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT michael@0: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; michael@0: * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) michael@0: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN michael@0: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR michael@0: * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, michael@0: * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: * michael@0: * This BSD License conforms to the Open Source Initiative "Simplified michael@0: * BSD License" as published at: michael@0: * http://www.opensource.org/licenses/bsd-license.php michael@0: * michael@0: * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2 michael@0: * mark may be used in accordance with the Linux Foundation Trademark michael@0: * Policy to indicate compliance with the IAccessible2 specification. michael@0: * michael@0: ************************************************************************/ michael@0: michael@0: import "objidl.idl"; michael@0: import "oaidl.idl"; michael@0: import "oleacc.idl"; michael@0: import "AccessibleAction.idl"; michael@0: michael@0: /** @brief This interface represents hyperlinks. michael@0: michael@0: This interface represents a hyperlink associated with a single substring michael@0: of text or single non-text object. Non-text objects can have either a michael@0: single link or a collection of links such as when the non-text object is michael@0: an image map. michael@0: michael@0: Linked objects and anchors are implementation dependent. This interface is derived michael@0: from IAccessibleAction. IAccessibleAction::nActions is one greater than the michael@0: maximum value for the indices used with the methods of this interface. michael@0: michael@0: Furthermore, the object that implements this interface has to be connected michael@0: implicitly or explicitly with an object that implements IAccessibleText. michael@0: IAccessibleHyperlink::startIndex and IAccessibleHyperlink::endIndex are michael@0: indices with respect to the text exposed by IAccessibleText. michael@0: michael@0: This interface provides access to a single object which can have multiple actions. michael@0: An example is an image map which is an image with multiple links each of which is michael@0: associated with a separate non-overlapping area of the image. This interface could michael@0: also be applied to other kinds of objects with multiple actions such as "smart tags" michael@0: which are objects, typically strings, which have multiple actions such as michael@0: "Activate URI", "Bookmark URI", etc. michael@0: michael@0: An interesting use case is an image map where each area is associated with multiple michael@0: actions, e.g. an image map of smart tags. In this case you would have to implement michael@0: two levels of accessible hyperlinks. The first level hyperlinks would only implement michael@0: anchor and anchorTarget. The anchors would all reference the image object. The michael@0: anchorTargets would reference the second level accessible hyperlink objects. None michael@0: of the IAccessibleAction methods would be implemented on the first level hyperlink michael@0: objects. The second level hyperlink objects would implement the IAccessibleAction michael@0: methods. Their anchors would also reference the image object and their anchorTargets michael@0: would reference URLs or the objects that would be activated. michael@0: michael@0: This use case demonstrates that in some cases there is no need for IAccessibleHyperlink michael@0: to derive from IAccessibleAction. As a result it may be removed in a later version of michael@0: the IDL and it is suggested that implementations should not rely on the inheritance. michael@0: michael@0: */ michael@0: [object, uuid(01C20F2B-3DD2-400f-949F-AD00BDAB1D41)] michael@0: interface IAccessibleHyperlink : IAccessibleAction michael@0: { michael@0: michael@0: /** @brief Returns an object that represents the link anchor, as appropriate michael@0: for the link at the specified index. michael@0: @param [in] index michael@0: A 0 based index identifies the anchor when, as in the case of an image map, michael@0: there is more than one link represented by this object. The valid maximal michael@0: index is indicated by IAccessibleAction::nActions. michael@0: @param [out] anchor michael@0: This is an implementation dependent value. For example, for a text link this michael@0: method could return the substring of the containing string where the substring michael@0: is overridden with link behavior, and for an image link this method could return michael@0: an IUnknown VARIANT for IAccessibleImage. See the section about michael@0: @ref _variants "VARIANTs" for additional information. michael@0: @retval S_OK michael@0: @retval E_INVALIDARG if bad [in] passed michael@0: */ michael@0: [propget] HRESULT anchor michael@0: ( michael@0: [in] long index, michael@0: [out, retval] VARIANT *anchor michael@0: ); michael@0: michael@0: /** @brief Returns an object representing the target of the link, as appropriate michael@0: for the link at the specified index. michael@0: @param [in] index michael@0: A 0 based index identifies the anchor when, as in the case of an image map, michael@0: there is more than one link represented by this object. The valid maximal michael@0: index is indicated by IAccessibleAction::nActions. michael@0: @param [out] anchorTarget michael@0: This is an implementation dependent value. For example this method could michael@0: return a BSTR VARIANT of the URI. Alternatively this method could return an michael@0: IUnknown VARIANT of a COM interface representing a target object to be michael@0: activated when the link is activated. See the section about michael@0: @ref _variants "VARIANTs" for additional information. michael@0: @retval S_OK michael@0: @retval E_INVALIDARG if bad [in] passed michael@0: */ michael@0: [propget] HRESULT anchorTarget michael@0: ( michael@0: [in] long index, michael@0: [out, retval] VARIANT *anchorTarget michael@0: ); michael@0: michael@0: /** @brief Returns the 0 based character offset at which the textual representation of the hyperlink starts. michael@0: michael@0: The returned value is related to the IAccessibleText interface of the object that michael@0: owns this hyperlink. michael@0: @param [out] index michael@0: @retval S_OK michael@0: */ michael@0: [propget] HRESULT startIndex michael@0: ( michael@0: [out, retval] long *index michael@0: ); michael@0: michael@0: /** @brief Returns the 0 based character offset at which the textual representation of the hyperlink ends. michael@0: michael@0: The returned value is related to the IAccessibleText interface of the object that michael@0: owns this hyperlink. The character at the index is not part of the hypertext. michael@0: @param [out] index michael@0: @retval S_OK michael@0: */ michael@0: [propget] HRESULT endIndex michael@0: ( michael@0: [out, retval] long *index michael@0: ); michael@0: michael@0: /** @brief Returns whether the target object referenced by this link is still valid. michael@0: michael@0: This is a volatile state that may change without sending an appropriate event. michael@0: Returns TRUE if the referenced target is still valid and FALSE otherwise. michael@0: michael@0: This has also been used to indicate whether or not the URI of the anchorTarget michael@0: is malformed. michael@0: michael@0: @param [out] valid michael@0: If false, one or more of the object's links are invalid. michael@0: If true, all of the object's links are valid. michael@0: @retval S_OK michael@0: @retval S_FALSE if there is nothing to return, [out] value is FALSE michael@0: @note This method is not being used, is deprecated, and should not be implemented or michael@0: used. It is likely that this method will be removed in a later version of the IDL. michael@0: */ michael@0: [propget] HRESULT valid michael@0: ( michael@0: [out, retval] boolean *valid michael@0: ); michael@0: }