LibreOffice Module svx (master)  1
svdogrp.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 <svx/svdobj.hxx>
24 #include <svx/svxdllapi.h>
25 #include <svx/svdpage.hxx>
26 
27 // Forward declarations
28 class SfxItemSet;
29 
30 // SdrObjGroup
31 class SVXCORE_DLLPUBLIC SdrObjGroup final : public SdrObject, public SdrObjList
32 {
33 private:
34  virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
35  virtual std::unique_ptr<sdr::properties::BaseProperties>
37 
38  Point maRefPoint; // Reference point inside the object group
39 
40 private:
41  // protected destructor - due to final, make private
42  virtual ~SdrObjGroup() override;
43 
44 public:
45  SdrObjGroup(SdrModel& rSdrModel);
46  // Copy constructor
47  SdrObjGroup(SdrModel& rSdrModel, SdrObjGroup const& rSource);
48 
49  // derived from SdrObjList
50  virtual SdrPage* getSdrPageFromSdrObjList() const override;
51  virtual SdrObject* getSdrObjectFromSdrObjList() const override;
52 
53  // derived from SdrObject
54  virtual SdrObjList* getChildrenOfSdrObject() const override;
55 
56  virtual void SetBoundRectDirty() override;
57  virtual SdrObjKind GetObjIdentifier() const override;
58  virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
59  virtual SdrLayerID GetLayer() const override;
60  virtual void NbcSetLayer(SdrLayerID nLayer) override;
61 
62  // react on model/page change
63  virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override;
64 
65  virtual SdrObjList* GetSubList() const override;
66 
67  virtual const tools::Rectangle& GetCurrentBoundRect() const override;
68  virtual const tools::Rectangle& GetSnapRect() const override;
69 
70  virtual SdrObjGroup* CloneSdrObject(SdrModel& rTargetModel) const override;
71 
72  virtual OUString TakeObjNameSingul() const override;
73  virtual OUString TakeObjNamePlural() const override;
74 
75  virtual void RecalcSnapRect() override;
76  virtual basegfx::B2DPolyPolygon TakeXorPoly() const override;
77 
78  // special drag methods
79  virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override;
80 
81  virtual bool BegCreate(SdrDragStat& rStat) override;
82 
83  virtual Degree100 GetRotateAngle() const override;
84  virtual Degree100 GetShearAngle(bool bVertical = false) const override;
85 
86  virtual void Move(const Size& rSiz) override;
87  virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact,
88  bool bUnsetRelative = true) override;
89  virtual void Rotate(const Point& rRef, Degree100 nAngle, double sn, double cs) override;
90  virtual void Mirror(const Point& rRef1, const Point& rRef2) override;
91  virtual void Shear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear) override;
92  virtual void SetAnchorPos(const Point& rPnt) override;
93  virtual void SetRelativePos(const Point& rPnt) override;
94  virtual void SetSnapRect(const tools::Rectangle& rRect) override;
95  virtual void SetLogicRect(const tools::Rectangle& rRect) override;
96 
97  virtual void NbcMove(const Size& rSiz) override;
98  virtual void NbcResize(const Point& rRef, const Fraction& xFact,
99  const Fraction& yFact) override;
100  virtual void NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs) override;
101  virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override;
102  virtual void NbcShear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear) override;
103  virtual void NbcSetAnchorPos(const Point& rPnt) override;
104  virtual void NbcSetRelativePos(const Point& rPnt) override;
105  virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override;
106  virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
107 
108  virtual void NbcReformatText() override;
109 
110  virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
111 
112  virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override;
113 };
114 
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
Definition: svdobj.cxx:1126
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
Definition: svdobj.cxx:664
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:957
virtual bool BegCreate(SdrDragStat &rStat)
Every object must be able to create itself interactively.
Definition: svdobj.cxx:1380
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
Definition: svdobj.cxx:1552
struct _xmlTextWriter * xmlTextWriterPtr
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage)
Definition: svdobj.cxx:524
virtual SdrObjList * getChildrenOfSdrObject() const
Definition: svdobj.cxx:310
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
Definition: svdobj.cxx:1439
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:1469
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties()
Definition: svdobj.cxx:205
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const
Definition: svdobj.cxx:2615
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1528
virtual void SetBoundRectDirty()
Definition: svdobj.cxx:316
virtual OUString TakeObjNameSingul() const
Definition: svdobj.cxx:1082
virtual SdrObjKind GetObjIdentifier() const
Definition: svdobj.cxx:659
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:748
SdrObjKind
Definition: svdobjkind.hxx:24
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1666
Provides information about various ZObject properties.
Definition: svdobj.hxx:195
virtual void SetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1646
virtual void RecalcSnapRect()
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: svdobj.cxx:1662
Point maRefPoint
Definition: svdogrp.hxx:38
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdpage.cxx:1114
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1497
virtual Degree100 GetShearAngle(bool bVertical=false) const
Definition: svdobj.cxx:1714
virtual void SetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1700
virtual void Move(const Size &rSiz)
Definition: svdobj.cxx:1535
virtual void SetRelativePos(const Point &rPnt)
Definition: svdobj.cxx:1618
Abstract DrawObject.
Definition: svdobj.hxx:259
virtual void Mirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1591
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:678
virtual void NbcReformatText()
Definition: svdobj.cxx:1842
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact()
Definition: svdobj.cxx:246
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1671
virtual void NbcSetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1681
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdobj.cxx:1433
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
virtual SdrObject * CloneSdrObject(SdrModel &rTargetModel) const
Definition: svdobj.cxx:1077
virtual SdrPage * getSdrPageFromSdrObjList() const
Definition: svdpage.cxx:122
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
Definition: svdobj.hxx:97
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const
Definition: svdobj.cxx:1344
virtual OUString TakeObjNamePlural() const
Definition: svdobj.cxx:1092
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:1580
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1691
virtual void NbcSetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1639
virtual Degree100 GetRotateAngle() const
Definition: svdobj.cxx:1709
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:365
virtual void NbcSetRelativePos(const Point &rPnt)
The relative position of a SdrObject is the distance of the upper left corner of the logic bounding r...
Definition: svdobj.cxx:1611
virtual SdrObject * getSdrObjectFromSdrObjList() const
Definition: svdpage.cxx:128
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:695