/*************************************************************************
 *
 *  File Name (AccessibleHyperlink.idl)
 *
 *  IAccessible2 IDL Specification
 *
 *  Copyright (c) IBM Corp. 2006
 *  Copyright (c) Sun Microsystems, Inc. 2000, 2006
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License version 2.1, as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02110-1301  USA
 *
 ************************************************************************/

import "objidl.idl";
import "oaidl.idl";
import "oleacc.idl";
import "AccessibleAction.idl";

/** @brief 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 indicates 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.
*/
[object, uuid(01C20F2B-3DD2-400f-949F-AD00BDAB1D41)]
interface IAccessibleHyperlink : IAccessibleAction
{

  /** @brief Returns an object that represents the link anchor, as appropriate
   for the link at the specified index.       
   @param [in] index
    A 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.
   @param [out] anchor
    This is an implementation dependent value.  For example, for a text link this 
	method could return the substring of the containing string where the subsgtring
	is overridden with link behavior, and for an image link this method could return 
	an IUnknown VARIANT for IAccessibleImage.
  */
  [propget] HRESULT anchor
    (
     [in] long index,
     [out, retval] VARIANT *anchor
    );

  /** @brief Returns an object representing the target of the link, as appropriate
   for the link at the specified index.       
   @param [in] index
    A 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.
   @param [out] anchorTarget
    This 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.
  */
  [propget] HRESULT anchorTarget
    (
     [in] long index,
     [out, retval] VARIANT *anchorTarget
    );

  /** @brief Returns the index 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. 
   @param [out] index
  */
  [propget] HRESULT startIndex
    (
     [out, retval] long *index
    );

  /** @brief Returns the index at which the textual rerpesentation 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.  
   @param [out] index
  */
  [propget] HRESULT endIndex
    (
     [out, retval] long *index
    );

  /** @brief 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.

   @param [out] valid
  */
  [propget] HRESULT valid
    (
     [out, retval] boolean *valid
    );
}
