1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XSimpleText.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_text_XSimpleText_idl__
31 #define __com_sun_star_text_XSimplText_idl__
33 #ifndef __com_sun_star_text_XTextRange_idl__
34 #include
<com
/sun
/star
/text
/XTextRange.idl
>
37 #ifndef __com_sun_star_text_XTextCursor_idl__
38 #include
<com
/sun
/star
/text
/XTextCursor.idl
>
41 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
42 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
45 #ifndef __com_sun_star_text_XTextContent_idl__
46 #include
<com
/sun
/star
/text
/XTextContent.idl
>
49 #ifndef __com_sun_star_container_NoSuchElementException_idl__
50 #include
<com
/sun
/star
/container
/NoSuchElementException.idl
>
54 //=============================================================================
56 module com
{ module sun
{ module star
{ module text
{
58 //=============================================================================
60 /** is the main interface for a distinct text unit, i.e. the main text of
61 a document, the text for headers and footers or for single cells of a
64 published
interface XSimpleText
: com
::sun
::star
::text
::XTextRange
66 //-------------------------------------------------------------------------
69 a new instance of a <type>TextCursor</type> service which can
70 be used to travel in the given text context.
72 @see com::sun::star::text::TextCursor
74 com
::sun
::star
::text
::XTextCursor createTextCursor
();
76 //-------------------------------------------------------------------------
79 a new instance of a <type>TextCursor</type> which is located
80 at the specified <type>TextRange</type> to travel in the
83 <p>The initial position is set to <var>aTextPosition</var>.
86 specifies the start position for the new
87 <type>TextCursor</type>.
89 @see com::sun::star::text::TextCursor
91 com
::sun
::star
::text
::XTextCursor createTextCursorByRange
( [in] com
::sun
::star
::text
::XTextRange aTextPosition
);
93 //-------------------------------------------------------------------------
95 /** inserts a string of characters into the text.
97 <p>The string may contain the following white spaces:
102 <li>cr (which will insert a paragraph break)</li>
103 <li>lf (which will insert a line break)</li>
107 specifies the position of insertion. For example,
108 <method>XSimpleText::createTextCursor</member> can be used to
109 get an <type>XTextRange</type> for this argument.
111 <p>If the parameter <member>bAbsorb</member> was <TRUE/>
112 the text range will contain the new inserted string, otherwise
113 the range (and it's text) will remain unchanged.
116 specifies the string to insert.
119 specifies whether the text spanned by <var>xRange</var> will be
120 replaced. If <TRUE/> then the content of <var>xRange</var> will
121 be replaced by <var>aString</var>, otherwise <var>aString</var>
122 will be inserted at the beginning of <var>xRange</var>.
126 xText.insertString( xTextCursor, "Hello " + aName$ + ",", false )
128 xText.insertControlCharacter( xTextCursor,
129 ControlCharacter_PARAGRAPH_BREAK, false );
131 xText.insertString( xTextCursor, "more text ...", false )
134 [oneway
] void insertString
( [in] com
::sun
::star
::text
::XTextRange xRange
,
136 [in] boolean bAbsorb
);
138 //-------------------------------------------------------------------------
140 /** inserts a control character (like a paragraph break or a hard
141 space) into the text.@see com::sun::star::text::ControlCharacter
143 void insertControlCharacter
( [in] com
::sun
::star
::text
::XTextRange xRange
,
144 [in] short nControlCharacter
,
145 [in] boolean bAbsorb
)
146 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
150 //=============================================================================