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 -*- */
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 */
20#pragma once
22#include <svx/svdobj.hxx>
23#include <svx/svxdllapi.h>
31 SdrVirtObj(const SdrVirtObj&) = delete;
34 virtual sdr::properties::BaseProperties& GetProperties() const override;
37 virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
39 rtl::Reference<SdrObject> mxRefObj; // Referenced drawing object
43 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
45 virtual std::unique_ptr<SdrObjGeoData> NewGeoData() const override;
46 virtual void SaveGeoData(SdrObjGeoData& rGeo) const override;
47 virtual void RestoreGeoData(const SdrObjGeoData& rGeo) override;
49 // protected destructor
50 virtual ~SdrVirtObj() override;
53 SdrVirtObj(SdrModel& rSdrModel, SdrObject& rNewObj);
54 // Copy constructor
55 SdrVirtObj(SdrModel& rSdrModel, SdrVirtObj const& rSource);
57 SdrObject& ReferencedObj();
58 const SdrObject& GetReferencedObj() const;
59 virtual void NbcSetAnchorPos(const Point& rAnchorPos) override;
61 virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
62 virtual SdrInventor GetObjInventor() const override;
63 virtual SdrObjKind GetObjIdentifier() const override;
64 virtual SdrObjList* GetSubList() const override;
65 virtual void SetName(const OUString& rStr, const bool bSetChanged = true) override;
66 virtual const OUString& GetName() const override;
67 virtual void SetTitle(const OUString& rStr) override;
68 virtual OUString GetTitle() const override;
69 virtual void SetDescription(const OUString& rStr) override;
70 virtual OUString GetDescription() const override;
72 virtual const tools::Rectangle& GetCurrentBoundRect() const override;
73 virtual const tools::Rectangle& GetLastBoundRect() const override;
74 virtual void RecalcBoundRect() override;
75 virtual rtl::Reference<SdrObject> CloneSdrObject(SdrModel& rTargetModel) const override;
77 virtual OUString TakeObjNameSingul() const override;
78 virtual OUString TakeObjNamePlural() const override;
80 // RotGrfFlyFrame: If true, this SdrObject supports only limited rotation
81 virtual bool HasLimitedRotation() const override;
83 virtual basegfx::B2DPolyPolygon TakeXorPoly() const override;
84 virtual sal_uInt32 GetHdlCount() const override;
85 virtual void AddToPlusHdlList(SdrHdlList& rHdlList, SdrHdl& rHdl) const override;
86 virtual void AddToHdlList(SdrHdlList& rHdlList) const override;
88 // special drag methods
89 virtual bool hasSpecialDrag() const override;
90 virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override;
91 virtual bool applySpecialDrag(SdrDragStat& rDrag) override;
92 virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override;
93 virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const override;
95 // FullDrag support
96 virtual bool supportsFullDrag() const override;
97 virtual rtl::Reference<SdrObject> getFullDragClone() const override;
99 virtual bool BegCreate(SdrDragStat& rStat) override;
100 virtual bool MovCreate(SdrDragStat& rStat) override;
101 virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override;
102 virtual bool BckCreate(SdrDragStat& rStat) override;
103 virtual void BrkCreate(SdrDragStat& rStat) override;
104 virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override;
106 virtual void NbcMove(const Size& rSiz) override;
107 virtual void NbcResize(const Point& rRef, const Fraction& xFact,
108 const Fraction& yFact) override;
109 virtual void NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs) override;
110 virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override;
111 virtual void NbcShear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear) override;
113 virtual void Move(const Size& rSiz) override;
114 virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact,
115 bool bUnsetRelative = true) override;
116 virtual void Rotate(const Point& rRef, Degree100 nAngle, double sn, double cs) override;
117 virtual void Mirror(const Point& rRef1, const Point& rRef2) override;
118 virtual void Shear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear) override;
120 virtual void RecalcSnapRect() override;
121 virtual const tools::Rectangle& GetSnapRect() const override;
122 virtual void SetSnapRect(const tools::Rectangle& rRect) override;
123 virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override;
125 virtual const tools::Rectangle& GetLogicRect() const override;
126 virtual void SetLogicRect(const tools::Rectangle& rRect) override;
127 virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
129 virtual Degree100 GetRotateAngle() const override;
130 virtual Degree100 GetShearAngle(bool bVertical = false) const override;
132 virtual sal_uInt32 GetSnapPointCount() const override;
133 virtual Point GetSnapPoint(sal_uInt32 i) const override;
135 virtual bool IsPolyObj() const override;
136 virtual sal_uInt32 GetPointCount() const override;
137 virtual Point GetPoint(sal_uInt32 i) const override;
138 virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i) override;
140 virtual std::unique_ptr<SdrObjGeoData> GetGeoData() const override;
141 virtual void SetGeoData(const SdrObjGeoData& rGeo) override;
143 virtual void NbcReformatText() override;
145 virtual bool HasMacro() const override;
146 virtual SdrObject* CheckMacroHit(const SdrObjMacroHitRec& rRec) const override;
147 virtual PointerStyle GetMacroPointer(const SdrObjMacroHitRec& rRec) const override;
148 virtual void PaintMacro(OutputDevice& rOut, const tools::Rectangle& rDirtyRect,
149 const SdrObjMacroHitRec& rRec) const override;
150 virtual bool DoMacro(const SdrObjMacroHitRec& rRec) override;
152 // #i73248# for default SdrVirtObj, offset is aAnchor, not (0,0)
153 virtual Point GetOffset() const;
156/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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
Abstract DrawObject.
Definition: svdobj.hxx:260
virtual bool BckCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1381
virtual void RecalcSnapRect()
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: svdobj.cxx:1622
virtual void NbcSetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1599
friend class SdrVirtObj
Definition: svdobj.hxx:269
virtual Degree100 GetShearAngle(bool bVertical=false) const
Definition: svdobj.cxx:1674
virtual bool DoMacro(const SdrObjMacroHitRec &rRec)
Definition: svdobj.cxx:1848
virtual Degree100 GetRotateAngle() const
Definition: svdobj.cxx:1669
virtual void NbcSetPoint(const Point &rPnt, sal_uInt32 i)
Definition: svdobj.cxx:1713
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const
Definition: svdobj.cxx:1311
virtual rtl::Reference< SdrObject > getFullDragClone() const
Definition: svdobj.cxx:1305
virtual void NbcSetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1641
virtual sdr::properties::BaseProperties & GetProperties() const
Definition: svdobj.cxx:220
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
Definition: svdobj.cxx:1409
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1560
virtual OUString TakeObjNamePlural() const
Definition: svdobj.cxx:1061
virtual Point GetPoint(sal_uInt32 i) const
Definition: svdobj.cxx:1699
virtual bool BegCreate(SdrDragStat &rStat)
Every object must be able to create itself interactively.
Definition: svdobj.cxx:1347
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
Definition: svdobj.cxx:1095
virtual OUString GetTitle() const
Definition: svdobj.cxx:815
virtual void SetTitle(const OUString &rStr)
Definition: svdobj.cxx:781
virtual void RestoreGeoData(const SdrObjGeoData &rGeo)
Definition: svdobj.cxx:1887
virtual std::unique_ptr< SdrObjGeoData > GetGeoData() const
Definition: svdobj.cxx:1914
virtual void SetDescription(const OUString &rStr)
Definition: svdobj.cxx:825
virtual SdrInventor GetObjInventor() const
Definition: svdobj.cxx:621
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const
Polygon dragged by the user when creating the object.
Definition: svdobj.cxx:1386
virtual sal_uInt32 GetSnapPointCount() const
snap to special points of an Object (polygon points, center of circle)
Definition: svdobj.cxx:1679
virtual bool supportsFullDrag() const
Definition: svdobj.cxx:1300
virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat &rDrag) const
Definition: svdobj.cxx:1339
virtual void Mirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1551
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:715
virtual bool IsPolyObj() const
Definition: svdobj.cxx:1689
virtual void SaveGeoData(SdrObjGeoData &rGeo) const
Definition: svdobj.cxx:1864
virtual bool MovCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1357
virtual void Move(const Size &rSiz)
Definition: svdobj.cxx:1495
virtual bool HasLimitedRotation() const
Definition: svdobj.cxx:1045
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:926
virtual OUString GetDescription() const
Definition: svdobj.cxx:859
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1631
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1475
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1626
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1488
virtual void SetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1660
virtual void SetGeoData(const SdrObjGeoData &rGeo)
Definition: svdobj.cxx:1921
virtual const OUString & GetName() const
Definition: svdobj.cxx:769
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact()
Definition: svdobj.cxx:256
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:1540
virtual void PaintMacro(OutputDevice &rOut, const tools::Rectangle &rDirtyRect, const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1831
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const
Definition: svdobj.cxx:1334
virtual SdrObjKind GetObjIdentifier() const
Definition: svdobj.cxx:626
virtual const tools::Rectangle & GetLastBoundRect() const
Definition: svdobj.cxx:941
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const =0
virtual sal_uInt32 GetHdlCount() const
Via GetHdlCount the number of Handles can be retrieved.
Definition: svdobj.cxx:1190
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1651
virtual void NbcReformatText()
Definition: svdobj.cxx:1802
virtual SdrObject * CheckMacroHit(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1816
virtual OUString TakeObjNameSingul() const
Definition: svdobj.cxx:1051
virtual PointerStyle GetMacroPointer(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1826
virtual void AddToHdlList(SdrHdlList &rHdlList) const
Definition: svdobj.cxx:1195
virtual bool applySpecialDrag(SdrDragStat &rDrag)
Definition: svdobj.cxx:1322
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd)
Definition: svdobj.cxx:1367
virtual void RecalcBoundRect()
Definition: svdobj.cxx:946
virtual void BrkCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1377
virtual bool hasSpecialDrag() const
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdobj.cxx:1295
virtual std::unique_ptr< 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:1859
virtual Point GetSnapPoint(sal_uInt32 i) const
Definition: svdobj.cxx:1684
virtual void SetName(const OUString &rStr, const bool bSetChanged=true)
Definition: svdobj.cxx:732
virtual bool HasMacro() const
Definition: svdobj.cxx:1811
virtual void AddToPlusHdlList(SdrHdlList &rHdlList, SdrHdl &rHdl) const
Definition: svdobj.cxx:1215
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdobj.cxx:1403
virtual sal_uInt32 GetPointCount() const
Definition: svdobj.cxx:1694
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
Definition: svdobj.cxx:631
virtual const tools::Rectangle & GetLogicRect() const
Definition: svdobj.cxx:1636
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
Definition: svdobj.cxx:1512
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs)=0
FIXME: The virtual object is not yet fully implemented and tested.
Definition: svdovirt.hxx:30
rtl::Reference< SdrObject > mxRefObj
Definition: svdovirt.hxx:39
tools::Rectangle aSnapRect
Definition: svdovirt.hxx:40
SdrVirtObj(const SdrVirtObj &)=delete
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
Definition: svdobj.hxx:98
Definition: svdobjkind.hxx:25
Definition: svdtypes.hxx:27
Definition: svxdllapi.h:35