LibreOffice Module svx (master)  1
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
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 .
18  */
23 #include <memory>
24 #include <svx/svdotext.hxx>
25 #include <svx/svxdllapi.h>
28 // Forward declaration
29 class XPolygon;
31 namespace sdr::properties {
32  class RectangleProperties;
33 }
36 // SdrRectObj
40 {
41 private:
42  // to allow sdr::properties::RectangleProperties access to SetXPolyDirty()
44  friend class SdrTextObj; // Due to SetXPolyDirty for GrowAdjust
46 protected:
47  virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
48  virtual std::unique_ptr<sdr::properties::BaseProperties> CreateObjectSpecificProperties() override;
50  std::unique_ptr<XPolygon> mpXPoly;
52 protected:
53  XPolygon ImpCalcXPoly(const tools::Rectangle& rRect1, tools::Long nRad1) const;
54  void SetXPolyDirty();
58  virtual void RecalcXPoly();
59  const XPolygon& GetXPoly() const;
60  virtual void RestoreGeoData(const SdrObjGeoData& rGeo) override;
62  // protected destructor
63  virtual ~SdrRectObj() override;
65 public:
72  SdrRectObj(SdrModel& rSdrModel);
73  SdrRectObj(
74  SdrModel& rSdrModel,
75  const tools::Rectangle& rRect);
77  // Constructor of a text frame
78  SdrRectObj(
79  SdrModel& rSdrModel,
80  SdrObjKind eNewTextKind);
81  SdrRectObj(
82  SdrModel& rSdrModel,
83  SdrObjKind eNewTextKind,
84  const tools::Rectangle& rRect);
86  // Copy constructor
87  SdrRectObj(SdrModel& rSdrModel, SdrRectObj const & rSource);
89  virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
90  virtual SdrObjKind GetObjIdentifier() const override;
91  virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const override;
93  virtual OUString TakeObjNameSingul() const override;
94  virtual OUString TakeObjNamePlural() const override;
96  virtual SdrRectObj* CloneSdrObject(SdrModel& rTargetModel) const override;
97  virtual void RecalcSnapRect() override;
98  virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override;
99  virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
100  virtual basegfx::B2DPolyPolygon TakeXorPoly() const override;
102  virtual sal_uInt32 GetHdlCount() const override;
103  virtual void AddToHdlList(SdrHdlList& rHdlList) const override;
105  // Special drag methods
106  virtual bool hasSpecialDrag() const override;
107  virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override;
108  virtual bool applySpecialDrag(SdrDragStat& rDrag) override;
109  virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override;
111  virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override;
112  virtual PointerStyle GetCreatePointer() const override;
114  virtual void NbcMove(const Size& rSiz) override;
115  virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
116  virtual void NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs) override;
117  virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override;
118  virtual void NbcShear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear) override;
120  virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const override;
121  virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const override;
123  virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
125  virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
126 };
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdotxtr.cxx:102
virtual SdrObjKind GetObjIdentifier() const override
Definition: svdotext.cxx:464
long Long
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:970
virtual bool hasSpecialDrag() const override
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdotxdr.cxx:67
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: svdotext.cxx:1094
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:172
Definition: svdobjkind.hxx:24
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
Definition: svdotxtr.cxx:232
Rectangle objects (rectangle, circle, ...)
Definition: svdorect.hxx:39
Provides information about various ZObject properties.
Definition: svdobj.hxx:194
virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const
Definition: svdobj.cxx:2230
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: svdotext.cxx:58
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
Definition: svdotxtr.cxx:210
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: svdotext.cxx:440
virtual SdrTextObj * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdotext.cxx:1051
virtual bool applySpecialDrag(SdrDragStat &rDrag) override
Definition: svdotxdr.cxx:149
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const override
Definition: svdotxdr.cxx:174
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdotxtr.cxx:94
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
Definition: svdotxtr.cxx:186
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const override
Polygon dragged by the user when creating the object.
Definition: svdotxdr.cxx:230
virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const
Definition: svdobj.cxx:2251
friend class SdrRectObj
Definition: svdobj.hxx:264
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
Definition: svdoattr.cxx:61
Definition: svxdllapi.h:35
std::unique_ptr< XPolygon > mpXPoly
Definition: svdorect.hxx:50
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
Definition: svdotext.cxx:1451
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
Definition: svdobj.hxx:96
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const
Definition: svdobj.cxx:1323
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: svdotxtr.cxx:74
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: svdotext.cxx:64
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: svdotext.cxx:1056
virtual void TakeUnrotatedSnapRect(tools::Rectangle &rRect) const
Definition: svdotext.cxx:630
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override
Definition: svdotxtr.cxx:414
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: svdotxdr.cxx:41
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
Definition: svdotxtr.cxx:42
virtual OUString TakeObjNamePlural() const override
Definition: svdotext.cxx:1034
virtual PointerStyle GetCreatePointer() const override
get the cursor/pointer that signals creating this object
Definition: svdotxdr.cxx:242