1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef __com_sun_star_text_XSimpleText_idl__
28 #define __com_sun_star_text_XSimplText_idl__
30 #ifndef __com_sun_star_text_XTextRange_idl__
31 #include
<com
/sun
/star
/text
/XTextRange.idl
>
34 #ifndef __com_sun_star_text_XTextCursor_idl__
35 #include
<com
/sun
/star
/text
/XTextCursor.idl
>
38 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
39 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
42 #ifndef __com_sun_star_text_XTextContent_idl__
43 #include
<com
/sun
/star
/text
/XTextContent.idl
>
46 #ifndef __com_sun_star_container_NoSuchElementException_idl__
47 #include
<com
/sun
/star
/container
/NoSuchElementException.idl
>
51 //=============================================================================
53 module com
{ module sun
{ module star
{ module text
{
55 //=============================================================================
57 /** is the main interface for a distinct text unit, i.e. the main text of
58 a document, the text for headers and footers or for single cells of a
61 published
interface XSimpleText
: com
::sun
::star
::text
::XTextRange
63 //-------------------------------------------------------------------------
66 a new instance of a <type>TextCursor</type> service which can
67 be used to travel in the given text context.
69 @see com::sun::star::text::TextCursor
71 com
::sun
::star
::text
::XTextCursor createTextCursor
();
73 //-------------------------------------------------------------------------
76 a new instance of a <type>TextCursor</type> which is located
77 at the specified <type>TextRange</type> to travel in the
80 <p>The initial position is set to <var>aTextPosition</var>.
83 specifies the start position for the new
84 <type>TextCursor</type>.
86 @see com::sun::star::text::TextCursor
88 com
::sun
::star
::text
::XTextCursor createTextCursorByRange
( [in] com
::sun
::star
::text
::XTextRange aTextPosition
);
90 //-------------------------------------------------------------------------
92 /** inserts a string of characters into the text.
94 <p>The string may contain the following white spaces:
99 <li>cr (which will insert a paragraph break)</li>
100 <li>lf (which will insert a line break)</li>
104 specifies the position of insertion. For example,
105 <method>XSimpleText::createTextCursor</member> can be used to
106 get an <type>XTextRange</type> for this argument.
108 <p>If the parameter <member>bAbsorb</member> was <TRUE/>
109 the text range will contain the new inserted string, otherwise
110 the range (and it's text) will remain unchanged.
113 specifies the string to insert.
116 specifies whether the text spanned by <var>xRange</var> will be
117 replaced. If <TRUE/> then the content of <var>xRange</var> will
118 be replaced by <var>aString</var>, otherwise <var>aString</var>
119 will be inserted at the beginning of <var>xRange</var>.
123 xText.insertString( xTextCursor, "Hello " + aName$ + ",", false )
125 xText.insertControlCharacter( xTextCursor,
126 ControlCharacter_PARAGRAPH_BREAK, false );
128 xText.insertString( xTextCursor, "more text ...", false )
131 [oneway
] void insertString
( [in] com
::sun
::star
::text
::XTextRange xRange
,
133 [in] boolean bAbsorb
);
135 //-------------------------------------------------------------------------
137 /** inserts a control character (like a paragraph break or a hard
138 space) into the text.@see com::sun::star::text::ControlCharacter
140 void insertControlCharacter
( [in] com
::sun
::star
::text
::XTextRange xRange
,
141 [in] short nControlCharacter
,
142 [in] boolean bAbsorb
)
143 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
147 //=============================================================================