Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef _SVDCAPT_HXX
21 : #define _SVDCAPT_HXX
22 :
23 : #include <svx/svdorect.hxx>
24 : #include "svx/svxdllapi.h"
25 :
26 : //************************************************************
27 : // Vorausdeklarationen
28 : //************************************************************
29 :
30 : class ImpCaptParams;
31 :
32 : namespace sdr { namespace properties {
33 : class CaptionProperties;
34 : }}
35 :
36 : //************************************************************
37 : // Hilfsklasse SdrCaptObjGeoData
38 : //************************************************************
39 :
40 : // #109872#
41 : class SdrCaptObjGeoData : public SdrTextObjGeoData
42 : {
43 : public:
44 : Polygon aTailPoly;
45 : };
46 :
47 : //************************************************************
48 : // SdrCaptionObj
49 : //************************************************************
50 :
51 : class SVX_DLLPUBLIC SdrCaptionObj : public SdrRectObj
52 : {
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
57 :
58 : protected:
59 : virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
60 : virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
61 :
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.
67 :
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();
76 :
77 : public:
78 : TYPEINFO();
79 : SdrCaptionObj();
80 : SdrCaptionObj(const Rectangle& rRect, const Point& rTail);
81 : virtual ~SdrCaptionObj();
82 :
83 : virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
84 : virtual sal_uInt16 GetObjIdentifier() const;
85 : virtual SdrCaptionObj* Clone() const;
86 :
87 : // for calc: special shadow only for text box
88 1 : void SetSpecialTextBoxShadow() { mbSpecialTextBoxShadow = sal_True; }
89 : sal_Bool GetSpecialTextBoxShadow() const { return mbSpecialTextBoxShadow; }
90 :
91 : // for calc: fixed note tail position.
92 1 : void SetFixedTail() { mbFixedTail = sal_True; }
93 :
94 : virtual void TakeObjNameSingul(String& rName) const;
95 : virtual void TakeObjNamePlural(String& rName) const;
96 :
97 : virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
98 : virtual void SetModel(SdrModel* pNewModel);
99 : virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
100 :
101 : virtual sal_uInt32 GetHdlCount() const;
102 : virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
103 :
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;
109 :
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;
117 :
118 : virtual void NbcMove(const Size& rSiz);
119 : virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
120 :
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;
125 :
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);
131 :
132 : virtual sal_uInt32 GetSnapPointCount() const;
133 : virtual Point GetSnapPoint(sal_uInt32 i) const;
134 :
135 : protected:
136 : virtual SdrObjGeoData* NewGeoData() const;
137 : virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
138 : virtual void RestGeoData(const SdrObjGeoData& rGeo);
139 :
140 : public:
141 : virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
142 :
143 : const Point& GetTailPos() const;
144 : void SetTailPos(const Point& rPos);
145 : void NbcSetTailPos(const Point& rPos);
146 :
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);
150 :
151 : inline const Point& GetFixedTailPos() const {return maFixedTailPos;}
152 :
153 : // geometry access
154 : ::basegfx::B2DPolygon getTailPolygon() const;
155 : };
156 :
157 : ////////////////////////////////////////////////////////////////////////////////////////////////////
158 :
159 : #endif //_SVDOCAPT_HXX
160 :
161 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|