1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir
28*cdf0e10cSrcweir#ifndef __com_sun_star_accessibility_XAccessibleMultiLineText_idl__
29*cdf0e10cSrcweir#define __com_sun_star_accessibility_XAccessibleMultiLineText_idl__
30*cdf0e10cSrcweir
31*cdf0e10cSrcweir#ifndef __com_sun_star_accessibility_XAccessibleText_idl__
32*cdf0e10cSrcweir#include <com/sun/star/accessibility/XAccessibleText.idl>
33*cdf0e10cSrcweir#endif
34*cdf0e10cSrcweir#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
35*cdf0e10cSrcweir#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
36*cdf0e10cSrcweir#endif
37*cdf0e10cSrcweir#ifndef __com_sun_star_beans_PropertyValue_idl__
38*cdf0e10cSrcweir#include <com/sun/star/beans/PropertyValue.idl>
39*cdf0e10cSrcweir#endif
40*cdf0e10cSrcweir
41*cdf0e10cSrcweirmodule com { module sun { module star { module accessibility {
42*cdf0e10cSrcweir
43*cdf0e10cSrcweir/** Implement this interface to give provide a mapping between text index
44*cdf0e10cSrcweir    and line numbers.
45*cdf0e10cSrcweir
46*cdf0e10cSrcweir    <p>This interface is typically used in conjunction with the
47*cdf0e10cSrcweir    <type>XAccessibleText</type> interface and extents it with a notion
48*cdf0e10cSrcweir    of line numbers</p>
49*cdf0e10cSrcweir
50*cdf0e10cSrcweir    @since OOo 3.0
51*cdf0e10cSrcweir*/
52*cdf0e10cSrcweir
53*cdf0e10cSrcweir/// not yet published
54*cdf0e10cSrcweirinterface XAccessibleMultiLineText
55*cdf0e10cSrcweir    : ::com::sun::star::accessibility::XAccessibleText
56*cdf0e10cSrcweir{
57*cdf0e10cSrcweir    /** Returns the line number at the specified index.
58*cdf0e10cSrcweir
59*cdf0e10cSrcweir        <p>For a text object that is spread over multiple lines, this method
60*cdf0e10cSrcweir        provides a mapping from a text index to the corresponding line number.
61*cdf0e10cSrcweir        </p>
62*cdf0e10cSrcweir
63*cdf0e10cSrcweir        @param nIndex
64*cdf0e10cSrcweir            Index for which the line number should be returned.
65*cdf0e10cSrcweir            The valid range is 0..length.
66*cdf0e10cSrcweir
67*cdf0e10cSrcweir        @return
68*cdf0e10cSrcweir            Returns the line number of the specified text index.
69*cdf0e10cSrcweir
70*cdf0e10cSrcweir        @throws ::com::sun::star::lang::IndexOutOfBoundsException
71*cdf0e10cSrcweir            if the index is invalid.
72*cdf0e10cSrcweir    */
73*cdf0e10cSrcweir    long getLineNumberAtIndex([in] long nIndex)
74*cdf0e10cSrcweir        raises (::com::sun::star::lang::IndexOutOfBoundsException);
75*cdf0e10cSrcweir
76*cdf0e10cSrcweir    /** Retuns the text of the specified line.
77*cdf0e10cSrcweir
78*cdf0e10cSrcweir        <p>Returns the substring of text that makes up the specified line
79*cdf0e10cSrcweir        number.</p>
80*cdf0e10cSrcweir
81*cdf0e10cSrcweir        <p>The number of lines can be obtained by calling
82*cdf0e10cSrcweir        <member>XAccessibleMultiLineText::getLineNumberAtIndex</member>
83*cdf0e10cSrcweir        with the index of the last character. In a loop, the last line
84*cdf0e10cSrcweir        has been reached when <member>TextSegment::SegmentEnd</member>
85*cdf0e10cSrcweir        of the returned value is equal to the index of the last
86*cdf0e10cSrcweir        character of the text.</p>
87*cdf0e10cSrcweir
88*cdf0e10cSrcweir        @param nLineNo
89*cdf0e10cSrcweir            The number of the line to return the substring from.
90*cdf0e10cSrcweir            The valid range is 0..getLineNumberAtIndex(getCharacterCount()).
91*cdf0e10cSrcweir
92*cdf0e10cSrcweir        @return
93*cdf0e10cSrcweir            Returns the requested text portion.  This portion may be empty
94*cdf0e10cSrcweir            or invalid when no appropriate text portion is found.
95*cdf0e10cSrcweir
96*cdf0e10cSrcweir        @throws ::com::sun::star::lang::IndexOutOfBoundsException
97*cdf0e10cSrcweir            if the line number is invalid
98*cdf0e10cSrcweir    */
99*cdf0e10cSrcweir
100*cdf0e10cSrcweir    TextSegment getTextAtLineNumber([in] long nLineNo)
101*cdf0e10cSrcweir        raises (::com::sun::star::lang::IndexOutOfBoundsException);
102*cdf0e10cSrcweir
103*cdf0e10cSrcweir    /** Returns the text of the line in which the caret is located.
104*cdf0e10cSrcweir
105*cdf0e10cSrcweir        <p>The substring returned will most of the time be identical to
106*cdf0e10cSrcweir        calling <member>XAccessibleText::getTextAtIndex</member> with
107*cdf0e10cSrcweir        the index returned by <member>XAccessibleText::getCaretPosition</member>
108*cdf0e10cSrcweir        and type  <const scope="AccessibleTextType">LINE</type> beside the
109*cdf0e10cSrcweir        following special case:</p>
110*cdf0e10cSrcweir
111*cdf0e10cSrcweir        <p>Some text implementations place the caret at the end of the current
112*cdf0e10cSrcweir        line when the <b>End</b> key gets pressed. Since the index of this position
113*cdf0e10cSrcweir        is identical to the one of the first character of the following line,
114*cdf0e10cSrcweir        <member>XAccessibleMultiLineText::getLineNumberAtIndex</member> will
115*cdf0e10cSrcweir        return the line following the current one in this case.</p>
116*cdf0e10cSrcweir
117*cdf0e10cSrcweir        @return
118*cdf0e10cSrcweir            Returns the requested text portion. This portion may be empty
119*cdf0e10cSrcweir            or invalid if the paragraph object does not have a valid caret
120*cdf0e10cSrcweir            position.
121*cdf0e10cSrcweir    */
122*cdf0e10cSrcweir
123*cdf0e10cSrcweir    TextSegment getTextAtLineWithCaret();
124*cdf0e10cSrcweir
125*cdf0e10cSrcweir    /** Returns the number of the line in which the caret is located.
126*cdf0e10cSrcweir
127*cdf0e10cSrcweir        <p>The line number returned will most of the time be identical to
128*cdf0e10cSrcweir        calling <member>XAccessibleMultiLineText::getLineNumberAtIndex</member>
129*cdf0e10cSrcweir        with the index returned by <member>XAccessibleText::getCaretPosition</member>
130*cdf0e10cSrcweir        beside the following special case:</p>
131*cdf0e10cSrcweir
132*cdf0e10cSrcweir        <p>Some text implementations place the caret at the end of the current
133*cdf0e10cSrcweir        line when the <b>End</b> key gets pressed. Since the index of this position
134*cdf0e10cSrcweir        is identical to the one of the first character of the following line,
135*cdf0e10cSrcweir        <member>XAccessibleMultiLineText::getLineNumberAtIndex</member> will
136*cdf0e10cSrcweir        return the line following the current one in this case.</p>
137*cdf0e10cSrcweir
138*cdf0e10cSrcweir        @return
139*cdf0e10cSrcweir            Returns the index of the line in which the caret is located or -1
140*cdf0e10cSrcweir            if the paragraph does not have a valid caret position.
141*cdf0e10cSrcweir    */
142*cdf0e10cSrcweir
143*cdf0e10cSrcweir    long getNumberOfLineWithCaret();
144*cdf0e10cSrcweir};
145*cdf0e10cSrcweir
146*cdf0e10cSrcweir}; }; }; };
147*cdf0e10cSrcweir
148*cdf0e10cSrcweir#endif
149