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_XAccessibleTextMarkup_idl__
29#define __com_sun_star_accessibility_XAccessibleTextMarkup_idl__
30
31#ifndef __com_sun_star_uno_XInterface_idl__
32#include <com/sun/star/uno/XInterface.idl>
33#endif
34#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
35#include <com/sun/star/lang/IllegalArgumentException.idl>
36#endif
37#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
38#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
39#endif
40#ifndef __com_sun_star_accessibility_XAccessibleText_idl__
41#include <com/sun/star/accessibility/XAccessibleText.idl>
42#endif
43#ifndef __com_sun_star_accessibility_TextSegment_idl__
44#include <com/sun/star/accessibility/TextSegment.idl>
45#endif
46
47module com { module sun { module star { module accessibility {
48
49 interface XAccessibleTextMarkup;
50
51
52/** Implement this interface to expose the text markups of a text.
53
54    <p>The <type>XAccessibleTextMarkup</type> interface is the main interface
55    to expose text markups in a text, typically of a text document, that are
56    used to reference other (parts of) documents. For supporting the
57    <member>XAccessibleTextMarkup::getTextMarkupIndex</member> method of this
58    interface and other character related methods of the
59    <type>XAccessibleTextMarkup</type> interface, it is necessary to also
60    support the <type>XAccessibleText</type> interface.</p>
61
62    @see XAccessibleText
63
64    @since OOo 3.0
65*/
66interface XAccessibleTextMarkup
67    : ::com::sun::star::accessibility::XAccessibleText
68{
69    /** Returns the number of text markup of the given text markup type
70        of a text.
71
72        <p>Throws <type>IllegalArgumentException</type>, if given text
73        markup type is out of valid range.</p>
74
75        @param TextMarkupType
76            This specifies the type of text markups, whose count should
77            be returned - see <type>TextMarkupType</type>.
78
79        @return
80            The number of text markup of the given text markup type.
81            Returns 0 if there is no text markup.
82    */
83    long getTextMarkupCount ( [in] long TextMarkupType )
84        raises (::com::sun::star::lang::IllegalArgumentException);
85
86    /** Returns the text segment of the text markup of the given index and
87        of the given text mark type
88
89        <p>Throws <type>IndexOutOfBoundsException</type>, if given index
90        is out of valid range.</p>
91        <p>Throws <type>IllegalArgumentException</type>, if given text
92        markup type is out of valid range.</p>
93
94        @param TextMarkupIndex
95            This index specifies the text markup to return.
96
97        @param TextMarkupType
98            This specifies the type of the text markup to be returned - see
99            <type>TextMarkupType</type>.
100
101        @return
102            If the given index is in range [0..getTextMarkupCount(TextMarkupType)-1],
103            the text segment - see <type>TextSegment</type> - of the text markup
104            of the given text markup type is returned.
105    */
106    TextSegment getTextMarkup ( [in] long TextMarkupIndex,
107                                [in] long TextMarkupType )
108        raises (::com::sun::star::lang::IndexOutOfBoundsException,
109                ::com::sun::star::lang::IllegalArgumentException);
110
111    /** returns a sequence of the text segments of the text markups at the given
112        character index and of the given text markup type.
113
114        <p>Throws <type>IndexOutOfBoundsException</type>, if given character
115        index is out of range [0..number of characters in the text).</p>
116        <p>Throws <type>IllegalArgumentException</type>, if given text
117        markup type is out of valid range.</p>
118
119        @param CharIndex
120            This index specifies the character index in the text.
121
122        @param TextMarkupType
123            This specifies the type of the text markups to be returned - see
124            <type>TextMarkupType</type>.
125
126        @return
127            If character index is in range [0..number of characters in the text-1],
128            a seguence of <type>TextSegment</type>s of the text markups at
129            given character index of the given text markup type are returned.
130            The sequence is empty, if no such text markup is found.
131    */
132    sequence<TextSegment> getTextMarkupAtIndex ( [in] long CharIndex,
133                                                 [in] long TextMarkupType )
134        raises (::com::sun::star::lang::IndexOutOfBoundsException,
135                ::com::sun::star::lang::IllegalArgumentException);
136};
137
138}; }; }; };
139
140#endif
141