1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27
28#ifndef __com_sun_star_accessibility_XAccessibleHyperlink_idl__
29#define __com_sun_star_accessibility_XAccessibleHyperlink_idl__
30
31#ifndef __com_sun_star_accessibility_XAccessibleAction_idl__
32#include <com/sun/star/accessibility/XAccessibleAction.idl>
33#endif
34#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
35#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
36#endif
37
38module com { module sun { module star { module accessibility {
39
40/** Implement this interface to represent a hyperlink or a group of
41    hyperlinks.
42
43    <p>Single hyperlinks correspond to simple &lt;a href&gt; tags.  Groups
44    of hyperlinks are contained in client side image maps.  Linked objects
45    and anchors are implementation dependent.  This interface inherits the
46    <type>XAccessibleAction</type> interface.  Especially that interface's
47    <member>XAccessibleAction::getActionCount</member> method is needed to
48    obtain a maximum value for the indices passed to the
49    <member>XAccessibleHyperlink::getAccessibleActionAnchor</member> and
50    <member>XAccessibleHyperlink::getAccessibleActionObject</member>
51    methods.</p>
52
53    <p>Furhtermore, the object that implements this interface has to be
54    connected implicitely or explicitely with an object that implements the
55    the <type>XAccessibleText</type> interface.  The
56    <member>XAccessibleHyperlink::getStartIndex</member> and
57    <member>XAccessibleHyperlink::getEndIndex</member> methods return
58    indices with respect to the text exposed by that interface.</p>
59
60    @since OOo 1.1.2
61*/
62published interface XAccessibleHyperlink :
63    ::com::sun::star::accessibility::XAccessibleAction
64{
65    /** Returns an object that represents the link anchor, as appropriate
66        for that link.
67
68        <p>For an HTML link for example, this method would return the string
69        enclosed by the &lt&a href&gt; tag.</p>
70
71        @param nIndex
72            This index identifies the anchor when, as in the case of an
73            image map, there is more than one link represented by this
74            object.  The valid maximal index can be determinded by calling
75            the <member>XAccessibleAction::getActionCount</member> method.
76
77        @return
78            If the index is not valid then an exception is thrown.
79            Otherwise it returns an implementation dependent value.
80    */
81    any getAccessibleActionAnchor ([in] long nIndex)
82        raises (::com::sun::star::lang::IndexOutOfBoundsException);
83
84    /** Returns an object that represents the link anchor, as appropriate
85        for that link.
86
87        <p>For an HTML link for example, this method would return the URL of
88        the &lt&a href&gt; tag.</p>
89
90        @param nIndex
91            This index identifies the action object when, as in the case of
92            an image map, there is more than one link represented by this
93            object.  The valid maximal index can be determinded by calling
94            the <member>XAccessibleAction::getActionCount</member> method.
95
96        @return
97            If the index is not valid then an exception is thrown.
98            Otherwise it returns an implementation dependent value.
99    */
100    any getAccessibleActionObject ([in] long nIndex)
101        raises (::com::sun::star::lang::IndexOutOfBoundsException);
102
103    /** Returns the index at which the textual representation of the
104        hyperlink (group) starts.
105
106        <p>The returned value relates to the <type>XAccessibleText</type>
107        interface that ownes this hyperlink.</p>
108
109        @return
110            The index relates to the text exposed by the
111            <type>XAccessibleHypertext</type> interface.
112    */
113    long getStartIndex ();
114
115    /** Returns the index at which the textual rerpesentation of the
116        hyperlink (group) ends.
117
118        <p>The returned value relates to the <type>XAccessibleText</type>
119        interface that ownes this hyperlink.</p>
120
121        @return
122            The index relates to the text exposed by the
123            <type>XAccessibleText</type> interface.
124    */
125    long getEndIndex ();
126
127    /** Returns whether the document referenced by this links is
128        still valid.
129
130        <p>This is a volatile state that may change without further warning
131        like e.g. sending an appropriate event.</p>
132
133        @return
134            Returns <TRUE/> if the referenced document is still valid and
135            <FALSE/> otherwise.
136    */
137    boolean isValid ();
138};
139
140}; }; }; };
141
142#endif
143