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