LibreOffice Module sw (master) 1
BlockCursor.hxx
Go to the documentation of this file.
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#ifndef INCLUDED_SW_SOURCE_CORE_CRSR_BLOCKCURSOR_HXX
20#define INCLUDED_SW_SOURCE_CORE_CRSR_BLOCKCURSOR_HXX
21
22#include <optional>
23#include <tools/gen.hxx>
24
25#include <viscrs.hxx>
26
27class SwCursorShell;
28struct SwPosition;
29
40{
42 std::optional<Point> maStartPt;
43 std::optional<Point> maEndPt;
44
45public:
46 SwBlockCursor( const SwCursorShell& rCursorSh, const SwPosition &rPos ) :
47 maCursor( rCursorSh, rPos ) {}
60 void setStartPoint( const Point &rPt ) { maStartPt = rPt; }
67 void setEndPoint( const Point &rPt ) { maEndPt = rPt; }
72 std::optional<Point> const & getStartPoint() const { return maStartPt; }
77 std::optional<Point> const & getEndPoint() const { return maEndPt; }
84 void clearPoints() { maStartPt.reset(); maEndPt.reset(); }
86};
87
88
89#endif
90
91/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Access to the block cursor.
Definition: BlockCursor.hxx:40
SwShellCursor maCursor
Definition: BlockCursor.hxx:41
std::optional< Point > maEndPt
Definition: BlockCursor.hxx:43
SwBlockCursor(const SwCursorShell &rCursorSh, const SwPosition &rPos)
Definition: BlockCursor.hxx:46
SwShellCursor & getShellCursor()
Access to the shell cursor.
Definition: BlockCursor.cxx:25
std::optional< Point > const & getStartPoint() const
The document coordinates where the block selection has been started.
Definition: BlockCursor.hxx:72
std::optional< Point > maStartPt
Definition: BlockCursor.hxx:42
void clearPoints()
Deletion of the mouse created rectangle.
Definition: BlockCursor.hxx:84
void setEndPoint(const Point &rPt)
Defines the ending vertex of the block selection.
Definition: BlockCursor.hxx:67
std::optional< Point > const & getEndPoint() const
The document coordinates where the block selection ends (at the moment)
Definition: BlockCursor.hxx:77
void setStartPoint(const Point &rPt)
Defines the starting vertex of the block selection.
Definition: BlockCursor.hxx:60
Represents the current text cursor of one opened edit window.
Definition: viscrs.hxx:140
Marks a position in the document model.
Definition: pam.hxx:38