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 .
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
41 published
interface XSimpleText
: com
::sun
::star
::text
::XTextRange
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
();
54 a new instance of a TextCursor which is located
55 at the specified TextRange to travel in the
58 <p>The initial position is set to <var>aTextPosition</var>.
61 specifies the start position for the new
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:
76 <li>cr (which will insert a paragraph break)</li>
77 <li>lf (which will insert a line break)</li>
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.
90 specifies the string to insert.
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>.
99 xText.insertString( xTextCursor, "Hello " + aName + ",", false )
101 xText.insertControlCharacter( xTextCursor,
102 ControlCharacter.PARAGRAPH_BREAK, false );
104 xText.insertString( xTextCursor, "more text ...", false )
107 void insertString
( [in] com
::sun
::star
::text
::XTextRange xRange
,
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
);
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */