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 _SVDCAPT_HXX 25cdf0e10cSrcweir #define _SVDCAPT_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <svx/svdorect.hxx> 28cdf0e10cSrcweir #include "svx/svxdllapi.h" 29cdf0e10cSrcweir 30cdf0e10cSrcweir //************************************************************ 31cdf0e10cSrcweir // Vorausdeklarationen 32cdf0e10cSrcweir //************************************************************ 33cdf0e10cSrcweir 34cdf0e10cSrcweir class ImpCaptParams; 35cdf0e10cSrcweir 36cdf0e10cSrcweir namespace sdr { namespace properties { 37cdf0e10cSrcweir class CaptionProperties; 38cdf0e10cSrcweir }} 39cdf0e10cSrcweir 40cdf0e10cSrcweir #define SDRSETITEM_CAPTION_ATTR SDRSETITEM_ATTR_COUNT 41cdf0e10cSrcweir 42cdf0e10cSrcweir //************************************************************ 43cdf0e10cSrcweir // Hilfsklasse SdrCaptObjGeoData 44cdf0e10cSrcweir //************************************************************ 45cdf0e10cSrcweir 46cdf0e10cSrcweir // #109872# 47cdf0e10cSrcweir class SdrCaptObjGeoData : public SdrTextObjGeoData 48cdf0e10cSrcweir { 49cdf0e10cSrcweir public: 50cdf0e10cSrcweir Polygon aTailPoly; 51cdf0e10cSrcweir }; 52cdf0e10cSrcweir 53cdf0e10cSrcweir //************************************************************ 54cdf0e10cSrcweir // SdrCaptionObj 55cdf0e10cSrcweir //************************************************************ 56cdf0e10cSrcweir 57cdf0e10cSrcweir class SVX_DLLPUBLIC SdrCaptionObj : public SdrRectObj 58cdf0e10cSrcweir { 59cdf0e10cSrcweir private: 60cdf0e10cSrcweir // to allow sdr::properties::CaptionProperties access to ImpRecalcTail() 61cdf0e10cSrcweir friend class sdr::properties::CaptionProperties; 62cdf0e10cSrcweir friend class SdrTextObj; // fuer ImpRecalcTail() bei AutoGrow 63cdf0e10cSrcweir 64cdf0e10cSrcweir protected: 65cdf0e10cSrcweir virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); 66cdf0e10cSrcweir virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); 67cdf0e10cSrcweir 68cdf0e10cSrcweir private: 69cdf0e10cSrcweir Polygon aTailPoly; // das ganze Polygon des Schwanzes 70cdf0e10cSrcweir sal_Bool mbSpecialTextBoxShadow; // for calc special shadow, default FALSE 71cdf0e10cSrcweir sal_Bool mbFixedTail; // for calc note box fixed tail, default FALSE 72cdf0e10cSrcweir Point maFixedTailPos; // for calc note box fixed tail position. 73cdf0e10cSrcweir 74cdf0e10cSrcweir private: 75cdf0e10cSrcweir SVX_DLLPRIVATE void ImpGetCaptParams(ImpCaptParams& rPara) const; 76cdf0e10cSrcweir SVX_DLLPRIVATE void ImpCalcTail1(const ImpCaptParams& rPara, Polygon& rPoly, Rectangle& rRect) const; 77cdf0e10cSrcweir SVX_DLLPRIVATE void ImpCalcTail2(const ImpCaptParams& rPara, Polygon& rPoly, Rectangle& rRect) const; 78cdf0e10cSrcweir SVX_DLLPRIVATE void ImpCalcTail3(const ImpCaptParams& rPara, Polygon& rPoly, Rectangle& rRect) const; 79cdf0e10cSrcweir SVX_DLLPRIVATE void ImpCalcTail4(const ImpCaptParams& rPara, Polygon& rPoly, Rectangle& rRect) const; 80cdf0e10cSrcweir SVX_DLLPRIVATE void ImpCalcTail (const ImpCaptParams& rPara, Polygon& rPoly, Rectangle& rRect) const; 81cdf0e10cSrcweir SVX_DLLPRIVATE void ImpRecalcTail(); 82cdf0e10cSrcweir 83cdf0e10cSrcweir public: 84cdf0e10cSrcweir TYPEINFO(); 85cdf0e10cSrcweir SdrCaptionObj(); 86cdf0e10cSrcweir SdrCaptionObj(const Rectangle& rRect); 87cdf0e10cSrcweir SdrCaptionObj(const Rectangle& rRect, const Point& rTail); 88cdf0e10cSrcweir virtual ~SdrCaptionObj(); 89cdf0e10cSrcweir 90cdf0e10cSrcweir virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; 91cdf0e10cSrcweir virtual sal_uInt16 GetObjIdentifier() const; 92cdf0e10cSrcweir virtual void operator=(const SdrObject& rObj); 93cdf0e10cSrcweir 94cdf0e10cSrcweir // for calc: special shadow only for text box SetSpecialTextBoxShadow()95cdf0e10cSrcweir void SetSpecialTextBoxShadow() { mbSpecialTextBoxShadow = sal_True; } GetSpecialTextBoxShadow() const96cdf0e10cSrcweir sal_Bool GetSpecialTextBoxShadow() const { return mbSpecialTextBoxShadow; } 97cdf0e10cSrcweir 98cdf0e10cSrcweir // for calc: fixed note tail position. SetFixedTail()99cdf0e10cSrcweir void SetFixedTail() { mbFixedTail = sal_True; } 100cdf0e10cSrcweir 101cdf0e10cSrcweir virtual void TakeObjNameSingul(String& rName) const; 102cdf0e10cSrcweir virtual void TakeObjNamePlural(String& rName) const; 103cdf0e10cSrcweir 104cdf0e10cSrcweir virtual basegfx::B2DPolyPolygon TakeXorPoly() const; 105cdf0e10cSrcweir virtual void SetModel(SdrModel* pNewModel); 106cdf0e10cSrcweir virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint); 107cdf0e10cSrcweir 108cdf0e10cSrcweir virtual sal_uInt32 GetHdlCount() const; 109cdf0e10cSrcweir virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const; 110cdf0e10cSrcweir 111cdf0e10cSrcweir // special drag methods 112cdf0e10cSrcweir virtual bool hasSpecialDrag() const; 113cdf0e10cSrcweir virtual bool beginSpecialDrag(SdrDragStat& rDrag) const; 114cdf0e10cSrcweir virtual bool applySpecialDrag(SdrDragStat& rDrag); 115cdf0e10cSrcweir virtual String getSpecialDragComment(const SdrDragStat& rDrag) const; 116cdf0e10cSrcweir 117cdf0e10cSrcweir virtual FASTBOOL BegCreate(SdrDragStat& rStat); 118cdf0e10cSrcweir virtual FASTBOOL MovCreate(SdrDragStat& rStat); 119cdf0e10cSrcweir virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd); 120cdf0e10cSrcweir virtual FASTBOOL BckCreate(SdrDragStat& rStat); 121cdf0e10cSrcweir virtual void BrkCreate(SdrDragStat& rStat); 122cdf0e10cSrcweir virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const; 123cdf0e10cSrcweir virtual Pointer GetCreatePointer() const; 124cdf0e10cSrcweir 125cdf0e10cSrcweir virtual void NbcMove(const Size& rSiz); 126cdf0e10cSrcweir virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact); 127cdf0e10cSrcweir 128cdf0e10cSrcweir virtual void NbcSetRelativePos(const Point& rPnt); 129cdf0e10cSrcweir virtual Point GetRelativePos() const; 130cdf0e10cSrcweir virtual void NbcSetAnchorPos(const Point& rPnt); 131cdf0e10cSrcweir virtual const Point& GetAnchorPos() const; 132cdf0e10cSrcweir 133cdf0e10cSrcweir virtual void RecalcSnapRect(); 134cdf0e10cSrcweir virtual const Rectangle& GetSnapRect() const; 135cdf0e10cSrcweir virtual void NbcSetSnapRect(const Rectangle& rRect); 136cdf0e10cSrcweir virtual const Rectangle& GetLogicRect() const; 137cdf0e10cSrcweir virtual void NbcSetLogicRect(const Rectangle& rRect); 138cdf0e10cSrcweir 139cdf0e10cSrcweir virtual sal_uInt32 GetSnapPointCount() const; 140cdf0e10cSrcweir virtual Point GetSnapPoint(sal_uInt32 i) const; 141cdf0e10cSrcweir 142cdf0e10cSrcweir protected: 143cdf0e10cSrcweir virtual SdrObjGeoData* NewGeoData() const; 144cdf0e10cSrcweir virtual void SaveGeoData(SdrObjGeoData& rGeo) const; 145cdf0e10cSrcweir virtual void RestGeoData(const SdrObjGeoData& rGeo); 146cdf0e10cSrcweir 147cdf0e10cSrcweir public: 148a5258243SPedro Giffuni virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const; 149cdf0e10cSrcweir 150cdf0e10cSrcweir const Point& GetTailPos() const; 151cdf0e10cSrcweir void SetTailPos(const Point& rPos); 152cdf0e10cSrcweir void NbcSetTailPos(const Point& rPos); 153cdf0e10cSrcweir 154cdf0e10cSrcweir // #i32599# 155cdf0e10cSrcweir // Add own implementation for TRSetBaseGeometry to handle TailPos over changes 156cdf0e10cSrcweir virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon); 157cdf0e10cSrcweir GetFixedTailPos() const158cdf0e10cSrcweir inline const Point& GetFixedTailPos() const {return maFixedTailPos;} 159cdf0e10cSrcweir 160cdf0e10cSrcweir // geometry access 161cdf0e10cSrcweir ::basegfx::B2DPolygon getTailPolygon() const; 162cdf0e10cSrcweir }; 163cdf0e10cSrcweir 164cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 165cdf0e10cSrcweir 166cdf0e10cSrcweir #endif //_SVDOCAPT_HXX 167cdf0e10cSrcweir 168