Branch libreoffice-5-0-4
[LibreOffice.git] / include / svx / svdorect.hxx
blobdf1551b429220b822d7e169f38d69281e409589d
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 <svx/svdotext.hxx>
24 #include <svx/svxdllapi.h>
27 // Vorausdeklarationen
30 class XPolygon;
32 namespace sdr { namespace properties {
33 class RectangleProperties;
37 // SdrRectObj
39 // Rechteck-Objekte (Rechteck,Kreis,...)
43 class SVX_DLLPUBLIC SdrRectObj : public SdrTextObj
45 private:
46 // to allow sdr::properties::RectangleProperties access to SetXPolyDirty()
47 friend class sdr::properties::RectangleProperties;
48 friend class SdrTextObj; // wg SetXPolyDirty bei GrowAdjust
50 protected:
51 virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() SAL_OVERRIDE;
52 virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() SAL_OVERRIDE;
54 XPolygon* mpXPoly;
56 protected:
57 XPolygon ImpCalcXPoly(const Rectangle& rRect1, long nRad1) const;
58 void SetXPolyDirty();
60 /// Subclasses should override RecalcXPoly() by creating an XPolygon
61 /// instance with new and assigning it to mpXPoly.
62 virtual void RecalcXPoly();
63 const XPolygon& GetXPoly() const;
64 virtual void RestGeoData(const SdrObjGeoData& rGeo) SAL_OVERRIDE;
66 public:
67 TYPEINFO_OVERRIDE();
68 // Der Eckenradius-Parameter fliegt irgendwann raus. Der Eckenradius
69 // ist dann (spaeter) ueber SfxItems einzustellen (SetAttributes()).
70 // Konstruktion eines Rechteck-Zeichenobjekts
72 SdrRectObj();
73 SdrRectObj(const Rectangle& rRect);
75 SdrRectObj& operator=(const SdrRectObj& rCopy);
77 // Konstruktion eines Textrahmens
78 SdrRectObj(SdrObjKind eNewTextKind);
79 SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rRect);
80 virtual ~SdrRectObj();
82 virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const SAL_OVERRIDE;
83 virtual sal_uInt16 GetObjIdentifier() const SAL_OVERRIDE;
84 virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const SAL_OVERRIDE;
86 virtual OUString TakeObjNameSingul() const SAL_OVERRIDE;
87 virtual OUString TakeObjNamePlural() const SAL_OVERRIDE;
89 virtual SdrRectObj* Clone() const SAL_OVERRIDE;
90 virtual void RecalcSnapRect() SAL_OVERRIDE;
91 virtual void NbcSetSnapRect(const Rectangle& rRect) SAL_OVERRIDE;
92 virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
93 virtual basegfx::B2DPolyPolygon TakeXorPoly() const SAL_OVERRIDE;
95 virtual sal_uInt32 GetHdlCount() const SAL_OVERRIDE;
96 virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const SAL_OVERRIDE;
98 // special drag methods
99 virtual bool hasSpecialDrag() const SAL_OVERRIDE;
100 virtual bool beginSpecialDrag(SdrDragStat& rDrag) const SAL_OVERRIDE;
101 virtual bool applySpecialDrag(SdrDragStat& rDrag) SAL_OVERRIDE;
102 virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const SAL_OVERRIDE;
104 virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const SAL_OVERRIDE;
105 virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
107 virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
108 virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
109 virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) SAL_OVERRIDE;
110 virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
111 virtual void NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) SAL_OVERRIDE;
113 virtual bool DoMacro(const SdrObjMacroHitRec& rRec) SAL_OVERRIDE;
114 virtual OUString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const SAL_OVERRIDE;
116 virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const SAL_OVERRIDE;
117 virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const SAL_OVERRIDE;
119 virtual SdrObject* DoConvertToPolyObj(bool bBezier, bool bAddText) const SAL_OVERRIDE;
121 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) SAL_OVERRIDE;
124 #endif // INCLUDED_SVX_SVDORECT_HXX
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */