Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_SW_SOURCE_CORE_CRSR_IBLOCKCURSOR_HXX
21 : #define INCLUDED_SW_SOURCE_CORE_CRSR_IBLOCKCURSOR_HXX
22 :
23 : class SwShellCrsr;
24 : class Point;
25 :
26 : /** Access to the block cursor
27 :
28 : A block cursor contains a SwShellCrsr and additional information about
29 : the rectangle which has been created by pressing the mouse button and
30 : moving the mouse.
31 : This interface provides access to the SwShellCrsr and to start and end
32 : point of the mouse movement.
33 : */
34 0 : class IBlockCursor
35 : {
36 : public:
37 : /** Access to the shell cursor
38 :
39 : @return SwShellCrsr& which represents the start and end position of the
40 : current block selection
41 : */
42 : virtual SwShellCrsr& getShellCrsr() = 0;
43 :
44 : /** Defines the starting vertex of the block selection
45 :
46 : @param rPt
47 : rPt should contain the document coordinates of the mouse cursor when
48 : the block selection starts (MouseButtonDown)
49 : */
50 : virtual void setStartPoint( const Point &rPt ) = 0;
51 :
52 : /** Defines the ending 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 has started and the mouse has been moved (MouseMove)
57 : */
58 : virtual void setEndPoint( const Point &rPt ) = 0;
59 :
60 : /** The document coordinates where the block selection has been started
61 :
62 : @return 0, if no start point has been set
63 : */
64 : virtual const Point* getStartPoint() const = 0;
65 :
66 : /** The document coordinates where the block selection ends (at the moment)
67 :
68 : @return 0, if no end point has been set
69 : */
70 : virtual const Point* getEndPoint() const = 0;
71 :
72 : /** Deletion of the mouse created rectangle
73 :
74 : When start and end points exist, the block cursor depends on this. If the
75 : cursor is moved by cursor keys (e.g. up/down, home/end) the mouse rectangle
76 : is obsolet and has to be deleted.
77 : */
78 : virtual void clearPoints() = 0;
79 :
80 : /** Destructor of the block curosr interface */
81 0 : virtual ~IBlockCursor() {};
82 : };
83 :
84 : #endif
85 :
86 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|