File indexing completed on 2024-06-09 04:21:08
0001 /* This file is part of the KDE project 0002 0003 SPDX-FileCopyrightText: 2006, 2009 Thomas Zander <zander@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 #ifndef KoShapeRubberSelectStrategyPrivate_H 0008 #define KoShapeRubberSelectStrategyPrivate_H 0009 0010 #include "KoInteractionStrategy_p.h" 0011 #include "KoSnapGuide.h" 0012 0013 class KoShapeRubberSelectStrategyPrivate : public KoInteractionStrategyPrivate 0014 { 0015 public: 0016 explicit KoShapeRubberSelectStrategyPrivate(KoToolBase *owner) 0017 : KoInteractionStrategyPrivate(owner), 0018 snapGuide(new KoSnapGuide(owner->canvas())) 0019 { 0020 } 0021 0022 ~KoShapeRubberSelectStrategyPrivate() 0023 { 0024 delete snapGuide; 0025 } 0026 0027 /** 0028 * Return the rectangle that the user dragged. 0029 * The rectangle is normalized and immutable. 0030 * @return a rectangle in pt. 0031 */ 0032 QRectF selectedRect() const { 0033 return selectRect.normalized(); 0034 } 0035 0036 QRectF selectRect; 0037 QPointF lastPos; 0038 KoSnapGuide *snapGuide; 0039 }; 0040 0041 #endif