tdf#124953: Use rangelist's combined range top-left address...
[LibreOffice.git] / include / svx / svdocapt.hxx
blob89942a7b9154c82203050f0c65b9fbafc855cae0
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 INCLUDED_SVX_SVDOCAPT_HXX
21 #define INCLUDED_SVX_SVDOCAPT_HXX
23 #include <svx/svdorect.hxx>
24 #include <svx/svxdllapi.h>
27 // Forward Declarations
28 class ImpCaptParams;
30 namespace sdr { namespace properties {
31 class CaptionProperties;
34 // Helper Class SdrCaptObjGeoData
35 class SdrCaptObjGeoData : public SdrTextObjGeoData
37 public:
38 tools::Polygon aTailPoly;
41 // SdrCaptionObj
42 class SVX_DLLPUBLIC SdrCaptionObj : public SdrRectObj
44 private:
45 // to allow sdr::properties::CaptionProperties access to ImpRecalcTail()
46 friend class sdr::properties::CaptionProperties;
47 friend class SdrTextObj; // for ImpRecalcTail() during AutoGrow
49 // tdf#118662 exclusive friend function and setter for SuppressGetBitmap
50 friend void setSuppressGetBitmapFromXclObjComment(SdrCaptionObj* pSdrCaptionObj, bool bValue);
51 void setSuppressGetBitmap(bool bNew)
53 mbSuppressGetBitmap = bNew;
56 protected:
57 virtual std::unique_ptr<sdr::properties::BaseProperties> CreateObjectSpecificProperties() override;
58 virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
60 private:
61 tools::Polygon aTailPoly; // the whole tail polygon
62 bool mbSpecialTextBoxShadow; // for calc special shadow, default FALSE
63 bool mbFixedTail; // for calc note box fixed tail, default FALSE
64 bool mbSuppressGetBitmap; // tdf#118662
65 Point maFixedTailPos; // for calc note box fixed tail position.
67 SVX_DLLPRIVATE void ImpGetCaptParams(ImpCaptParams& rPara) const;
68 SVX_DLLPRIVATE static void ImpCalcTail1(const ImpCaptParams& rPara, tools::Polygon& rPoly, tools::Rectangle const & rRect);
69 SVX_DLLPRIVATE static void ImpCalcTail2(const ImpCaptParams& rPara, tools::Polygon& rPoly, tools::Rectangle const & rRect);
70 SVX_DLLPRIVATE static void ImpCalcTail3(const ImpCaptParams& rPara, tools::Polygon& rPoly, tools::Rectangle const & rRect);
71 SVX_DLLPRIVATE static void ImpCalcTail (const ImpCaptParams& rPara, tools::Polygon& rPoly, tools::Rectangle const & rRect);
72 SVX_DLLPRIVATE void ImpRecalcTail();
74 protected:
75 // protected destructor
76 virtual ~SdrCaptionObj() override;
78 public:
79 SdrCaptionObj(SdrModel& rSdrModel);
80 SdrCaptionObj(
81 SdrModel& rSdrModel,
82 const tools::Rectangle& rRect,
83 const Point& rTail);
85 // tdf#118662 getter for SuppressGetBitmap
86 bool isSuppressGetBitmap() const { return mbSuppressGetBitmap; }
88 virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
89 virtual sal_uInt16 GetObjIdentifier() const override;
90 virtual SdrCaptionObj* CloneSdrObject(SdrModel& rTargetModel) const override;
92 // implemented mainly for the purposes of Clone()
93 SdrCaptionObj& operator=(const SdrCaptionObj& rObj);
95 // for calc: special shadow only for text box
96 void SetSpecialTextBoxShadow() { mbSpecialTextBoxShadow = true; }
97 bool GetSpecialTextBoxShadow() const { return mbSpecialTextBoxShadow; }
99 // for calc: fixed note tail position.
100 void SetFixedTail() { mbFixedTail = true; }
102 virtual OUString TakeObjNameSingul() const override;
103 virtual OUString TakeObjNamePlural() const override;
105 virtual basegfx::B2DPolyPolygon TakeXorPoly() const override;
106 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
108 virtual sal_uInt32 GetHdlCount() const override;
109 virtual void AddToHdlList(SdrHdlList& rHdlList) const override;
111 // special drag methods
112 virtual bool hasSpecialDrag() const override;
113 virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override;
114 virtual bool applySpecialDrag(SdrDragStat& rDrag) override;
115 virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override;
117 virtual bool BegCreate(SdrDragStat& rStat) override;
118 virtual bool MovCreate(SdrDragStat& rStat) override;
119 virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override;
120 virtual bool BckCreate(SdrDragStat& rStat) override;
121 virtual void BrkCreate(SdrDragStat& rStat) override;
122 virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override;
123 virtual PointerStyle GetCreatePointer() const override;
125 virtual void NbcMove(const Size& rSiz) override;
126 virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
128 virtual void NbcSetRelativePos(const Point& rPnt) override;
129 virtual Point GetRelativePos() const override;
131 virtual const tools::Rectangle& GetLogicRect() const override;
132 virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
134 virtual sal_uInt32 GetSnapPointCount() const override;
135 virtual Point GetSnapPoint(sal_uInt32 i) const override;
137 protected:
138 virtual SdrObjGeoData* NewGeoData() const override;
139 virtual void SaveGeoData(SdrObjGeoData& rGeo) const override;
140 virtual void RestGeoData(const SdrObjGeoData& rGeo) override;
142 public:
143 virtual SdrObject* DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
145 const Point& GetTailPos() const;
146 void SetTailPos(const Point& rPos);
147 void NbcSetTailPos(const Point& rPos);
149 // #i32599#
150 // Add own implementation for TRSetBaseGeometry to handle TailPos over changes
151 virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon) override;
153 const Point& GetFixedTailPos() const {return maFixedTailPos;}
155 // geometry access
156 ::basegfx::B2DPolygon getTailPolygon() const;
160 #endif //_SVDOCAPT_HXX
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */