1/************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 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. 14 * 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). 20 * 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. 25 * 26 ************************************************************************/ 27#ifndef __com_sun_star_text_XSimpleText_idl__ 28#define __com_sun_star_text_XSimplText_idl__ 29 30#ifndef __com_sun_star_text_XTextRange_idl__ 31#include <com/sun/star/text/XTextRange.idl> 32#endif 33 34#ifndef __com_sun_star_text_XTextCursor_idl__ 35#include <com/sun/star/text/XTextCursor.idl> 36#endif 37 38#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 39#include <com/sun/star/lang/IllegalArgumentException.idl> 40#endif 41 42#ifndef __com_sun_star_text_XTextContent_idl__ 43#include <com/sun/star/text/XTextContent.idl> 44#endif 45 46#ifndef __com_sun_star_container_NoSuchElementException_idl__ 47#include <com/sun/star/container/NoSuchElementException.idl> 48#endif 49 50 51//============================================================================= 52 53 module com { module sun { module star { module text { 54 55//============================================================================= 56 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 59 table.@see XText 60 */ 61published interface XSimpleText: com::sun::star::text::XTextRange 62{ 63 //------------------------------------------------------------------------- 64 65 /** @returns 66 a new instance of a <type>TextCursor</type> service which can 67 be used to travel in the given text context. 68 69 @see com::sun::star::text::TextCursor 70 */ 71 com::sun::star::text::XTextCursor createTextCursor(); 72 73 //------------------------------------------------------------------------- 74 75 /** @returns 76 a new instance of a <type>TextCursor</type> which is located 77 at the specified <type>TextRange</type> to travel in the 78 given text context. 79 80 <p>The initial position is set to <var>aTextPosition</var>. 81 82 @param aTextPosition 83 specifies the start position for the new 84 <type>TextCursor</type>. 85 86 @see com::sun::star::text::TextCursor 87 */ 88 com::sun::star::text::XTextCursor createTextCursorByRange( [in] com::sun::star::text::XTextRange aTextPosition ); 89 90 //------------------------------------------------------------------------- 91 92 /** inserts a string of characters into the text. 93 94 <p>The string may contain the following white spaces: 95 </p> 96 <ul> 97 <li>blank</li> 98 <li>tab</li> 99 <li>cr (which will insert a paragraph break)</li> 100 <li>lf (which will insert a line break)</li> 101 </ul> 102 103 @param xRange 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. 107 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. 111 112 @param aString 113 specifies the string to insert. 114 115 @param bAbsorb 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>. 120 121 @example 122 <listing> 123 xText.insertString( xTextCursor, "Hello " + aName$ + ",", false ) 124 125 xText.insertControlCharacter( xTextCursor, 126 ControlCharacter_PARAGRAPH_BREAK, false ); 127 128 xText.insertString( xTextCursor, "more text ...", false ) 129 </listing> 130 */ 131 [oneway] void insertString( [in] com::sun::star::text::XTextRange xRange, 132 [in] string aString, 133 [in] boolean bAbsorb ); 134 135 //------------------------------------------------------------------------- 136 137 /** inserts a control character (like a paragraph break or a hard 138 space) into the text.@see com::sun::star::text::ControlCharacter 139 */ 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 ); 144 145}; 146 147//============================================================================= 148 149}; }; }; }; 150 151#endif 152