1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __com_sun_star_accessibility_XAccessibleMultiLineText_idl__
21 #define __com_sun_star_accessibility_XAccessibleMultiLineText_idl__
23 #include
<com
/sun
/star
/accessibility
/XAccessibleText.idl
>
24 #include
<com
/sun
/star
/lang
/IndexOutOfBoundsException.idl
>
25 #include
<com
/sun
/star
/beans
/PropertyValue.idl
>
27 module com
{ module sun
{ module star
{ module accessibility
{
29 /** Implement this interface to give provide a mapping between text index
32 <p>This interface is typically used in conjunction with the
33 XAccessibleText interface and extents it with a notion
40 interface XAccessibleMultiLineText
41 : ::com
::sun
::star
::accessibility
::XAccessibleText
43 /** Returns the line number at the specified index.
45 <p>For a text object that is spread over multiple lines, this method
46 provides a mapping from a text index to the corresponding line number.
50 Index for which the line number should be returned.
51 The valid range is 0..length.
54 Returns the line number of the specified text index.
56 @throws ::com::sun::star::lang::IndexOutOfBoundsException
57 if the index is invalid.
59 long getLineNumberAtIndex
([in] long nIndex
)
60 raises
(::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
62 /** Returns the text of the specified line.
64 <p>Returns the substring of text that makes up the specified line
67 <p>The number of lines can be obtained by calling
68 XAccessibleMultiLineText::getLineNumberAtIndex()
69 with the index of the last character. In a loop, the last line
70 has been reached when TextSegment::SegmentEnd
71 of the returned value is equal to the index of the last
72 character of the text.</p>
75 The number of the line to return the substring from.
76 The valid range is 0..getLineNumberAtIndex(getCharacterCount()).
79 Returns the requested text portion. This portion may be empty
80 or invalid when no appropriate text portion is found.
82 @throws ::com::sun::star::lang::IndexOutOfBoundsException
83 if the line number is invalid
86 TextSegment getTextAtLineNumber
([in] long nLineNo
)
87 raises
(::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
89 /** Returns the text of the line in which the caret is located.
91 <p>The substring returned will most of the time be identical to
92 calling XAccessibleText::getTextAtIndex() with
93 the index returned by XAccessibleText::getCaretPosition()
94 and type AccessibleTextType::LINE beside the
95 following special case:</p>
97 <p>Some text implementations place the caret at the end of the current
98 line when the <b>End</b> key gets pressed. Since the index of this position
99 is identical to the one of the first character of the following line,
100 XAccessibleMultiLineText::getLineNumberAtIndex() will
101 return the line following the current one in this case.</p>
104 Returns the requested text portion. This portion may be empty
105 or invalid if the paragraph object does not have a valid caret
109 TextSegment getTextAtLineWithCaret
();
111 /** Returns the number of the line in which the caret is located.
113 <p>The line number returned will most of the time be identical to
114 calling XAccessibleMultiLineText::getLineNumberAtIndex()
115 with the index returned by XAccessibleText::getCaretPosition()
116 beside the following special case:</p>
118 <p>Some text implementations place the caret at the end of the current
119 line when the <b>End</b> key gets pressed. Since the index of this position
120 is identical to the one of the first character of the following line,
121 XAccessibleMultiLineText::getLineNumberAtIndex() will
122 return the line following the current one in this case.</p>
125 Returns the index of the line in which the caret is located or -1
126 if the paragraph does not have a valid caret position.
129 long getNumberOfLineWithCaret
();
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */