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