xref: /aoo42x/main/sw/source/core/crsr/IBlockCursor.hxx (revision 1d2dbeb0)
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 
24 #ifndef IBLOCKCURSOR_HXX_INCLUDED
25 #define IBLOCKCURSOR_HXX_INCLUDED
26 
27 class SwShellCrsr;
28 class Point;
29 
30  /** Access to the block cursor
31 
32     A block cursor contains a SwShellCrsr and additional information about
33     the rectangle which has been created by pressing the mouse button and
34     moving the mouse.
35     This interface provides access to the SwShellCrsr and to start and end
36     point of the mouse movement.
37  */
38  class IBlockCursor
39  {
40  public:
41 /** Access to the shell cursor
42 
43     @return SwShellCrsr& which represents the start and end position of the
44     current block selection
45 */
46     virtual SwShellCrsr& getShellCrsr() = 0;
47 
48 /** Defines the starting vertex of the block selection
49 
50     @param rPt
51     rPt should contain the document coordinates of the mouse cursor when
52     the block selection starts (MouseButtonDown)
53 */
54     virtual void setStartPoint( const Point &rPt ) = 0;
55 
56 /** Defines the ending vertex of the block selection
57 
58     @param rPt
59     rPt should contain the document coordinates of the mouse cursor when
60     the block selection has started and the mouse has been moved (MouseMove)
61 */
62     virtual void setEndPoint( const Point &rPt ) = 0;
63 
64 /** The document coordinates where the block selection has been started
65 
66     @return 0, if no start point has been set
67 */
68     virtual const Point* getStartPoint() const = 0;
69 
70 
71 /** The document coordinates where the block selection ends (at the moment)
72 
73     @return 0, if no end point has been set
74 */
75     virtual const Point* getEndPoint() const = 0;
76 
77 /** Deletion of the mouse created rectangle
78 
79     When start and end points exist, the block cursor depends on this. If the
80     cursor is moved by cursor keys (e.g. up/down, home/end) the mouse rectangle
81     is obsolet and has to be deleted.
82 */
83     virtual void clearPoints() = 0;
84 
85 /** Destructor of the block curosr interface
86 */
~IBlockCursor()87     virtual ~IBlockCursor() {};
88  };
89 
90 #endif // IBLOCKCURSOR_HXX_INCLUDED
91 
92