Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / text / XSimpleText.idl
blobf9333918015ca1eb351250c1364b1cfbb3642e55
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef __com_sun_star_text_XSimpleText_idl__
20 #define __com_sun_star_text_XSimpleText_idl__
22 #include <com/sun/star/text/XTextRange.idl>
24 #include <com/sun/star/text/XTextCursor.idl>
26 #include <com/sun/star/lang/IllegalArgumentException.idl>
28 #include <com/sun/star/text/XTextContent.idl>
30 #include <com/sun/star/container/NoSuchElementException.idl>
34 module com { module sun { module star { module text {
37 /** is the main interface for a distinct text unit, i.e. the main text of
38 a document, the text for headers and footers or for single cells of a
39 table.@see XText
41 published interface XSimpleText: com::sun::star::text::XTextRange
44 /** @returns
45 a new instance of a TextCursor service which can
46 be used to travel in the given text context.
48 @see com::sun::star::text::TextCursor
50 com::sun::star::text::XTextCursor createTextCursor();
53 /** @returns
54 a new instance of a TextCursor which is located
55 at the specified TextRange to travel in the
56 given text context.
58 <p>The initial position is set to <var>aTextPosition</var>.
60 @param aTextPosition
61 specifies the start position for the new
62 TextCursor.
64 @see com::sun::star::text::TextCursor
66 com::sun::star::text::XTextCursor createTextCursorByRange( [in] com::sun::star::text::XTextRange aTextPosition );
69 /** inserts a string of characters into the text.
71 <p>The string may contain the following white spaces:
72 </p>
73 <ul>
74 <li>blank</li>
75 <li>tab</li>
76 <li>cr (which will insert a paragraph break)</li>
77 <li>lf (which will insert a line break)</li>
78 </ul>
80 @param xRange
81 specifies the position of insertion. For example,
82 XSimpleText::createTextCursor() can be used to
83 get an XTextRange for this argument.
85 <p>If the parameter bAbsorb() was `TRUE`
86 the text range will contain the new inserted string, otherwise
87 the range (and it's text) will remain unchanged.
89 @param aString
90 specifies the string to insert.
92 @param bAbsorb
93 specifies whether the text spanned by <var>xRange</var> will be
94 replaced. If `TRUE` then the content of <var>xRange</var> will
95 be replaced by <var>aString</var>, otherwise <var>aString</var>
96 will be inserted at the beginning of <var>xRange</var>.
98 @code{.java}
99 xText.insertString( xTextCursor, "Hello " + aName + ",", false )
101 xText.insertControlCharacter( xTextCursor,
102 ControlCharacter.PARAGRAPH_BREAK, false );
104 xText.insertString( xTextCursor, "more text ...", false )
105 @endcode
107 void insertString( [in] com::sun::star::text::XTextRange xRange,
108 [in] string aString,
109 [in] boolean bAbsorb );
112 /** inserts a control character (like a paragraph break or a hard
113 space) into the text.@see com::sun::star::text::ControlCharacter
115 void insertControlCharacter( [in] com::sun::star::text::XTextRange xRange,
116 [in] short nControlCharacter,
117 [in] boolean bAbsorb )
118 raises( com::sun::star::lang::IllegalArgumentException );
123 }; }; }; };
125 #endif
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */