LibreOffice Module svx (master) 1
svdorect.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
20#pragma once
21
22#include <memory>
23#include <optional>
24#include <svx/svdotext.hxx>
25#include <svx/xpoly.hxx>
26#include <svx/svxdllapi.h>
27
28
29// Forward declaration
30namespace sdr::properties {
31 class RectangleProperties;
32}
33
34
35// SdrRectObj
36
39{
40private:
41 // to allow sdr::properties::RectangleProperties access to SetXPolyDirty()
43 friend class SdrTextObj; // Due to SetXPolyDirty for GrowAdjust
44
45protected:
46 virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
47 virtual std::unique_ptr<sdr::properties::BaseProperties> CreateObjectSpecificProperties() override;
48
49 std::optional<XPolygon> mpXPoly;
50
51protected:
52 XPolygon ImpCalcXPoly(const tools::Rectangle& rRect1, tools::Long nRad1) const;
53 void SetXPolyDirty();
54
57 virtual void RecalcXPoly();
58 const XPolygon& GetXPoly() const;
59 virtual void RestoreGeoData(const SdrObjGeoData& rGeo) override;
60
61 // protected destructor
62 virtual ~SdrRectObj() override;
63
64public:
71 SdrRectObj(SdrModel& rSdrModel);
73 SdrModel& rSdrModel,
74 const tools::Rectangle& rRect);
75
76 // Constructor of a text frame
78 SdrModel& rSdrModel,
79 SdrObjKind eNewTextKind);
81 SdrModel& rSdrModel,
82 SdrObjKind eNewTextKind,
83 const tools::Rectangle& rRect);
84
85 // Copy constructor
86 SdrRectObj(SdrModel& rSdrModel, SdrRectObj const & rSource);
87
88 virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
89 virtual SdrObjKind GetObjIdentifier() const override;
90 virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const override;
91
92 virtual OUString TakeObjNameSingul() const override;
93 virtual OUString TakeObjNamePlural() const override;
94
95 virtual rtl::Reference<SdrObject> CloneSdrObject(SdrModel& rTargetModel) const override;
96 virtual void RecalcSnapRect() override;
97 virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override;
98 virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
99 virtual basegfx::B2DPolyPolygon TakeXorPoly() const override;
100
101 virtual sal_uInt32 GetHdlCount() const override;
102 virtual void AddToHdlList(SdrHdlList& rHdlList) const override;
103
104 // Special drag methods
105 virtual bool hasSpecialDrag() const override;
106 virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override;
107 virtual bool applySpecialDrag(SdrDragStat& rDrag) override;
108 virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override;
109
110 virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override;
111 virtual PointerStyle GetCreatePointer() const override;
112
113 virtual void NbcMove(const Size& rSiz) override;
114 virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
115 virtual void NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs) override;
116 virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override;
117 virtual void NbcShear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear) override;
118
119 virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const override;
120 virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const override;
121
122 virtual rtl::Reference<SdrObject> DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
123
124 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
125};
126
127/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
Definition: svdoattr.cxx:61
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:174
Provides information about various ZObject properties.
Definition: svdobj.hxx:196
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const
Definition: svdobj.cxx:1347
friend class SdrRectObj
Definition: svdobj.hxx:270
virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const
Definition: svdobj.cxx:2296
virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const
Definition: svdobj.cxx:2275
Rectangle objects (rectangle, circle, ...)
Definition: svdorect.hxx:39
std::optional< XPolygon > mpXPoly
Definition: svdorect.hxx:49
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: svdotext.cxx:64
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdotext.cxx:1095
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const override
Definition: svdotxdr.cxx:177
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
Definition: svdotxtr.cxx:238
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
Definition: svdotxtr.cxx:43
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
Definition: svdotext.cxx:1507
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
Definition: svdotxtr.cxx:214
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdotxtr.cxx:95
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: svdotext.cxx:1140
virtual bool applySpecialDrag(SdrDragStat &rDrag) override
Definition: svdotxdr.cxx:152
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
Definition: svdotxdr.cxx:36
virtual OUString TakeObjNameSingul() const override
Definition: svdotext.cxx:1018
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: svdotext.cxx:429
virtual OUString TakeObjNamePlural() const override
Definition: svdotext.cxx:1077
virtual PointerStyle GetCreatePointer() const override
get the cursor/pointer that signals creating this object
Definition: svdotxdr.cxx:247
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: svdotext.cxx:1100
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const override
Polygon dragged by the user when creating the object.
Definition: svdotxdr.cxx:235
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: svdotext.cxx:70
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: svdotxdr.cxx:41
virtual SdrObjKind GetObjIdentifier() const override
Definition: svdotext.cxx:453
virtual void TakeUnrotatedSnapRect(tools::Rectangle &rRect) const
Definition: svdotext.cxx:617
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const override
Definition: svdotxtr.cxx:410
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdotxtr.cxx:103
virtual bool hasSpecialDrag() const override
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdotxdr.cxx:70
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: svdotxtr.cxx:75
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
Definition: svdotxtr.cxx:190
long Long
PointerStyle
SdrObjKind
Definition: svdobjkind.hxx:25
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35