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_XTextCursor_idl__ 28#define __com_sun_star_text_XTextCursor_idl__ 29 30#ifndef __com_sun_star_text_XTextRange_idl__ 31#include <com/sun/star/text/XTextRange.idl> 32#endif 33 34 35//============================================================================= 36 37 module com { module sun { module star { module text { 38 39//============================================================================= 40 41/** extends a text range by method to modify its position. 42 */ 43published interface XTextCursor: com::sun::star::text::XTextRange 44{ 45 //------------------------------------------------------------------------- 46 47 /** sets the end of the position to the start. 48 */ 49 [oneway] void collapseToStart(); 50 51 //------------------------------------------------------------------------- 52 53 /** sets the start of the position to the end. 54 */ 55 [oneway] void collapseToEnd(); 56 57 //------------------------------------------------------------------------- 58 59 /** determines if the start and end positions are the same. 60 */ 61 boolean isCollapsed(); 62 63 //------------------------------------------------------------------------- 64 65 /** moves the cursor the specified number of characters to the left. 66 67 @param nCount 68 the number of characters to move. 69 70 @param bExpand 71 specifies if the current selection of the cursor should 72 be expanded or not. 73 74 @returns 75 <TRUE/> if the command was successfully completed. 76 <FALSE/> otherwise. 77 78 <p>Note: Even if the command was not completed successfully 79 it may be completed partially. E.g. if it was required to move 80 5 characters but it is only possible to move 3 <FALSE/> will 81 be returned and the cursor moves only those 3 characters.<p> 82 */ 83 boolean goLeft( [in] short nCount, 84 [in] boolean bExpand ); 85 86 //------------------------------------------------------------------------- 87 88 /** moves the cursor the specified number of characters to the right. 89 90 @param nCount 91 the number of characters to move. 92 93 @param bExpand 94 specifies if the current selection of the cursor should 95 be expanded or not. 96 97 @returns 98 <TRUE/> if the command was successfully completed. 99 <FALSE/> otherwise. 100 101 <p>Note: Even if the command was not completed successfully 102 it may be completed partially. E.g. if it was required to move 103 5 characters but it is only possible to move 3 <FALSE/> will 104 be returned and the cursor moves only those 3 characters.<p> 105 */ 106 boolean goRight( [in] short nCount, 107 [in] boolean bExpand ); 108 109 //------------------------------------------------------------------------- 110 111 /** moves the cursor to the start of the text. 112 */ 113 void gotoStart( [in] boolean bExpand ); 114 115 //------------------------------------------------------------------------- 116 117 /** moves the cursor to the end of the text. 118 */ 119 void gotoEnd( [in] boolean bExpand ); 120 121 //------------------------------------------------------------------------- 122 123 /** moves or expands the cursor to a specified <type>TextRange</type>. 124 */ 125 void gotoRange( [in] com::sun::star::text::XTextRange xRange, 126 [in] boolean bExpand ); 127 128}; 129 130//============================================================================= 131 132}; }; }; }; 133 134#endif 135