LibreOffice Module svx (master) 1
svdocapt.cxx
Go to the documentation of this file.
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#include <sal/config.h>
21
22#include <cassert>
23
29#include <tools/bigint.hxx>
30#include <tools/helpers.hxx>
31
32#include <svx/dialmgr.hxx>
33#include <svx/strings.hrc>
34
38#include <svx/sdooitm.hxx>
39#include <svx/svddrag.hxx>
40#include <svx/svdhdl.hxx>
41#include <svx/svdmodel.hxx>
42#include <svx/svdocapt.hxx>
43#include <svx/svdopath.hxx>
44#include <svx/svdogrp.hxx>
45#include <svx/svdpage.hxx>
46#include <svx/svdtrans.hxx>
47#include <svx/svdview.hxx>
48#include <svx/sxcecitm.hxx>
49#include <svx/sxcgitm.hxx>
50#include <svx/sxcllitm.hxx>
51#include <svx/sxctitm.hxx>
52#include <vcl/canvastools.hxx>
53#include <vcl/ptrstyle.hxx>
54
55namespace {
56
57enum EscDir {LKS,RTS,OBN,UNT};
58
59}
60
62{
63public:
71 bool bEscRel;
73
74public:
77 nGap(0), nEscRel(5000), nEscAbs(0),
79 bFitLineLen(true), bEscRel(true), bFixedAngle(false)
80 {
81 }
82 void CalcEscPos(const Point& rTail, const tools::Rectangle& rRect, Point& rPt, EscDir& rDir) const;
83};
84
85void ImpCaptParams::CalcEscPos(const Point& rTailPt, const tools::Rectangle& rRect, Point& rPt, EscDir& rDir) const
86{
87 Point aTl(rTailPt); // copy locally for performance reasons
88 tools::Long nX,nY;
89 if (bEscRel) {
90 nX=rRect.Right()-rRect.Left();
91 nX=BigMulDiv(nX,nEscRel,10000);
92 nY=rRect.Bottom()-rRect.Top();
93 nY=BigMulDiv(nY,nEscRel,10000);
94 } else {
95 nX=nEscAbs;
96 nY=nEscAbs;
97 }
98 nX+=rRect.Left();
99 nY+=rRect.Top();
100 Point aBestPt;
101 EscDir eBestDir=LKS;
103 if (!bTryH) {
106 } else {
108 }
109 }
111 if (!bTryV) {
114 } else {
116 }
117 }
118
119 if (bTryH) {
120 Point aLft(rRect.Left()-nGap,nY);
121 Point aRgt(rRect.Right()+nGap,nY);
122 bool bLft=(aTl.X()-aLft.X()<aRgt.X()-aTl.X());
123 if (bLft) {
124 eBestDir=LKS;
125 aBestPt=aLft;
126 } else {
127 eBestDir=RTS;
128 aBestPt=aRgt;
129 }
130 }
131 if (bTryV) {
132 Point aTop(nX,rRect.Top()-nGap);
133 Point aBtm(nX,rRect.Bottom()+nGap);
134 bool bTop=(aTl.Y()-aTop.Y()<aBtm.Y()-aTl.Y());
135 Point aBest2;
136 EscDir eBest2;
137 if (bTop) {
138 eBest2=OBN;
139 aBest2=aTop;
140 } else {
141 eBest2=UNT;
142 aBest2=aBtm;
143 }
145 if (!bTakeIt) {
146 BigInt aHorX(aBestPt.X()-aTl.X()); aHorX*=aHorX;
147 BigInt aHorY(aBestPt.Y()-aTl.Y()); aHorY*=aHorY;
148 BigInt aVerX(aBest2.X()-aTl.X()); aVerX*=aVerX;
149 BigInt aVerY(aBest2.Y()-aTl.Y()); aVerY*=aVerY;
151 bTakeIt=aVerX+aVerY<aHorX+aHorY;
152 } else {
153 bTakeIt=aVerX+aVerY>=aHorX+aHorY;
154 }
155 }
156 if (bTakeIt) {
157 aBestPt=aBest2;
158 eBestDir=eBest2;
159 }
160 }
161 rPt=aBestPt;
162 rDir=eBestDir;
163}
164
165
166// BaseProperties section
167
168std::unique_ptr<sdr::properties::BaseProperties> SdrCaptionObj::CreateObjectSpecificProperties()
169{
170 return std::make_unique<sdr::properties::CaptionProperties>(*this);
171}
172
173
174// DrawContact section
175
176std::unique_ptr<sdr::contact::ViewContact> SdrCaptionObj::CreateObjectSpecificViewContact()
177{
178 return std::make_unique<sdr::contact::ViewContactOfSdrCaptionObj>(*this);
179}
180
181
183: SdrRectObj(rSdrModel, SdrObjKind::Text),
184 aTailPoly(3), // default size: 3 points = 2 lines
185 mbSpecialTextBoxShadow(false),
186 mbFixedTail(false),
187 mbSuppressGetBitmap(false)
188{
189}
190
192: SdrRectObj(rSdrModel, rSource),
193 mbSuppressGetBitmap(false)
194{
195 aTailPoly = rSource.aTailPoly;
197 mbFixedTail = rSource.mbFixedTail;
199}
200
202 SdrModel& rSdrModel,
203 const tools::Rectangle& rRect,
204 const Point& rTail)
205: SdrRectObj(rSdrModel, SdrObjKind::Text,rRect),
206 aTailPoly(3), // default size: 3 points = 2 lines
207 mbSpecialTextBoxShadow(false),
208 mbFixedTail(false),
209 mbSuppressGetBitmap(false)
210{
211 aTailPoly[0]=maFixedTailPos=rTail;
212}
213
215{
216}
217
219{
220 rInfo.bRotateFreeAllowed=false;
221 rInfo.bRotate90Allowed =false;
222 rInfo.bMirrorFreeAllowed=false;
223 rInfo.bMirror45Allowed =false;
224 rInfo.bMirror90Allowed =false;
225 rInfo.bTransparenceAllowed = false;
226 rInfo.bShearAllowed =false;
227 rInfo.bEdgeRadiusAllowed=false;
228 rInfo.bCanConvToPath =true;
229 rInfo.bCanConvToPoly =true;
230 rInfo.bCanConvToPathLineToArea=false;
231 rInfo.bCanConvToPolyLineToArea=false;
233}
234
236{
237 return SdrObjKind::Caption;
238}
239
241{
242 return new SdrCaptionObj(rTargetModel, *this);
243}
244
246{
247 OUString sName(SvxResId(STR_ObjNameSingulCAPTION));
248
249 OUString aName(GetName());
250 if (!aName.isEmpty())
251 sName += " '" + aName + "'";
252
253 return sName;
254}
255
257{
258 return SvxResId(STR_ObjNamePluralCAPTION);
259}
260
262{
264 aPolyPoly.append(aTailPoly.getB2DPolygon());
265
266 return aPolyPoly;
267}
268
270{
271 sal_uInt32 nCount1(SdrRectObj::GetHdlCount());
272 // Currently only dragging the tail's end is implemented.
273 return nCount1 + 1;
274}
275
277{
278 SdrRectObj::AddToHdlList(rHdlList);
279 // Currently only dragging the tail's end is implemented.
280 std::unique_ptr<SdrHdl> pHdl(new SdrHdl(aTailPoly.GetPoint(0), SdrHdlKind::Poly));
281 pHdl->SetPolyNum(1);
282 pHdl->SetPointNum(0);
283 rHdlList.AddHdl(std::move(pHdl));
284}
285
287{
288 return true;
289}
290
292{
293 const SdrHdl* pHdl = rDrag.GetHdl();
294 rDrag.SetEndDragChangesAttributes(true);
296
297 if(pHdl && 0 == pHdl->GetPolyNum())
298 {
299 return SdrRectObj::beginSpecialDrag(rDrag);
300 }
301 else
302 {
303 rDrag.SetOrtho8Possible();
304
305 if(!pHdl)
306 {
307 if (m_bMovProt)
308 return false;
309
310 rDrag.SetNoSnap();
312
313 Point aHit(rDrag.GetStart());
314
315 if(rDrag.GetPageView() && SdrObjectPrimitiveHit(*this, aHit, {0, 0}, *rDrag.GetPageView(), nullptr, false))
316 {
317 return true;
318 }
319 }
320 else
321 {
322 if((1 == pHdl->GetPolyNum()) && (0 == pHdl->GetPointNum()))
323 return true;
324 }
325 }
326
327 return false;
328}
329
331{
332 const SdrHdl* pHdl = rDrag.GetHdl();
333
334 if(pHdl && 0 == pHdl->GetPolyNum())
335 {
336 const bool bRet(SdrRectObj::applySpecialDrag(rDrag));
339
340 return bRet;
341 }
342 else
343 {
344 Point aDelta(rDrag.GetNow()-rDrag.GetStart());
345
346 if(!pHdl)
347 {
348 moveRectangle(aDelta.X(), aDelta.Y());
349 }
350 else
351 {
352 aTailPoly[0] += aDelta;
353 }
354
357
358 return true;
359 }
360}
361
363{
364 const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj());
365
366 if(bCreateComment)
367 {
368 return OUString();
369 }
370 else
371 {
372 const SdrHdl* pHdl = rDrag.GetHdl();
373
374 if(pHdl && 0 == pHdl->GetPolyNum())
375 {
377 }
378 else
379 {
380 if(!pHdl)
381 {
382 return ImpGetDescriptionStr(STR_DragCaptFram);
383 }
384 else
385 {
386 return ImpGetDescriptionStr(STR_DragCaptTail);
387 }
388 }
389 }
390}
391
392
394{
396 rPara.eType =rSet.Get(SDRATTR_CAPTIONTYPE ).GetValue();
398 rPara.nGap =static_cast<const SdrCaptionGapItem&> (rSet.Get(SDRATTR_CAPTIONGAP )).GetValue();
399 rPara.eEscDir =rSet.Get(SDRATTR_CAPTIONESCDIR ).GetValue();
400 rPara.bEscRel =rSet.Get(SDRATTR_CAPTIONESCISREL ).GetValue();
401 rPara.nEscRel =rSet.Get(SDRATTR_CAPTIONESCREL ).GetValue();
402 rPara.nEscAbs =rSet.Get(SDRATTR_CAPTIONESCABS ).GetValue();
403 rPara.nLineLen =rSet.Get(SDRATTR_CAPTIONLINELEN ).GetValue();
405}
406
408{
409 ImpCaptParams aPara;
410 ImpGetCaptParams(aPara);
414}
415
416// #i35971#
417// SdrCaptionObj::ImpCalcTail1 does move the object(!). What a hack.
418// I really wonder why this had not triggered problems before. I am
419// sure there are some places where SetTailPos() is called at least
420// twice or SetSnapRect after it again just to work around this.
421// Changed this method to not do that.
422// Also found why this has been done: For interactive dragging of the
423// tail end pos for SdrCaptionType::Type1. This sure was the simplest method
424// to achieve this, at the cost of making a whole group of const methods
425// of this object implicitly change the object's position.
427{
428 tools::Polygon aPol(2);
429 Point aTl(rPoly[0]);
430
431 aPol[0] = aTl;
432 aPol[1] = aTl;
433
434 EscDir eEscDir;
435 Point aEscPos;
436
437 rPara.CalcEscPos(aTl, rRect, aEscPos, eEscDir);
438 aPol[1] = aEscPos;
439
440 if(eEscDir==LKS || eEscDir==RTS)
441 {
442 aPol[0].setX( aEscPos.X() );
443 }
444 else
445 {
446 aPol[0].setY( aEscPos.Y() );
447 }
448
449 rPoly = aPol;
450}
451
453{ // Gap/EscDir/EscPos/Angle
454 tools::Polygon aPol(2);
455 Point aTl(rPoly[0]);
456 aPol[0]=aTl;
457
458 EscDir eEscDir;
459 Point aEscPos;
460 rPara.CalcEscPos(aTl,rRect,aEscPos,eEscDir);
461 aPol[1]=aEscPos;
462
463 if (!rPara.bFixedAngle) {
464 // TODO: Implementation missing.
465 }
466 rPoly=aPol;
467}
468
470{ // Gap/EscDir/EscPos/Angle/LineLen
471 tools::Polygon aPol(3);
472 Point aTl(rPoly[0]);
473 aPol[0]=aTl;
474
475 EscDir eEscDir;
476 Point aEscPos;
477 rPara.CalcEscPos(aTl,rRect,aEscPos,eEscDir);
478 aPol[1]=aEscPos;
479 aPol[2]=aEscPos;
480
481 if (eEscDir==LKS || eEscDir==RTS) {
482 if (rPara.bFitLineLen) {
483 aPol[1].setX((aTl.X()+aEscPos.X())/2 );
484 } else {
485 if (eEscDir==LKS) aPol[1].AdjustX( -(rPara.nLineLen) );
486 else aPol[1].AdjustX(rPara.nLineLen );
487 }
488 } else {
489 if (rPara.bFitLineLen) {
490 aPol[1].setY((aTl.Y()+aEscPos.Y())/2 );
491 } else {
492 if (eEscDir==OBN) aPol[1].AdjustY( -(rPara.nLineLen) );
493 else aPol[1].AdjustY(rPara.nLineLen );
494 }
495 }
496 if (!rPara.bFixedAngle) {
497 // TODO: Implementation missing.
498 }
499 rPoly=aPol;
500}
501
503{
504 switch (rPara.eType) {
505 case SdrCaptionType::Type1: ImpCalcTail1(rPara,rPoly,rRect); break;
506 case SdrCaptionType::Type2: ImpCalcTail2(rPara,rPoly,rRect); break;
507 case SdrCaptionType::Type3: ImpCalcTail3(rPara,rPoly,rRect); break;
508 case SdrCaptionType::Type4: ImpCalcTail3(rPara,rPoly,rRect); break;
509 }
510}
511
513{
514 if (getRectangle().IsEmpty())
515 return false; // Create currently only works with the given Rect
516
517 ImpCaptParams aPara;
518 ImpGetCaptParams(aPara);
519 moveRectanglePosition(rStat.GetNow().X(), rStat.GetNow().Y());
520 aTailPoly[0]=rStat.GetStart();
523 return true;
524}
525
527{
528 ImpCaptParams aPara;
529 ImpGetCaptParams(aPara);
530 moveRectanglePosition(rStat.GetNow().X(), rStat.GetNow().Y());
534 m_bSnapRectDirty=true;
535 return true;
536}
537
539{
540 ImpCaptParams aPara;
541 ImpGetCaptParams(aPara);
542 moveRectanglePosition(rStat.GetNow().X(), rStat.GetNow().Y());
545 return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
546}
547
549{
550 return false;
551}
552
554{
555}
556
558{
562 aRetval.append(aTailPoly.getB2DPolygon());
563 return aRetval;
564}
565
567{
568 return PointerStyle::DrawCaption;
569}
570
572{
574 MovePoly(aTailPoly,rSiz);
575 if(mbFixedTail)
577}
578
579void SdrCaptionObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
580{
581 SdrRectObj::NbcResize(rRef,xFact,yFact);
582 ResizePoly(aTailPoly,rRef,xFact,yFact);
584 if(mbFixedTail)
586}
587
589{
590 Point aRelPos0(aTailPoly.GetPoint(0)-m_aAnchor);
591 Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
592 NbcMove(aSiz); // This also calls SetRectsDirty()
593}
594
596{
597 return aTailPoly.GetPoint(0)-m_aAnchor;
598}
599
601{
602 return getRectangle();
603}
604
606{
609}
610
612{
613 return aTailPoly[0];
614}
615
617{
618 if (aTailPoly.GetSize()==0 || aTailPoly[0]!=rPos) {
619 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
620 NbcSetTailPos(rPos);
621 SetChanged();
624 }
625}
626
628{
629 aTailPoly[0]=rPos;
631}
632
634{
635 // TODO: Implementation missing.
636 return 0;
637}
638
639Point SdrCaptionObj::GetSnapPoint(sal_uInt32 /*i*/) const
640{
641 // TODO: Implementation missing.
642 return Point(0,0);
643}
644
646{
647 SdrRectObj::Notify(rBC,rHint);
649}
650
651std::unique_ptr<SdrObjGeoData> SdrCaptionObj::NewGeoData() const
652{
653 return std::make_unique<SdrCaptObjGeoData>();
654}
655
657{
659 SdrCaptObjGeoData& rCGeo=static_cast<SdrCaptObjGeoData&>(rGeo);
660 rCGeo.aTailPoly=aTailPoly;
661}
662
664{
666 const SdrCaptObjGeoData& rCGeo=static_cast<const SdrCaptObjGeoData&>(rGeo);
667 aTailPoly=rCGeo.aTailPoly;
668}
669
671{
675 if (pTail && !pRect)
676 pRet = std::move(pTail);
677 else if (pRect && !pTail)
678 pRet = std::move(pRect);
679 else if (pTail && pRect)
680 {
681 if (pTail->GetSubList())
682 {
683 pTail->GetSubList()->NbcInsertObject(pRect.get());
684 pRet = std::move(pTail);
685 }
686 else if (pRect->GetSubList())
687 {
688 pRect->GetSubList()->NbcInsertObject(pTail.get(),0);
689 pRet = std::move(pRect);
690 }
691 else
692 {
694 pGrp->GetSubList()->NbcInsertObject(pRect.get());
695 pGrp->GetSubList()->NbcInsertObject(pTail.get(),0);
696 pRet = pGrp;
697 }
698 }
699 return pRet;
700}
701
702namespace {
703
704void handleNegativeScale(basegfx::B2DTuple & scale, double * rotate) {
705 assert(rotate != nullptr);
706
707 // #i75086# Old DrawingLayer (GeoStat and geometry) does not support holding negative scalings
708 // in X and Y which equal a 180 degree rotation. Recognize it and react accordingly
709 if(basegfx::fTools::less(scale.getX(), 0.0) && basegfx::fTools::less(scale.getY(), 0.0))
710 {
711 scale.setX(fabs(scale.getX()));
712 scale.setY(fabs(scale.getY()));
713 *rotate = fmod(*rotate + M_PI, 2 * M_PI);
714 }
715}
716
717}
718
719// #i32599#
720// Add own implementation for TRSetBaseGeometry to handle TailPos over changes.
722{
723 // break up matrix
724 basegfx::B2DTuple aScale;
725 basegfx::B2DTuple aTranslate;
726 double fRotate, fShearX;
727 rMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
728
729 handleNegativeScale(aScale, &fRotate);
730
731 // if anchor is used, make position relative to it
732 if(getSdrModelFromSdrObject().IsWriter())
733 {
734 if(GetAnchorPos().X() || GetAnchorPos().Y())
735 {
736 aTranslate += basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
737 }
738 }
739
740 // build BaseRect
741 Point aPoint(FRound(aTranslate.getX()), FRound(aTranslate.getY()));
742 tools::Rectangle aBaseRect(aPoint, Size(FRound(aScale.getX()), FRound(aScale.getY())));
743
744 // set BaseRect, but rescue TailPos over this call
745 const Point aTailPoint = GetTailPos();
746 SetSnapRect(aBaseRect);
747 SetTailPos(aTailPoint);
749}
750
751// geometry access
753{
754 return aTailPoly.getB2DPolygon();
755}
756
757/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools::Long nEscRel
Definition: svdocapt.cxx:66
void CalcEscPos(const Point &rTail, const tools::Rectangle &rRect, Point &rPt, EscDir &rDir) const
Definition: svdocapt.cxx:85
SdrCaptionEscDir eEscDir
Definition: svdocapt.cxx:69
bool bFitLineLen
Definition: svdocapt.cxx:70
bool bFixedAngle
Definition: svdocapt.cxx:72
tools::Long nLineLen
Definition: svdocapt.cxx:68
SdrCaptionType eType
Definition: svdocapt.cxx:64
tools::Long nGap
Definition: svdocapt.cxx:65
tools::Long nEscAbs
Definition: svdocapt.cxx:67
constexpr tools::Long Y() const
constexpr tools::Long X() const
tools::Polygon aTailPoly
Definition: svdocapt.hxx:37
class SdrCaptionGapItem Distance of the line start from the Rect
Definition: sxcgitm.hxx:30
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
Definition: svdocapt.cxx:663
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdocapt.cxx:240
virtual bool hasSpecialDrag() const override
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdocapt.cxx:286
static SVX_DLLPRIVATE void ImpCalcTail2(const ImpCaptParams &rPara, tools::Polygon &rPoly, tools::Rectangle const &rRect)
Definition: svdocapt.cxx:452
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
Definition: svdocapt.cxx:291
virtual Point GetSnapPoint(sal_uInt32 i) const override
Definition: svdocapt.cxx:639
bool mbFixedTail
Definition: svdocapt.hxx:60
virtual ~SdrCaptionObj() override
Definition: svdocapt.cxx:214
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: svdocapt.cxx:218
virtual SdrObjKind GetObjIdentifier() const override
Definition: svdocapt.cxx:235
virtual bool applySpecialDrag(SdrDragStat &rDrag) override
Definition: svdocapt.cxx:330
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const override
Definition: svdocapt.cxx:362
SdrCaptionObj(SdrModel &rSdrModel)
Definition: svdocapt.cxx:182
virtual sal_uInt32 GetSnapPointCount() const override
snap to special points of an Object (polygon points, center of circle)
Definition: svdocapt.cxx:633
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdocapt.cxx:571
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: svdocapt.cxx:168
virtual PointerStyle GetCreatePointer() const override
get the cursor/pointer that signals creating this object
Definition: svdocapt.cxx:566
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdocapt.cxx:579
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
Definition: svdocapt.cxx:645
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: svdocapt.cxx:276
SVX_DLLPRIVATE void ImpRecalcTail()
Definition: svdocapt.cxx:407
virtual std::unique_ptr< SdrObjGeoData > NewGeoData() const override
A derived class must override these 3 methods if it has own geometric data that must be saved for Und...
Definition: svdocapt.cxx:651
virtual OUString TakeObjNameSingul() const override
Definition: svdocapt.cxx:245
const Point & GetTailPos() const
Definition: svdocapt.cxx:611
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: svdocapt.cxx:656
virtual bool MovCreate(SdrDragStat &rStat) override
Definition: svdocapt.cxx:526
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: svdocapt.cxx:261
tools::Polygon aTailPoly
Definition: svdocapt.hxx:58
void SetTailPos(const Point &rPos)
Definition: svdocapt.cxx:616
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
Definition: svdocapt.cxx:538
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
Definition: svdocapt.cxx:269
virtual bool BegCreate(SdrDragStat &rStat) override
Every object must be able to create itself interactively.
Definition: svdocapt.cxx:512
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const override
Polygon dragged by the user when creating the object.
Definition: svdocapt.cxx:557
virtual bool BckCreate(SdrDragStat &rStat) override
Definition: svdocapt.cxx:548
virtual void NbcSetRelativePos(const Point &rPnt) override
The relative position of a SdrObject is the distance of the upper left corner of the logic bounding r...
Definition: svdocapt.cxx:588
static SVX_DLLPRIVATE void ImpCalcTail(const ImpCaptParams &rPara, tools::Polygon &rPoly, tools::Rectangle const &rRect)
Definition: svdocapt.cxx:502
virtual void BrkCreate(SdrDragStat &rStat) override
Definition: svdocapt.cxx:553
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: svdocapt.cxx:176
::basegfx::B2DPolygon getTailPolygon() const
Definition: svdocapt.cxx:752
void NbcSetTailPos(const Point &rPos)
Definition: svdocapt.cxx:627
static SVX_DLLPRIVATE void ImpCalcTail3(const ImpCaptParams &rPara, tools::Polygon &rPoly, tools::Rectangle const &rRect)
Definition: svdocapt.cxx:469
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const override
Definition: svdocapt.cxx:670
SVX_DLLPRIVATE void ImpGetCaptParams(ImpCaptParams &rPara) const
Definition: svdocapt.cxx:393
bool mbSpecialTextBoxShadow
Definition: svdocapt.hxx:59
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: svdocapt.cxx:605
virtual const tools::Rectangle & GetLogicRect() const override
Definition: svdocapt.cxx:600
virtual OUString TakeObjNamePlural() const override
Definition: svdocapt.cxx:256
static SVX_DLLPRIVATE void ImpCalcTail1(const ImpCaptParams &rPara, tools::Polygon &rPoly, tools::Rectangle const &rRect)
Definition: svdocapt.cxx:426
Point maFixedTailPos
Definition: svdocapt.hxx:62
virtual Point GetRelativePos() const override
Definition: svdocapt.cxx:595
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon) override
Definition: svdocapt.cxx:721
const Point & GetFixedTailPos() const
Definition: svdocapt.hxx:148
SdrObject * GetCreateObj() const
Definition: svdcrtv.hxx:120
void SetActionRect(const tools::Rectangle &rR)
Definition: svddrag.hxx:167
sal_Int32 GetPointCount() const
Definition: svddrag.hxx:101
const Point & GetStart() const
Definition: svddrag.hxx:102
SdrView * GetView() const
Definition: svddrag.hxx:96
void SetEndDragChangesGeoAndAttributes(bool bOn)
Definition: svddrag.hxx:145
const SdrHdl * GetHdl() const
Definition: svddrag.hxx:111
const Point & GetNow() const
Definition: svddrag.hxx:105
void SetNoSnap(bool bOn=true)
Definition: svddrag.hxx:131
void SetOrtho8Possible(bool bOn=true)
Definition: svddrag.hxx:139
SdrPageView * GetPageView() const
Definition: svddrag.hxx:98
void SetEndDragChangesAttributes(bool bOn)
Definition: svddrag.hxx:143
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
Definition: svdhdl.cxx:2291
sal_uInt32 GetPolyNum() const
Definition: svdhdl.hxx:219
sal_uInt32 GetPointNum() const
Definition: svdhdl.hxx:222
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:174
Provides information about various ZObject properties.
Definition: svdobj.hxx:196
const Point & GetAnchorPos() const
Definition: svdobj.cxx:1653
void ActionChanged() const
Definition: svdobj.cxx:273
bool m_bMovProt
Definition: svdobj.hxx:904
bool LineGeometryUsageIsNecessary() const
Definition: svdobj.cxx:1075
void BroadcastObjectChange() const
Definition: svdobj.cxx:1018
Point m_aAnchor
Definition: svdobj.hxx:896
bool m_bSnapRectDirty
Definition: svdobj.hxx:902
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:289
SdrObjUserCall * m_pUserCall
Definition: svdobj.hxx:897
virtual const OUString & GetName() const
Definition: svdobj.cxx:771
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
Definition: svdobj.cxx:2763
virtual void SetChanged()
Definition: svdobj.cxx:1042
virtual const tools::Rectangle & GetLastBoundRect() const
Definition: svdobj.cxx:977
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1687
OUString ImpGetDescriptionStr(TranslateId pStrCacheID) const
Definition: svdobj.cxx:1102
virtual void SetBoundRectDirty()
Definition: svdobj.cxx:329
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:509
const SfxItemSet & GetObjectItemSet() const
Definition: svdobj.cxx:1969
Rectangle objects (rectangle, circle, ...)
Definition: svdorect.hxx:39
void SetXPolyDirty()
Definition: svdorect.cxx:101
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdorect.cxx:451
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: svdorect.cxx:275
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const override
Definition: svdorect.cxx:533
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
Definition: svdorect.cxx:281
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: svdorect.cxx:252
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const override
Definition: svdorect.cxx:390
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: svdorect.cxx:286
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
Definition: svdorect.cxx:561
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
Definition: svdorect.cxx:567
virtual bool applySpecialDrag(SdrDragStat &rDrag) override
Definition: svdorect.cxx:361
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
Definition: svdorect.cxx:347
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdorect.cxx:445
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: svdotext.cxx:1499
tools::Rectangle const & getRectangle() const
Definition: svdotext.hxx:170
void moveRectangle(sal_Int32 nXDelta, sal_Int32 nYDelta)
Definition: svdotext.hxx:185
void moveRectanglePosition(sal_Int32 nX, sal_Int32 nY)
Definition: svdotext.hxx:190
rtl::Reference< SdrPathObj > ImpConvertMakeObj(const basegfx::B2DPolyPolygon &rPolyPolygon, bool bClosed, bool bBezier) const
Definition: svdotxtr.cxx:425
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
TYPE getX() const
TYPE getY() const
::basegfx::B2DPolygon getB2DPolygon() const
sal_uInt16 GetSize() const
const Point & GetPoint(sal_uInt16 nPos) const
constexpr tools::Long Top() const
constexpr tools::Long Right() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
OUString sName
tools::Long FRound(double fVal)
OUString aName
def rotate(shapename, deg)
bool less(const T &rfValA, const T &rfValB)
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
long Long
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
const char GetValue[]
#define Y
sal_Int32 scale
PointerStyle
SdrObject * SdrObjectPrimitiveHit(const SdrObject &rObject, const Point &rPnt, const basegfx::B2DVector &rHitTolerance, const SdrPageView &rSdrPageView, const SdrLayerIDSet *pVisiLayer, bool bTextOnly, drawinglayer::primitive2d::Primitive2DContainer *pHitContainer)
static SfxItemSet & rSet
constexpr TypedWhichId< SdrCaptionEscRelItem > SDRATTR_CAPTIONESCREL(SDRATTR_CAPTION_FIRST+6)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_CAPTIONGAP(SDRATTR_CAPTION_FIRST+3)
constexpr TypedWhichId< SdrCaptionEscIsRelItem > SDRATTR_CAPTIONESCISREL(SDRATTR_CAPTION_FIRST+5)
constexpr TypedWhichId< SdrCaptionTypeItem > SDRATTR_CAPTIONTYPE(SDRATTR_CAPTION_FIRST+0)
constexpr TypedWhichId< SdrCaptionEscAbsItem > SDRATTR_CAPTIONESCABS(SDRATTR_CAPTION_FIRST+7)
constexpr TypedWhichId< SdrCaptionLineLenItem > SDRATTR_CAPTIONLINELEN(SDRATTR_CAPTION_FIRST+8)
constexpr TypedWhichId< SdrCaptionFitLineLenItem > SDRATTR_CAPTIONFITLINELEN(SDRATTR_CAPTION_FIRST+9)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_CAPTIONFIXEDANGLE(SDRATTR_CAPTION_FIRST+1)
constexpr TypedWhichId< SdrCaptionEscDirItem > SDRATTR_CAPTIONESCDIR(SDRATTR_CAPTION_FIRST+4)
SdrObjKind
Definition: svdobjkind.hxx:25
@ Caption
connector object
tools::Long BigMulDiv(tools::Long nVal, tools::Long nMul, tools::Long nDiv)
Definition: svdtrans.cxx:567
void ResizePoly(tools::Polygon &rPoly, const Point &rRef, const Fraction &xFact, const Fraction &yFact)
Definition: svdtrans.cxx:65
void MovePoly(tools::Polygon &rPoly, const Size &S)
Definition: svdtrans.hxx:38
SdrCreateCmd
Definition: svdtypes.hxx:27
SdrCaptionEscDir
Definition: sxcecitm.hxx:28
SdrCaptionType
Definition: sxctitm.hxx:26