1*3334a7e6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*3334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*3334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*3334a7e6SAndrew Rist * distributed with this work for additional information 6*3334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*3334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*3334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 9*3334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 10*3334a7e6SAndrew Rist * 11*3334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*3334a7e6SAndrew Rist * 13*3334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*3334a7e6SAndrew Rist * software distributed under the License is distributed on an 15*3334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 17*3334a7e6SAndrew Rist * specific language governing permissions and limitations 18*3334a7e6SAndrew Rist * under the License. 19*3334a7e6SAndrew Rist * 20*3334a7e6SAndrew Rist *************************************************************/ 21*3334a7e6SAndrew Rist 22*3334a7e6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SVDORECT_HXX 25cdf0e10cSrcweir #define _SVDORECT_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <svx/svdotext.hxx> 28cdf0e10cSrcweir #include "svx/svxdllapi.h" 29cdf0e10cSrcweir 30cdf0e10cSrcweir //************************************************************ 31cdf0e10cSrcweir // Vorausdeklarationen 32cdf0e10cSrcweir //************************************************************ 33cdf0e10cSrcweir 34cdf0e10cSrcweir class XPolygon; 35cdf0e10cSrcweir 36cdf0e10cSrcweir namespace sdr { namespace properties { 37cdf0e10cSrcweir class RectangleProperties; 38cdf0e10cSrcweir }} 39cdf0e10cSrcweir 40cdf0e10cSrcweir //************************************************************ 41cdf0e10cSrcweir // SdrRectObj 42cdf0e10cSrcweir // 43cdf0e10cSrcweir // Rechteck-Objekte (Rechteck,Kreis,...) 44cdf0e10cSrcweir // 45cdf0e10cSrcweir //************************************************************ 46cdf0e10cSrcweir 47cdf0e10cSrcweir class SVX_DLLPUBLIC SdrRectObj : public SdrTextObj 48cdf0e10cSrcweir { 49cdf0e10cSrcweir private: 50cdf0e10cSrcweir // to allow sdr::properties::RectangleProperties access to SetXPolyDirty() 51cdf0e10cSrcweir friend class sdr::properties::RectangleProperties; 52cdf0e10cSrcweir friend class SdrTextObj; // wg SetXPolyDirty bei GrowAdjust 53cdf0e10cSrcweir 54cdf0e10cSrcweir protected: 55cdf0e10cSrcweir virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); 56cdf0e10cSrcweir virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); 57cdf0e10cSrcweir 58cdf0e10cSrcweir XPolygon* mpXPoly; 59cdf0e10cSrcweir 60cdf0e10cSrcweir protected: 61cdf0e10cSrcweir // Liefert sal_True, wenn das Painten ein Polygon erfordert. 62cdf0e10cSrcweir FASTBOOL PaintNeedsXPoly(long nEckRad) const; 63cdf0e10cSrcweir 64cdf0e10cSrcweir protected: 65cdf0e10cSrcweir XPolygon ImpCalcXPoly(const Rectangle& rRect1, long nRad1) const; 66cdf0e10cSrcweir void SetXPolyDirty(); 67cdf0e10cSrcweir 68cdf0e10cSrcweir // RecalcXPoly sollte ueberladen werden. Dabei muss dann eine XPolygon 69cdf0e10cSrcweir // Instanz generiert (new) und an mpXPoly zugewiesen werden. 70cdf0e10cSrcweir virtual void RecalcXPoly(); 71cdf0e10cSrcweir const XPolygon& GetXPoly() const; 72cdf0e10cSrcweir virtual void RestGeoData(const SdrObjGeoData& rGeo); 73cdf0e10cSrcweir 74cdf0e10cSrcweir public: 75cdf0e10cSrcweir TYPEINFO(); 76cdf0e10cSrcweir // Der Eckenradius-Parameter fliegt irgendwann raus. Der Eckenradius 77cdf0e10cSrcweir // ist dann (spaeter) ueber SfxItems einzustellen (SetAttributes()). 78cdf0e10cSrcweir // Konstruktion eines Rechteck-Zeichenobjekts 79cdf0e10cSrcweir 80cdf0e10cSrcweir SdrRectObj(); 81cdf0e10cSrcweir SdrRectObj(const Rectangle& rRect); 82cdf0e10cSrcweir 83cdf0e10cSrcweir // Konstruktion eines Textrahmens 84cdf0e10cSrcweir SdrRectObj(SdrObjKind eNewTextKind); 85cdf0e10cSrcweir SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rRect); 86cdf0e10cSrcweir // der sal_uInt16 eFormat nimmt Werte des enum EETextFormat entgegen 87cdf0e10cSrcweir SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect, SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat); 88cdf0e10cSrcweir virtual ~SdrRectObj(); 89cdf0e10cSrcweir 90cdf0e10cSrcweir virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; 91cdf0e10cSrcweir virtual sal_uInt16 GetObjIdentifier() const; 92cdf0e10cSrcweir virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const; 93cdf0e10cSrcweir 94cdf0e10cSrcweir virtual void TakeObjNameSingul(String& rName) const; 95cdf0e10cSrcweir virtual void TakeObjNamePlural(String& rName) const; 96cdf0e10cSrcweir 97cdf0e10cSrcweir virtual void operator=(const SdrObject& rObj); 98cdf0e10cSrcweir virtual void RecalcSnapRect(); 99cdf0e10cSrcweir virtual void NbcSetSnapRect(const Rectangle& rRect); 100cdf0e10cSrcweir virtual void NbcSetLogicRect(const Rectangle& rRect); 101cdf0e10cSrcweir virtual basegfx::B2DPolyPolygon TakeXorPoly() const; 102cdf0e10cSrcweir 103cdf0e10cSrcweir virtual sal_uInt32 GetHdlCount() const; 104cdf0e10cSrcweir virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const; 105cdf0e10cSrcweir 106cdf0e10cSrcweir // special drag methods 107cdf0e10cSrcweir virtual bool hasSpecialDrag() const; 108cdf0e10cSrcweir virtual bool beginSpecialDrag(SdrDragStat& rDrag) const; 109cdf0e10cSrcweir virtual bool applySpecialDrag(SdrDragStat& rDrag); 110cdf0e10cSrcweir virtual String getSpecialDragComment(const SdrDragStat& rDrag) const; 111cdf0e10cSrcweir 112cdf0e10cSrcweir virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const; 113cdf0e10cSrcweir virtual Pointer GetCreatePointer() const; 114cdf0e10cSrcweir 115cdf0e10cSrcweir virtual void NbcMove(const Size& rSiz); 116cdf0e10cSrcweir virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact); 117cdf0e10cSrcweir virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs); 118cdf0e10cSrcweir virtual void NbcMirror(const Point& rRef1, const Point& rRef2); 119cdf0e10cSrcweir virtual void NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear); 120cdf0e10cSrcweir 121cdf0e10cSrcweir virtual FASTBOOL DoMacro(const SdrObjMacroHitRec& rRec); 122cdf0e10cSrcweir virtual XubString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const; 123cdf0e10cSrcweir 124cdf0e10cSrcweir virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const; 125cdf0e10cSrcweir virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const; 126cdf0e10cSrcweir 127a5258243SPedro Giffuni virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const; 128cdf0e10cSrcweir 129cdf0e10cSrcweir virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint); 130cdf0e10cSrcweir }; 131cdf0e10cSrcweir 132cdf0e10cSrcweir #endif //_SVDORECT_HXX 133cdf0e10cSrcweir 134