1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_accessibility_XAccessibleHypertext_idl__
25#define __com_sun_star_accessibility_XAccessibleHypertext_idl__
26
27#ifndef __com_sun_star_uno_XInterface_idl__
28#include <com/sun/star/uno/XInterface.idl>
29#endif
30#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
31#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
32#endif
33#ifndef __com_sun_star_accessibility_XAccessibleText_idl__
34#include <com/sun/star/accessibility/XAccessibleText.idl>
35#endif
36
37module com { module sun { module star { module accessibility {
38
39 published interface XAccessibleHyperlink;
40
41
42/** Implement this interface to expose the hypertext structure of a document.
43
44    <p>The <type>XAccessibleHypertext</type> interface is the main interface
45    to expose hyperlinks in a document, typically a text document, that are
46    used to reference other (parts of) documents.  For supporting the
47    <member>XAccessibleHypertext::getLinkIndex</member> method of this
48    interface and other character related methods of the
49    <type>XAccessibleHyperlink</type> interface, it is necessary to also
50    support the <type>XAccessibleText</type> interface.</p>
51
52    @see XAccessibleHyperlink, XAccessibleText
53
54    @since OpenOffice 1.1.2
55*/
56published interface XAccessibleHypertext
57    : ::com::sun::star::accessibility::XAccessibleText
58{
59    /** Returns the number of links and link groups contained within this
60        hypertext document.
61
62        @return
63            The number of links and link groups within this hypertext
64            document.  Returns 0 if there is no link.
65    */
66    long getHyperLinkCount ();
67
68    /** Return the specified link.
69
70        <p>The returned <type>XAccessibleHyperlink</type> object
71        encapsulates the hyperlink and provides several kinds of information
72        describing it.</p>
73
74        @param nLinkIndex
75            This index specifies the hyperlink to return.
76
77        @return
78            If the given index is valid, i.e. lies in the intervall from 0
79            to the number of links minus one, a reference to the specified
80            hyperlink object is returned.  If the index is invalid then an
81            empty reference is returned.
82    */
83    XAccessibleHyperlink getHyperLink ([in] long nLinkIndex)
84        raises (::com::sun::star::lang::IndexOutOfBoundsException);
85
86
87    /** Returns the index of the hyperlink that is associated with this
88        character index.
89
90        <p>In a HTML document this is the case when a &lt;a href&gt; tag
91        spans (includes) the given character index.</p>
92
93        @param nCharIndex
94            Index of the character for which to return the link index.  If
95            the <type>XAccessibleText</type> interface is used to represent
96            the text containting the link, then the character index is only
97            valid if it is greater than or equal to zero and lower then the
98            number of characters in the text.  See that interface's
99            documentation for more details.
100
101        @return
102            Returns the index of the hyperlink that is associated with this
103            character index, or throws an exception if there is no hyperlink
104            associated with this index.
105
106        @see XAccessibleText.
107    */
108    long getHyperLinkIndex ([in] long nCharIndex)
109        raises (::com::sun::star::lang::IndexOutOfBoundsException);
110};
111
112}; }; }; };
113
114#endif
115