xref: /AOO41X/main/offapi/com/sun/star/text/XTextCursor.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_text_XTextCursor_idl__
24#define __com_sun_star_text_XTextCursor_idl__
25
26#ifndef __com_sun_star_text_XTextRange_idl__
27#include <com/sun/star/text/XTextRange.idl>
28#endif
29
30
31//=============================================================================
32
33 module com {  module sun {  module star {  module text {
34
35//=============================================================================
36
37/** extends a text range by method to modify its position.
38 */
39published interface XTextCursor: com::sun::star::text::XTextRange
40{
41    //-------------------------------------------------------------------------
42
43    /** sets the end of the position to the start.
44     */
45    [oneway] void collapseToStart();
46
47    //-------------------------------------------------------------------------
48
49    /** sets the start of the position to the end.
50     */
51    [oneway] void collapseToEnd();
52
53    //-------------------------------------------------------------------------
54
55    /** determines if the start and end positions are the same.
56     */
57    boolean isCollapsed();
58
59    //-------------------------------------------------------------------------
60
61    /** moves the cursor the specified number of characters to the left.
62
63        @param nCount
64            the number of characters to move.
65
66        @param bExpand
67            specifies if the current selection of the cursor should
68            be expanded or not.
69
70        @returns
71            <TRUE/> if the command was successfully completed.
72            <FALSE/> otherwise.
73
74            <p>Note: Even if the command was not completed successfully
75            it may be completed partially. E.g. if it was required to move
76            5 characters but it is only possible to move 3 <FALSE/> will
77            be returned and the cursor moves only those 3 characters.<p>
78     */
79    boolean goLeft( [in] short nCount,
80             [in] boolean bExpand );
81
82    //-------------------------------------------------------------------------
83
84    /** moves the cursor the specified number of characters to the right.
85
86        @param nCount
87            the number of characters to move.
88
89        @param bExpand
90            specifies if the current selection of the cursor should
91            be expanded or not.
92
93        @returns
94            <TRUE/> if the command was successfully completed.
95            <FALSE/> otherwise.
96
97            <p>Note: Even if the command was not completed successfully
98            it may be completed partially. E.g. if it was required to move
99            5 characters but it is only possible to move 3 <FALSE/> will
100            be returned and the cursor moves only those 3 characters.<p>
101     */
102    boolean goRight( [in] short nCount,
103             [in] boolean bExpand );
104
105    //-------------------------------------------------------------------------
106
107    /** moves the cursor to the start of the text.
108     */
109    void gotoStart( [in] boolean bExpand );
110
111    //-------------------------------------------------------------------------
112
113    /** moves the cursor to the end of the text.
114     */
115    void gotoEnd( [in] boolean bExpand );
116
117    //-------------------------------------------------------------------------
118
119    /** moves or expands the cursor to a specified <type>TextRange</type>.
120     */
121    void gotoRange( [in] com::sun::star::text::XTextRange xRange,
122             [in] boolean bExpand );
123
124};
125
126//=============================================================================
127
128}; }; }; };
129
130#endif
131