1*d1766043SAndrew Rist/************************************************************** 2cdf0e10cSrcweir * 3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*d1766043SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*d1766043SAndrew Rist * distributed with this work for additional information 6*d1766043SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance 9*d1766043SAndrew Rist * with the License. You may obtain a copy of the License at 10*d1766043SAndrew Rist * 11*d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*d1766043SAndrew Rist * 13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*d1766043SAndrew Rist * software distributed under the License is distributed on an 15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*d1766043SAndrew Rist * KIND, either express or implied. See the License for the 17*d1766043SAndrew Rist * specific language governing permissions and limitations 18*d1766043SAndrew Rist * under the License. 19*d1766043SAndrew Rist * 20*d1766043SAndrew Rist *************************************************************/ 21*d1766043SAndrew Rist 22*d1766043SAndrew Rist 23cdf0e10cSrcweir#ifndef __com_sun_star_text_XSimpleText_idl__ 24cdf0e10cSrcweir#define __com_sun_star_text_XSimplText_idl__ 25cdf0e10cSrcweir 26cdf0e10cSrcweir#ifndef __com_sun_star_text_XTextRange_idl__ 27cdf0e10cSrcweir#include <com/sun/star/text/XTextRange.idl> 28cdf0e10cSrcweir#endif 29cdf0e10cSrcweir 30cdf0e10cSrcweir#ifndef __com_sun_star_text_XTextCursor_idl__ 31cdf0e10cSrcweir#include <com/sun/star/text/XTextCursor.idl> 32cdf0e10cSrcweir#endif 33cdf0e10cSrcweir 34cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 35cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl> 36cdf0e10cSrcweir#endif 37cdf0e10cSrcweir 38cdf0e10cSrcweir#ifndef __com_sun_star_text_XTextContent_idl__ 39cdf0e10cSrcweir#include <com/sun/star/text/XTextContent.idl> 40cdf0e10cSrcweir#endif 41cdf0e10cSrcweir 42cdf0e10cSrcweir#ifndef __com_sun_star_container_NoSuchElementException_idl__ 43cdf0e10cSrcweir#include <com/sun/star/container/NoSuchElementException.idl> 44cdf0e10cSrcweir#endif 45cdf0e10cSrcweir 46cdf0e10cSrcweir 47cdf0e10cSrcweir//============================================================================= 48cdf0e10cSrcweir 49cdf0e10cSrcweir module com { module sun { module star { module text { 50cdf0e10cSrcweir 51cdf0e10cSrcweir//============================================================================= 52cdf0e10cSrcweir 53cdf0e10cSrcweir/** is the main interface for a distinct text unit, i.e. the main text of 54cdf0e10cSrcweir a document, the text for headers and footers or for single cells of a 55cdf0e10cSrcweir table.@see XText 56cdf0e10cSrcweir */ 57cdf0e10cSrcweirpublished interface XSimpleText: com::sun::star::text::XTextRange 58cdf0e10cSrcweir{ 59cdf0e10cSrcweir //------------------------------------------------------------------------- 60cdf0e10cSrcweir 61cdf0e10cSrcweir /** @returns 62cdf0e10cSrcweir a new instance of a <type>TextCursor</type> service which can 63cdf0e10cSrcweir be used to travel in the given text context. 64cdf0e10cSrcweir 65cdf0e10cSrcweir @see com::sun::star::text::TextCursor 66cdf0e10cSrcweir */ 67cdf0e10cSrcweir com::sun::star::text::XTextCursor createTextCursor(); 68cdf0e10cSrcweir 69cdf0e10cSrcweir //------------------------------------------------------------------------- 70cdf0e10cSrcweir 71cdf0e10cSrcweir /** @returns 72cdf0e10cSrcweir a new instance of a <type>TextCursor</type> which is located 73cdf0e10cSrcweir at the specified <type>TextRange</type> to travel in the 74cdf0e10cSrcweir given text context. 75cdf0e10cSrcweir 76cdf0e10cSrcweir <p>The initial position is set to <var>aTextPosition</var>. 77cdf0e10cSrcweir 78cdf0e10cSrcweir @param aTextPosition 79cdf0e10cSrcweir specifies the start position for the new 80cdf0e10cSrcweir <type>TextCursor</type>. 81cdf0e10cSrcweir 82cdf0e10cSrcweir @see com::sun::star::text::TextCursor 83cdf0e10cSrcweir */ 84cdf0e10cSrcweir com::sun::star::text::XTextCursor createTextCursorByRange( [in] com::sun::star::text::XTextRange aTextPosition ); 85cdf0e10cSrcweir 86cdf0e10cSrcweir //------------------------------------------------------------------------- 87cdf0e10cSrcweir 88cdf0e10cSrcweir /** inserts a string of characters into the text. 89cdf0e10cSrcweir 90cdf0e10cSrcweir <p>The string may contain the following white spaces: 91cdf0e10cSrcweir </p> 92cdf0e10cSrcweir <ul> 93cdf0e10cSrcweir <li>blank</li> 94cdf0e10cSrcweir <li>tab</li> 95cdf0e10cSrcweir <li>cr (which will insert a paragraph break)</li> 96cdf0e10cSrcweir <li>lf (which will insert a line break)</li> 97cdf0e10cSrcweir </ul> 98cdf0e10cSrcweir 99cdf0e10cSrcweir @param xRange 100cdf0e10cSrcweir specifies the position of insertion. For example, 101cdf0e10cSrcweir <method>XSimpleText::createTextCursor</member> can be used to 102cdf0e10cSrcweir get an <type>XTextRange</type> for this argument. 103cdf0e10cSrcweir 104cdf0e10cSrcweir <p>If the parameter <member>bAbsorb</member> was <TRUE/> 105cdf0e10cSrcweir the text range will contain the new inserted string, otherwise 106cdf0e10cSrcweir the range (and it's text) will remain unchanged. 107cdf0e10cSrcweir 108cdf0e10cSrcweir @param aString 109cdf0e10cSrcweir specifies the string to insert. 110cdf0e10cSrcweir 111cdf0e10cSrcweir @param bAbsorb 112cdf0e10cSrcweir specifies whether the text spanned by <var>xRange</var> will be 113cdf0e10cSrcweir replaced. If <TRUE/> then the content of <var>xRange</var> will 114cdf0e10cSrcweir be replaced by <var>aString</var>, otherwise <var>aString</var> 115cdf0e10cSrcweir will be inserted at the beginning of <var>xRange</var>. 116cdf0e10cSrcweir 117cdf0e10cSrcweir @example 118cdf0e10cSrcweir <listing> 119cdf0e10cSrcweir xText.insertString( xTextCursor, "Hello " + aName$ + ",", false ) 120cdf0e10cSrcweir 121cdf0e10cSrcweir xText.insertControlCharacter( xTextCursor, 122cdf0e10cSrcweir ControlCharacter_PARAGRAPH_BREAK, false ); 123cdf0e10cSrcweir 124cdf0e10cSrcweir xText.insertString( xTextCursor, "more text ...", false ) 125cdf0e10cSrcweir </listing> 126cdf0e10cSrcweir */ 127cdf0e10cSrcweir [oneway] void insertString( [in] com::sun::star::text::XTextRange xRange, 128cdf0e10cSrcweir [in] string aString, 129cdf0e10cSrcweir [in] boolean bAbsorb ); 130cdf0e10cSrcweir 131cdf0e10cSrcweir //------------------------------------------------------------------------- 132cdf0e10cSrcweir 133cdf0e10cSrcweir /** inserts a control character (like a paragraph break or a hard 134cdf0e10cSrcweir space) into the text.@see com::sun::star::text::ControlCharacter 135cdf0e10cSrcweir */ 136cdf0e10cSrcweir void insertControlCharacter( [in] com::sun::star::text::XTextRange xRange, 137cdf0e10cSrcweir [in] short nControlCharacter, 138cdf0e10cSrcweir [in] boolean bAbsorb ) 139cdf0e10cSrcweir raises( com::sun::star::lang::IllegalArgumentException ); 140cdf0e10cSrcweir 141cdf0e10cSrcweir}; 142cdf0e10cSrcweir 143cdf0e10cSrcweir//============================================================================= 144cdf0e10cSrcweir 145cdf0e10cSrcweir}; }; }; }; 146cdf0e10cSrcweir 147cdf0e10cSrcweir#endif 148