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 _SVDOCIRC_HXX 25cdf0e10cSrcweir #define _SVDOCIRC_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <svx/svdorect.hxx> 28cdf0e10cSrcweir #include "svx/svxdllapi.h" 29cdf0e10cSrcweir 30cdf0e10cSrcweir //************************************************************ 31cdf0e10cSrcweir // Vorausdeklarationen 32cdf0e10cSrcweir //************************************************************ 33cdf0e10cSrcweir 34cdf0e10cSrcweir namespace sdr { namespace properties { 35cdf0e10cSrcweir class CircleProperties; 36cdf0e10cSrcweir }} 37cdf0e10cSrcweir 38cdf0e10cSrcweir //************************************************************ 39cdf0e10cSrcweir // Hilfsklasse SdrCircObjGeoData 40cdf0e10cSrcweir //************************************************************ 41cdf0e10cSrcweir 42cdf0e10cSrcweir // #109872# 43cdf0e10cSrcweir class SdrCircObjGeoData : public SdrTextObjGeoData 44cdf0e10cSrcweir { 45cdf0e10cSrcweir public: 46cdf0e10cSrcweir long nStartWink; 47cdf0e10cSrcweir long nEndWink; 48cdf0e10cSrcweir }; 49cdf0e10cSrcweir 50cdf0e10cSrcweir //************************************************************ 51cdf0e10cSrcweir // SdrCircObj 52cdf0e10cSrcweir //************************************************************ 53cdf0e10cSrcweir 54cdf0e10cSrcweir class SVX_DLLPUBLIC SdrCircObj : public SdrRectObj 55cdf0e10cSrcweir { 56cdf0e10cSrcweir private: 57cdf0e10cSrcweir // to allow sdr::properties::CircleProperties access to ImpSetAttrToCircInfo() 58cdf0e10cSrcweir friend class sdr::properties::CircleProperties; 59cdf0e10cSrcweir 60cdf0e10cSrcweir // only for SdrCircleAttributes GetCircleKind() const61cdf0e10cSrcweir SdrObjKind GetCircleKind() const { return meCircleKind; } 62cdf0e10cSrcweir 63cdf0e10cSrcweir protected: 64cdf0e10cSrcweir virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); 65cdf0e10cSrcweir virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); 66cdf0e10cSrcweir 67cdf0e10cSrcweir SdrObjKind meCircleKind; 68cdf0e10cSrcweir long nStartWink; 69cdf0e10cSrcweir long nEndWink; 70cdf0e10cSrcweir 71cdf0e10cSrcweir // bitfield 72cdf0e10cSrcweir unsigned mbPolygonIsLine : 1; 73cdf0e10cSrcweir 74cdf0e10cSrcweir private: 75cdf0e10cSrcweir SVX_DLLPRIVATE basegfx::B2DPolygon ImpCalcXPolyCirc(const SdrObjKind eKind, const Rectangle& rRect1, long nStart, long nEnd) const; 76cdf0e10cSrcweir SVX_DLLPRIVATE void ImpSetCreateParams(SdrDragStat& rStat) const; 77cdf0e10cSrcweir SVX_DLLPRIVATE void ImpSetAttrToCircInfo(); // Werte vom Pool kopieren 78cdf0e10cSrcweir SVX_DLLPRIVATE void ImpSetCircInfoToAttr(); // Werte in den Pool kopieren 79cdf0e10cSrcweir 80cdf0e10cSrcweir // Liefert sal_True, wenn das Painten ein XPolygon erfordert. 81cdf0e10cSrcweir SVX_DLLPRIVATE FASTBOOL PaintNeedsXPolyCirc() const; // PaintNeedsXPoly-> PaintNeedsXPolyCirc 82cdf0e10cSrcweir SVX_DLLPRIVATE virtual void RecalcXPoly(); 83cdf0e10cSrcweir 84cdf0e10cSrcweir protected: 85cdf0e10cSrcweir virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint); 86cdf0e10cSrcweir 87cdf0e10cSrcweir public: 88cdf0e10cSrcweir TYPEINFO(); 89cdf0e10cSrcweir SdrCircObj(SdrObjKind eNewKind); // Circ, CArc, Sect oder CCut 90cdf0e10cSrcweir SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect); 91cdf0e10cSrcweir 92cdf0e10cSrcweir // 0=0.00Deg=3h 9000=90.00Deg=12h 18000=180.00Deg=9h 27000=270.00Deg=6h 93cdf0e10cSrcweir // Der Verlauf des Kreises von StartWink nach EndWink ist immer entgegen 94cdf0e10cSrcweir // dem Uhrzeigersinn. 95cdf0e10cSrcweir // Wenn nNewStartWink==nNewEndWink hat der Kreisbogen einen Verlaufswinkel 96cdf0e10cSrcweir // von 0 Grad. Bei nNewStartWink+36000==nNewEndWink ist der Verlaufswinkel 97cdf0e10cSrcweir // 360.00 Grad. 98cdf0e10cSrcweir SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect, long nNewStartWink, long nNewEndWink); 99cdf0e10cSrcweir virtual ~SdrCircObj(); 100cdf0e10cSrcweir 101cdf0e10cSrcweir virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; 102cdf0e10cSrcweir virtual sal_uInt16 GetObjIdentifier() const; 103cdf0e10cSrcweir virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const; 104cdf0e10cSrcweir 105cdf0e10cSrcweir virtual void TakeObjNameSingul(String& rName) const; 106cdf0e10cSrcweir virtual void TakeObjNamePlural(String& rName) const; 107cdf0e10cSrcweir 108cdf0e10cSrcweir virtual void operator=(const SdrObject& rObj); 109cdf0e10cSrcweir virtual void RecalcSnapRect(); 110cdf0e10cSrcweir virtual void NbcSetSnapRect(const Rectangle& rRect); 111cdf0e10cSrcweir virtual basegfx::B2DPolyPolygon TakeXorPoly() const; 112cdf0e10cSrcweir 113cdf0e10cSrcweir virtual sal_uInt32 GetSnapPointCount() const; 114cdf0e10cSrcweir virtual Point GetSnapPoint(sal_uInt32 i) const; 115cdf0e10cSrcweir 116cdf0e10cSrcweir virtual sal_uInt32 GetHdlCount() const; 117cdf0e10cSrcweir virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const; 118cdf0e10cSrcweir 119cdf0e10cSrcweir // special drag methods 120cdf0e10cSrcweir virtual bool hasSpecialDrag() const; 121cdf0e10cSrcweir virtual bool beginSpecialDrag(SdrDragStat& rDrag) const; 122cdf0e10cSrcweir virtual bool applySpecialDrag(SdrDragStat& rDrag); 123cdf0e10cSrcweir virtual String getSpecialDragComment(const SdrDragStat& rDrag) const; 124cdf0e10cSrcweir 125cdf0e10cSrcweir virtual FASTBOOL BegCreate(SdrDragStat& rStat); 126cdf0e10cSrcweir virtual FASTBOOL MovCreate(SdrDragStat& rStat); 127cdf0e10cSrcweir virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd); 128cdf0e10cSrcweir virtual FASTBOOL BckCreate(SdrDragStat& rStat); 129cdf0e10cSrcweir virtual void BrkCreate(SdrDragStat& rStat); 130cdf0e10cSrcweir virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const; 131cdf0e10cSrcweir virtual Pointer GetCreatePointer() const; 132cdf0e10cSrcweir virtual void NbcMove(const Size& aSiz); 133cdf0e10cSrcweir virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact); 134cdf0e10cSrcweir virtual void NbcMirror(const Point& rRef1, const Point& rRef2); 135cdf0e10cSrcweir virtual void NbcShear (const Point& rRef, long nWink, double tn, FASTBOOL bVShear); 136a5258243SPedro Giffuni virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const; 137cdf0e10cSrcweir 138cdf0e10cSrcweir protected: 139cdf0e10cSrcweir virtual SdrObjGeoData* NewGeoData() const; 140cdf0e10cSrcweir virtual void SaveGeoData(SdrObjGeoData& rGeo) const; 141cdf0e10cSrcweir virtual void RestGeoData(const SdrObjGeoData& rGeo); 142cdf0e10cSrcweir public: GetStartWink() const143cdf0e10cSrcweir long GetStartWink() const { return nStartWink; } GetEndWink() const144cdf0e10cSrcweir long GetEndWink() const { return nEndWink; } 145cdf0e10cSrcweir 146cdf0e10cSrcweir }; 147cdf0e10cSrcweir 148cdf0e10cSrcweir #endif //_SVDOCIRC_HXX 149cdf0e10cSrcweir 150