Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / svx / svdorect.hxx
blob729d3f221a0567779e05381bde4de1a79f5d852c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SVX_SVDORECT_HXX
21 #define INCLUDED_SVX_SVDORECT_HXX
23 #include <memory>
24 #include <svx/svdotext.hxx>
25 #include <svx/svxdllapi.h>
28 // Forward declaration
29 class XPolygon;
31 namespace sdr { namespace properties {
32 class RectangleProperties;
36 // SdrRectObj
38 /// Rectangle objects (rectangle, circle, ...)
39 class SVX_DLLPUBLIC SdrRectObj : public SdrTextObj
41 private:
42 // to allow sdr::properties::RectangleProperties access to SetXPolyDirty()
43 friend class sdr::properties::RectangleProperties;
44 friend class SdrTextObj; // Due to SetXPolyDirty for GrowAdjust
46 protected:
47 virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
48 virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
50 std::unique_ptr<XPolygon> mpXPoly;
52 protected:
53 XPolygon ImpCalcXPoly(const tools::Rectangle& rRect1, long nRad1) const;
54 void SetXPolyDirty();
56 /// Subclasses should override RecalcXPoly() by creating an XPolygon
57 /// instance with new and assigning it to mpXPoly.
58 virtual void RecalcXPoly();
59 const XPolygon& GetXPoly() const;
60 virtual void RestGeoData(const SdrObjGeoData& rGeo) override;
62 public:
63 /**
64 * The corner radius parameter is dropped at some point.
65 * We need to set the corner radius via SfxItems later on, using SetAttributes()
67 * Constructor of a rectangular drawing object
69 SdrRectObj();
70 SdrRectObj(const tools::Rectangle& rRect);
72 SdrRectObj& operator=(const SdrRectObj& rCopy);
74 // Constructor of a text frame
75 SdrRectObj(SdrObjKind eNewTextKind);
76 SdrRectObj(SdrObjKind eNewTextKind, const tools::Rectangle& rRect);
77 virtual ~SdrRectObj() override;
79 virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
80 virtual sal_uInt16 GetObjIdentifier() const override;
81 virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const override;
83 virtual OUString TakeObjNameSingul() const override;
84 virtual OUString TakeObjNamePlural() const override;
86 virtual SdrRectObj* Clone() const override;
87 virtual void RecalcSnapRect() override;
88 virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override;
89 virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
90 virtual basegfx::B2DPolyPolygon TakeXorPoly() const override;
92 virtual sal_uInt32 GetHdlCount() const override;
93 virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const override;
95 // Special drag methods
96 virtual bool hasSpecialDrag() const override;
97 virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override;
98 virtual bool applySpecialDrag(SdrDragStat& rDrag) override;
99 virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override;
101 virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override;
102 virtual Pointer GetCreatePointer() const override;
104 virtual void NbcMove(const Size& rSiz) override;
105 virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
106 virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) override;
107 virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override;
108 virtual void NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) override;
110 virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const override;
111 virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const override;
113 virtual SdrObject* DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
115 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
118 #endif // INCLUDED_SVX_SVDORECT_HXX
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */