LibreOffice Module svx (master)  1
svdovirt.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 #ifndef INCLUDED_SVX_SVDOVIRT_HXX
21 #define INCLUDED_SVX_SVDOVIRT_HXX
22 
23 #include <svx/svdobj.hxx>
24 #include <svx/svxdllapi.h>
25 
31 {
32  SdrVirtObj( const SdrVirtObj& ) = delete;
33 public:
34  virtual sdr::properties::BaseProperties& GetProperties() const override;
35 
36 protected:
37  virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
38 
39  SdrObject& rRefObj; // Referenced drawing object
41 
42 protected:
43  virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
44 
45  virtual SdrObjGeoData* NewGeoData() const override;
46  virtual void SaveGeoData(SdrObjGeoData& rGeo) const override;
47  virtual void RestGeoData(const SdrObjGeoData& rGeo) override;
48 
49  // protected destructor
50  virtual ~SdrVirtObj() override;
51 
52 public:
53  SdrVirtObj(
54  SdrModel& rSdrModel,
55  SdrObject& rNewObj);
56 
57  SdrObject& ReferencedObj();
58  const SdrObject& GetReferencedObj() const;
59  virtual void NbcSetAnchorPos(const Point& rAnchorPos) override;
60 
61  virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
62  virtual SdrInventor GetObjInventor() const override;
63  virtual sal_uInt16 GetObjIdentifier() const override;
64  virtual SdrObjList* GetSubList() const override;
65 
66  virtual const tools::Rectangle& GetCurrentBoundRect() const override;
67  virtual const tools::Rectangle& GetLastBoundRect() const override;
68  virtual void RecalcBoundRect() override;
69  virtual SdrVirtObj* CloneSdrObject(SdrModel& rTargetModel) const override;
70  SdrVirtObj& operator=(const SdrVirtObj& rObj);
71 
72  virtual OUString TakeObjNameSingul() const override;
73  virtual OUString TakeObjNamePlural() const override;
74 
75  // RotGrfFlyFrame: If true, this SdrObject supports only limited rotation
76  virtual bool HasLimitedRotation() const override;
77 
78  virtual basegfx::B2DPolyPolygon TakeXorPoly() const override;
79  virtual sal_uInt32 GetHdlCount() const override;
80  virtual void AddToPlusHdlList(SdrHdlList& rHdlList, SdrHdl& rHdl) const override;
81  virtual void AddToHdlList(SdrHdlList& rHdlList) const override;
82 
83  // special drag methods
84  virtual bool hasSpecialDrag() const override;
85  virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override;
86  virtual bool applySpecialDrag(SdrDragStat& rDrag) override;
87  virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override;
88  virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const override;
89 
90  // FullDrag support
91  virtual bool supportsFullDrag() const override;
92  virtual SdrObjectUniquePtr getFullDragClone() const override;
93 
94  virtual bool BegCreate(SdrDragStat& rStat) override;
95  virtual bool MovCreate(SdrDragStat& rStat) override;
96  virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override;
97  virtual bool BckCreate(SdrDragStat& rStat) override;
98  virtual void BrkCreate(SdrDragStat& rStat) override;
99  virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override;
100 
101  virtual void NbcMove(const Size& rSiz) override;
102  virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
103  virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) override;
104  virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override;
105  virtual void NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) override;
106 
107  virtual void Move(const Size& rSiz) override;
108  virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true) override;
109  virtual void Rotate(const Point& rRef, long nAngle, double sn, double cs) override;
110  virtual void Mirror(const Point& rRef1, const Point& rRef2) override;
111  virtual void Shear(const Point& rRef, long nAngle, double tn, bool bVShear) override;
112 
113  virtual void RecalcSnapRect() override;
114  virtual const tools::Rectangle& GetSnapRect() const override;
115  virtual void SetSnapRect(const tools::Rectangle& rRect) override;
116  virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override;
117 
118  virtual const tools::Rectangle& GetLogicRect() const override;
119  virtual void SetLogicRect(const tools::Rectangle& rRect) override;
120  virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
121 
122  virtual long GetRotateAngle() const override;
123  virtual long GetShearAngle(bool bVertical = false) const override;
124 
125  virtual sal_uInt32 GetSnapPointCount() const override;
126  virtual Point GetSnapPoint(sal_uInt32 i) const override;
127 
128  virtual bool IsPolyObj() const override;
129  virtual sal_uInt32 GetPointCount() const override;
130  virtual Point GetPoint(sal_uInt32 i) const override;
131  virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i) override;
132 
133  virtual SdrObjGeoData* GetGeoData() const override;
134  virtual void SetGeoData(const SdrObjGeoData& rGeo) override;
135 
136  virtual void NbcReformatText() override;
137 
138  virtual bool HasMacro() const override;
139  virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec) const override;
140  virtual PointerStyle GetMacroPointer (const SdrObjMacroHitRec& rRec) const override;
141  virtual void PaintMacro (OutputDevice& rOut, const tools::Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const override;
142  virtual bool DoMacro (const SdrObjMacroHitRec& rRec) override;
143 
144  // #i73248# for default SdrVirtObj, offset is aAnchor, not (0,0)
145  virtual Point GetOffset() const;
146 };
147 
148 #endif // INCLUDED_SVX_SVDOVIRT_HXX
149 
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool BckCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1352
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
Definition: svdobj.cxx:1067
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
Definition: svdobj.cxx:563
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:854
virtual bool BegCreate(SdrDragStat &rStat)
Every object must be able to create itself interactively.
Definition: svdobj.cxx:1321
tools::Rectangle aSnapRect
Definition: svdovirt.hxx:40
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
Definition: svdobj.cxx:1484
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const
Definition: svdobj.cxx:1308
virtual bool IsPolyObj() const
Definition: svdobj.cxx:1660
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
Definition: svdobj.cxx:1380
virtual bool hasSpecialDrag() const
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdobj.cxx:1269
SdrInventor
Definition: svdobj.hxx:152
virtual OUString TakeObjNameSingul() const
Definition: svdobj.cxx:1018
virtual void AddToHdlList(SdrHdlList &rHdlList) const
Definition: svdobj.cxx:1169
virtual sal_uInt32 GetPointCount() const
Definition: svdobj.cxx:1665
virtual sdr::properties::BaseProperties & GetProperties() const
Definition: svdobj.cxx:204
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:226
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:647
virtual SdrObjGeoData * GetGeoData() const
Definition: svdobj.cxx:1865
virtual void AddToPlusHdlList(SdrHdlList &rHdlList, SdrHdl &rHdl) const
Definition: svdobj.cxx:1189
virtual void Rotate(const Point &rRef, long nAngle, double sn, double cs)
Definition: svdobj.cxx:1511
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1597
virtual SdrObject * CheckMacroHit(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1767
Provides information about various ZObject properties.
Definition: svdobj.hxx:248
virtual void BrkCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1348
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd)
Definition: svdobj.cxx:1340
virtual Point GetSnapPoint(sal_uInt32 i) const
Definition: svdobj.cxx:1655
SdrObject & rRefObj
Definition: svdovirt.hxx:39
virtual void RecalcSnapRect()
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: svdobj.cxx:1593
virtual void NbcRotate(const Point &rRef, long nAngle, double sn, double cs)
Definition: svdobj.cxx:1401
SdrObject & operator=(const SdrObject &rObj)
Definition: svdobj.cxx:979
virtual bool HasLimitedRotation() const
Definition: svdobj.cxx:968
virtual bool MovCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1331
virtual void NbcSetPoint(const Point &rPnt, sal_uInt32 i)
Definition: svdobj.cxx:1684
virtual sal_uInt16 GetObjIdentifier() const
Definition: svdobj.cxx:558
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1429
virtual void SetGeoData(const SdrObjGeoData &rGeo)
Definition: svdobj.cxx:1872
virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat &rDrag) const
Definition: svdobj.cxx:1313
virtual bool supportsFullDrag() const
Definition: svdobj.cxx:1274
virtual void SaveGeoData(SdrObjGeoData &rGeo) const
Definition: svdobj.cxx:1815
virtual bool HasMacro() const
Definition: svdobj.cxx:1762
virtual long GetShearAngle(bool bVertical=false) const
Definition: svdobj.cxx:1645
virtual void SetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1631
virtual void Move(const Size &rSiz)
Definition: svdobj.cxx:1467
virtual void RecalcBoundRect()
Definition: svdobj.cxx:873
virtual void PaintMacro(OutputDevice &rOut, const tools::Rectangle &rDirtyRect, const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1782
virtual sal_uInt32 GetHdlCount() const
Via GetHdlCount the number of Handles can be retrieved.
Definition: svdobj.cxx:1164
Abstract DrawObject.
Definition: svdobj.hxx:312
virtual void Mirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1522
virtual SdrInventor GetObjInventor() const
Definition: svdobj.cxx:553
virtual void NbcShear(const Point &rRef, long nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1460
virtual void RestGeoData(const SdrObjGeoData &rGeo)
Definition: svdobj.cxx:1838
virtual const tools::Rectangle & GetLastBoundRect() const
Definition: svdobj.cxx:868
virtual void NbcReformatText()
Definition: svdobj.cxx:1753
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact()
Definition: svdobj.cxx:240
virtual PointerStyle GetMacroPointer(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1777
virtual SdrObjGeoData * NewGeoData() const
A derived class must override these 3 methods if it has own geometric data that must be saved for Und...
Definition: svdobj.cxx:1810
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1602
virtual void NbcSetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1612
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdobj.cxx:1374
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
virtual SdrObject * CloneSdrObject(SdrModel &rTargetModel) const
Definition: svdobj.cxx:974
FIXME: The virtual object is not yet fully implemented and tested.
Definition: svdovirt.hxx:30
virtual long GetRotateAngle() const
Definition: svdobj.cxx:1640
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
Definition: svdobj.hxx:114
virtual SdrObjectUniquePtr getFullDragClone() const
Definition: svdobj.cxx:1279
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const
Definition: svdobj.cxx:1285
PointerStyle
virtual OUString TakeObjNamePlural() const
Definition: svdobj.cxx:1033
virtual void Shear(const Point &rRef, long nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1531
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1622
virtual bool applySpecialDrag(SdrDragStat &rDrag)
Definition: svdobj.cxx:1296
virtual void NbcSetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1570
virtual const tools::Rectangle & GetLogicRect() const
Definition: svdobj.cxx:1607
virtual bool DoMacro(const SdrObjMacroHitRec &rRec)
Definition: svdobj.cxx:1799
SdrCreateCmd
Definition: svdtypes.hxx:27
virtual Point GetPoint(sal_uInt32 i) const
Definition: svdobj.cxx:1670
friend class SdrVirtObj
Definition: svdobj.hxx:316
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const
Polygon dragged by the user when creating the object.
Definition: svdobj.cxx:1357
virtual sal_uInt32 GetSnapPointCount() const
snap to special points of an Object (polygon points, center of circle)
Definition: svdobj.cxx:1650