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 
37 #include <svx/sdrhittesthelper.hxx>
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 
55 namespace {
56 
57 enum EscDir {LKS,RTS,OBN,UNT};
58 
59 }
60 
62 {
63 public:
65  long nGap;
66  long nEscRel;
67  long nEscAbs;
68  long nLineLen;
71  bool bEscRel;
73 
74 public:
76  : eType(SdrCaptionType::Type3),
77  nGap(0), nEscRel(5000), nEscAbs(0),
78  nLineLen(0), eEscDir(SdrCaptionEscDir::Horizontal),
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 
85 void 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  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  }
144  bool bTakeIt=eEscDir!=SdrCaptionEscDir::BestFit;
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 
168 std::unique_ptr<sdr::properties::BaseProperties> SdrCaptionObj::CreateObjectSpecificProperties()
169 {
170  return std::make_unique<sdr::properties::CaptionProperties>(*this);
171 }
172 
173 
174 // DrawContact section
175 
176 std::unique_ptr<sdr::contact::ViewContact> SdrCaptionObj::CreateObjectSpecificViewContact()
177 {
178  return std::make_unique<sdr::contact::ViewContactOfSdrCaptionObj>(*this);
179 }
180 
181 
183 : SdrRectObj(rSdrModel, OBJ_TEXT),
184  aTailPoly(3), // default size: 3 points = 2 lines
185  mbSpecialTextBoxShadow(false),
186  mbFixedTail(false),
187  mbSuppressGetBitmap(false),
188  maFixedTailPos()
189 {
190 }
191 
193  SdrModel& rSdrModel,
194  const tools::Rectangle& rRect,
195  const Point& rTail)
196 : SdrRectObj(rSdrModel, OBJ_TEXT,rRect),
197  aTailPoly(3), // default size: 3 points = 2 lines
198  mbSpecialTextBoxShadow(false),
199  mbFixedTail(false),
200  mbSuppressGetBitmap(false),
201  maFixedTailPos()
202 {
203  aTailPoly[0]=maFixedTailPos=rTail;
204 }
205 
207 {
208 }
209 
211 {
212  rInfo.bRotateFreeAllowed=false;
213  rInfo.bRotate90Allowed =false;
214  rInfo.bMirrorFreeAllowed=false;
215  rInfo.bMirror45Allowed =false;
216  rInfo.bMirror90Allowed =false;
217  rInfo.bTransparenceAllowed = false;
218  rInfo.bShearAllowed =false;
219  rInfo.bEdgeRadiusAllowed=false;
220  rInfo.bCanConvToPath =true;
221  rInfo.bCanConvToPoly =true;
222  rInfo.bCanConvToPathLineToArea=false;
223  rInfo.bCanConvToPolyLineToArea=false;
225 }
226 
228 {
229  return sal_uInt16(OBJ_CAPTION);
230 }
231 
233 {
234  return CloneHelper< SdrCaptionObj >(rTargetModel);
235 }
236 
238 {
239  if( this == &rObj )
240  return *this;
241  SdrRectObj::operator=(rObj);
242 
243  aTailPoly = rObj.aTailPoly;
245  mbFixedTail = rObj.mbFixedTail;
247 
248  return *this;
249 }
250 
252 {
253  OUStringBuffer sName(SvxResId(STR_ObjNameSingulCAPTION));
254 
255  OUString aName(GetName());
256  if (!aName.isEmpty())
257  {
258  sName.append(' ');
259  sName.append('\'');
260  sName.append(aName);
261  sName.append('\'');
262  }
263 
264  return sName.makeStringAndClear();
265 }
266 
268 {
269  return SvxResId(STR_ObjNamePluralCAPTION);
270 }
271 
273 {
275  aPolyPoly.append(aTailPoly.getB2DPolygon());
276 
277  return aPolyPoly;
278 }
279 
280 sal_uInt32 SdrCaptionObj::GetHdlCount() const
281 {
282  sal_uInt32 nCount1(SdrRectObj::GetHdlCount());
283  // Currently only dragging the tail's end is implemented.
284  return nCount1 + 1;
285 }
286 
288 {
289  SdrRectObj::AddToHdlList(rHdlList);
290  // Currently only dragging the tail's end is implemented.
291  std::unique_ptr<SdrHdl> pHdl(new SdrHdl(aTailPoly.GetPoint(0), SdrHdlKind::Poly));
292  pHdl->SetPolyNum(1);
293  pHdl->SetPointNum(0);
294  rHdlList.AddHdl(std::move(pHdl));
295 }
296 
298 {
299  return true;
300 }
301 
303 {
304  const SdrHdl* pHdl = rDrag.GetHdl();
305  rDrag.SetEndDragChangesAttributes(true);
307 
308  if(pHdl && 0 == pHdl->GetPolyNum())
309  {
310  return SdrRectObj::beginSpecialDrag(rDrag);
311  }
312  else
313  {
314  rDrag.SetOrtho8Possible();
315 
316  if(!pHdl)
317  {
318  if (bMovProt)
319  return false;
320 
321  rDrag.SetNoSnap();
322  rDrag.SetActionRect(maRect);
323 
324  Point aHit(rDrag.GetStart());
325 
326  if(rDrag.GetPageView() && SdrObjectPrimitiveHit(*this, aHit, 0, *rDrag.GetPageView(), nullptr, false))
327  {
328  return true;
329  }
330  }
331  else
332  {
333  if((1 == pHdl->GetPolyNum()) && (0 == pHdl->GetPointNum()))
334  return true;
335  }
336  }
337 
338  return false;
339 }
340 
342 {
343  const SdrHdl* pHdl = rDrag.GetHdl();
344 
345  if(pHdl && 0 == pHdl->GetPolyNum())
346  {
347  const bool bRet(SdrRectObj::applySpecialDrag(rDrag));
348  ImpRecalcTail();
349  ActionChanged();
350 
351  return bRet;
352  }
353  else
354  {
355  Point aDelt(rDrag.GetNow()-rDrag.GetStart());
356 
357  if(!pHdl)
358  {
359  maRect.Move(aDelt.X(),aDelt.Y());
360  }
361  else
362  {
363  aTailPoly[0] += aDelt;
364  }
365 
366  ImpRecalcTail();
367  ActionChanged();
368 
369  return true;
370  }
371 }
372 
374 {
375  const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj());
376 
377  if(bCreateComment)
378  {
379  return OUString();
380  }
381  else
382  {
383  const SdrHdl* pHdl = rDrag.GetHdl();
384 
385  if(pHdl && 0 == pHdl->GetPolyNum())
386  {
387  return SdrRectObj::getSpecialDragComment(rDrag);
388  }
389  else
390  {
391  if(!pHdl)
392  {
393  return ImpGetDescriptionStr(STR_DragCaptFram);
394  }
395  else
396  {
397  return ImpGetDescriptionStr(STR_DragCaptTail);
398  }
399  }
400  }
401 }
402 
403 
405 {
406  const SfxItemSet& rSet = GetObjectItemSet();
407  rPara.eType =rSet.Get(SDRATTR_CAPTIONTYPE ).GetValue();
408  rPara.bFixedAngle=rSet.Get(SDRATTR_CAPTIONFIXEDANGLE).GetValue();
409  rPara.nGap =static_cast<const SdrCaptionGapItem&> (rSet.Get(SDRATTR_CAPTIONGAP )).GetValue();
410  rPara.eEscDir =rSet.Get(SDRATTR_CAPTIONESCDIR ).GetValue();
411  rPara.bEscRel =rSet.Get(SDRATTR_CAPTIONESCISREL ).GetValue();
412  rPara.nEscRel =rSet.Get(SDRATTR_CAPTIONESCREL ).GetValue();
413  rPara.nEscAbs =rSet.Get(SDRATTR_CAPTIONESCABS ).GetValue();
414  rPara.nLineLen =rSet.Get(SDRATTR_CAPTIONLINELEN ).GetValue();
415  rPara.bFitLineLen=rSet.Get(SDRATTR_CAPTIONFITLINELEN).GetValue();
416 }
417 
419 {
420  ImpCaptParams aPara;
421  ImpGetCaptParams(aPara);
422  ImpCalcTail(aPara, aTailPoly, maRect);
423  SetRectsDirty();
424  SetXPolyDirty();
425 }
426 
427 // #i35971#
428 // SdrCaptionObj::ImpCalcTail1 does move the object(!). What a hack.
429 // I really wonder why this had not triggered problems before. I am
430 // sure there are some places where SetTailPos() is called at least
431 // twice or SetSnapRect after it again just to work around this.
432 // Changed this method to not do that.
433 // Also found why this has been done: For interactive dragging of the
434 // tail end pos for SdrCaptionType::Type1. This sure was the simplest method
435 // to achieve this, at the cost of making a whole group of const methods
436 // of this object implicitly change the object's position.
438 {
439  tools::Polygon aPol(2);
440  Point aTl(rPoly[0]);
441 
442  aPol[0] = aTl;
443  aPol[1] = aTl;
444 
445  EscDir eEscDir;
446  Point aEscPos;
447 
448  rPara.CalcEscPos(aTl, rRect, aEscPos, eEscDir);
449  aPol[1] = aEscPos;
450 
451  if(eEscDir==LKS || eEscDir==RTS)
452  {
453  aPol[0].setX( aEscPos.X() );
454  }
455  else
456  {
457  aPol[0].setY( aEscPos.Y() );
458  }
459 
460  rPoly = aPol;
461 }
462 
464 { // Gap/EscDir/EscPos/Angle
465  tools::Polygon aPol(2);
466  Point aTl(rPoly[0]);
467  aPol[0]=aTl;
468 
469  EscDir eEscDir;
470  Point aEscPos;
471  rPara.CalcEscPos(aTl,rRect,aEscPos,eEscDir);
472  aPol[1]=aEscPos;
473 
474  if (!rPara.bFixedAngle) {
475  // TODO: Implementation missing.
476  }
477  rPoly=aPol;
478 }
479 
481 { // Gap/EscDir/EscPos/Angle/LineLen
482  tools::Polygon aPol(3);
483  Point aTl(rPoly[0]);
484  aPol[0]=aTl;
485 
486  EscDir eEscDir;
487  Point aEscPos;
488  rPara.CalcEscPos(aTl,rRect,aEscPos,eEscDir);
489  aPol[1]=aEscPos;
490  aPol[2]=aEscPos;
491 
492  if (eEscDir==LKS || eEscDir==RTS) {
493  if (rPara.bFitLineLen) {
494  aPol[1].setX((aTl.X()+aEscPos.X())/2 );
495  } else {
496  if (eEscDir==LKS) aPol[1].AdjustX( -(rPara.nLineLen) );
497  else aPol[1].AdjustX(rPara.nLineLen );
498  }
499  } else {
500  if (rPara.bFitLineLen) {
501  aPol[1].setY((aTl.Y()+aEscPos.Y())/2 );
502  } else {
503  if (eEscDir==OBN) aPol[1].AdjustY( -(rPara.nLineLen) );
504  else aPol[1].AdjustY(rPara.nLineLen );
505  }
506  }
507  if (!rPara.bFixedAngle) {
508  // TODO: Implementation missing.
509  }
510  rPoly=aPol;
511 }
512 
514 {
515  switch (rPara.eType) {
516  case SdrCaptionType::Type1: ImpCalcTail1(rPara,rPoly,rRect); break;
517  case SdrCaptionType::Type2: ImpCalcTail2(rPara,rPoly,rRect); break;
518  case SdrCaptionType::Type3: ImpCalcTail3(rPara,rPoly,rRect); break;
519  case SdrCaptionType::Type4: ImpCalcTail3(rPara,rPoly,rRect); break;
520  }
521 }
522 
524 {
525  if (maRect.IsEmpty()) return false; // Create currently only works with the given Rect
526 
527  ImpCaptParams aPara;
528  ImpGetCaptParams(aPara);
529  maRect.SetPos(rStat.GetNow());
530  aTailPoly[0]=rStat.GetStart();
532  rStat.SetActionRect(maRect);
533  return true;
534 }
535 
537 {
538  ImpCaptParams aPara;
539  ImpGetCaptParams(aPara);
540  maRect.SetPos(rStat.GetNow());
542  rStat.SetActionRect(maRect);
544  bSnapRectDirty=true;
545  return true;
546 }
547 
549 {
550  ImpCaptParams aPara;
551  ImpGetCaptParams(aPara);
552  maRect.SetPos(rStat.GetNow());
554  SetRectsDirty();
555  return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
556 }
557 
559 {
560  return false;
561 }
562 
564 {
565 }
566 
568 {
569  basegfx::B2DPolyPolygon aRetval;
572  aRetval.append(aTailPoly.getB2DPolygon());
573  return aRetval;
574 }
575 
577 {
578  return PointerStyle::DrawCaption;
579 }
580 
581 void SdrCaptionObj::NbcMove(const Size& rSiz)
582 {
583  SdrRectObj::NbcMove(rSiz);
584  MovePoly(aTailPoly,rSiz);
585  if(mbFixedTail)
587 }
588 
589 void SdrCaptionObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
590 {
591  SdrRectObj::NbcResize(rRef,xFact,yFact);
592  ResizePoly(aTailPoly,rRef,xFact,yFact);
593  ImpRecalcTail();
594  if(mbFixedTail)
596 }
597 
598 void SdrCaptionObj::NbcSetRelativePos(const Point& rPnt)
599 {
600  Point aRelPos0(aTailPoly.GetPoint(0)-aAnchor);
601  Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
602  NbcMove(aSiz); // This also calls SetRectsDirty()
603 }
604 
606 {
607  return aTailPoly.GetPoint(0)-aAnchor;
608 }
609 
611 {
612  return maRect;
613 }
614 
616 {
618  ImpRecalcTail();
619 }
620 
622 {
623  return aTailPoly[0];
624 }
625 
626 void SdrCaptionObj::SetTailPos(const Point& rPos)
627 {
628  if (aTailPoly.GetSize()==0 || aTailPoly[0]!=rPos) {
629  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
630  NbcSetTailPos(rPos);
631  SetChanged();
634  }
635 }
636 
637 void SdrCaptionObj::NbcSetTailPos(const Point& rPos)
638 {
639  aTailPoly[0]=rPos;
640  ImpRecalcTail();
641 }
642 
644 {
645  // TODO: Implementation missing.
646  return 0;
647 }
648 
649 Point SdrCaptionObj::GetSnapPoint(sal_uInt32 /*i*/) const
650 {
651  // TODO: Implementation missing.
652  return Point(0,0);
653 }
654 
656 {
657  SdrRectObj::Notify(rBC,rHint);
658  ImpRecalcTail();
659 }
660 
662 {
663  return new SdrCaptObjGeoData;
664 }
665 
667 {
669  SdrCaptObjGeoData& rCGeo=static_cast<SdrCaptObjGeoData&>(rGeo);
670  rCGeo.aTailPoly=aTailPoly;
671 }
672 
674 {
676  const SdrCaptObjGeoData& rCGeo=static_cast<const SdrCaptObjGeoData&>(rGeo);
677  aTailPoly=rCGeo.aTailPoly;
678 }
679 
680 SdrObjectUniquePtr SdrCaptionObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
681 {
682  SdrObjectUniquePtr pRect = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText);
684  SdrObjectUniquePtr pRet;
685  if (pTail && !pRect)
686  pRet = std::move(pTail);
687  else if (pRect && !pTail)
688  pRet = std::move(pRect);
689  else if (pTail && pRect)
690  {
691  if (pTail->GetSubList())
692  {
693  pTail->GetSubList()->NbcInsertObject(pRect.release());
694  pRet = std::move(pTail);
695  }
696  else if (pRect->GetSubList())
697  {
698  pRect->GetSubList()->NbcInsertObject(pTail.release(),0);
699  pRet = std::move(pRect);
700  }
701  else
702  {
704  pGrp->GetSubList()->NbcInsertObject(pRect.release());
705  pGrp->GetSubList()->NbcInsertObject(pTail.release(),0);
706  pRet.reset(pGrp);
707  }
708  }
709  return pRet;
710 }
711 
712 namespace {
713 
714 void handleNegativeScale(basegfx::B2DTuple & scale, double * rotate) {
715  assert(rotate != nullptr);
716 
717  // #i75086# Old DrawingLayer (GeoStat and geometry) does not support holding negative scalings
718  // in X and Y which equal a 180 degree rotation. Recognize it and react accordingly
719  if(basegfx::fTools::less(scale.getX(), 0.0) && basegfx::fTools::less(scale.getY(), 0.0))
720  {
721  scale.setX(fabs(scale.getX()));
722  scale.setY(fabs(scale.getY()));
723  *rotate = fmod(*rotate + F_PI, F_2PI);
724  }
725 }
726 
727 }
728 
729 // #i32599#
730 // Add own implementation for TRSetBaseGeometry to handle TailPos over changes.
732 {
733  // break up matrix
734  basegfx::B2DTuple aScale;
735  basegfx::B2DTuple aTranslate;
736  double fRotate, fShearX;
737  rMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
738 
739  handleNegativeScale(aScale, &fRotate);
740 
741  // if anchor is used, make position relative to it
742  if(getSdrModelFromSdrObject().IsWriter())
743  {
744  if(GetAnchorPos().X() || GetAnchorPos().Y())
745  {
746  aTranslate += basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
747  }
748  }
749 
750  // build BaseRect
751  Point aPoint(FRound(aTranslate.getX()), FRound(aTranslate.getY()));
752  tools::Rectangle aBaseRect(aPoint, Size(FRound(aScale.getX()), FRound(aScale.getY())));
753 
754  // set BaseRect, but rescue TailPos over this call
755  const Point aTailPoint = GetTailPos();
756  SetSnapRect(aBaseRect);
757  SetTailPos(aTailPoint);
758  ImpRecalcTail();
759 }
760 
761 // geometry access
763 {
764  return aTailPoly.getB2DPolygon();
765 }
766 
767 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdorect.cxx:460
virtual bool applySpecialDrag(SdrDragStat &rDrag) override
Definition: svdorect.cxx:374
void SetPos(const Point &rPoint)
SdrCaptionType eType
Definition: svdocapt.cxx:64
void setX(double fX)
virtual void RestGeoData(const SdrObjGeoData &rGeo) override
Definition: svdocapt.cxx:673
SdrPageView * GetPageView() const
Definition: svddrag.hxx:88
sal_uInt32 GetPolyNum() const
Definition: svdhdl.hxx:219
virtual ~SdrCaptionObj() override
Definition: svdocapt.cxx:206
long FRound(double fVal)
#define SDRATTR_CAPTIONFIXEDANGLE
Definition: svddef.hxx:187
SdrObjUserCall * pUserCall
Definition: svdobj.hxx:923
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const override
Definition: svdorect.cxx:403
std::string GetValue
const Point & GetStart() const
Definition: svddrag.hxx:92
SVX_DLLPRIVATE void ImpGetCaptParams(ImpCaptParams &rPara) const
Definition: svdocapt.cxx:404
void ResizePoly(tools::Polygon &rPoly, const Point &rRef, const Fraction &xFact, const Fraction &yFact)
Definition: svdtrans.cxx:63
bool mbSpecialTextBoxShadow
Definition: svdocapt.hxx:60
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: svdocapt.cxx:168
periodic cubic Spline (ni)
Definition: svdobj.hxx:133
Point maFixedTailPos
Definition: svdocapt.hxx:63
SdrCaptionObj(SdrModel &rSdrModel)
Definition: svdocapt.cxx:182
void SetTailPos(const Point &rPos)
Definition: svdocapt.cxx:626
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: svdocapt.cxx:666
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:300
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon) override
Definition: svdocapt.cxx:731
double getX() const
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
Definition: svdocapt.cxx:655
virtual const tools::Rectangle & GetLogicRect() const override
Definition: svdocapt.cxx:610
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
Definition: svdocapt.cxx:302
virtual Point GetRelativePos() const override
Definition: svdocapt.cxx:605
bool mbFixedTail
Definition: svdocapt.hxx:61
sal_uInt32 GetPointNum() const
Definition: svdhdl.hxx:222
virtual void SetBoundRectDirty()
Definition: svdobj.cxx:309
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
Definition: svdocapt.cxx:548
double getY() const
::basegfx::B2DPolygon getTailPolygon() const
Definition: svdocapt.cxx:762
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: svdocapt.cxx:287
virtual bool BckCreate(SdrDragStat &rStat) override
Definition: svdocapt.cxx:558
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: svdorect.cxx:265
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const override
Polygon dragged by the user when creating the object.
Definition: svdocapt.cxx:567
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:226
SdrCaptionEscDir
Definition: sxcecitm.hxx:28
virtual Point GetSnapPoint(sal_uInt32 i) const override
Definition: svdocapt.cxx:649
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:598
void SetOrtho8Possible(bool bOn=true)
Definition: svddrag.hxx:129
bool bFitLineLen
Definition: svdocapt.cxx:70
void Move(long nHorzMoveDelta, long nVertMoveDelta)
bool bSnapRectDirty
Definition: svdobj.hxx:928
Rectangle objects (rectangle, circle, ...)
Definition: svdorect.hxx:39
bool IsEmpty() const
Provides information about various ZObject properties.
Definition: svdobj.hxx:248
const SdrHdl * GetHdl() const
Definition: svddrag.hxx:101
static SVX_DLLPRIVATE void ImpCalcTail1(const ImpCaptParams &rPara, tools::Polygon &rPoly, tools::Rectangle const &rRect)
Definition: svdocapt.cxx:437
long Right() const
#define SDRATTR_CAPTIONESCABS
Definition: svddef.hxx:193
connector object
Definition: svdobj.hxx:139
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override
Definition: svdocapt.cxx:680
void CalcEscPos(const Point &rTail, const tools::Rectangle &rRect, Point &rPt, EscDir &rDir) const
Definition: svdocapt.cxx:85
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
Definition: svdorect.cxx:360
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:28
SdrCaptionObj & operator=(const SdrCaptionObj &rObj)
Definition: svdocapt.cxx:237
#define X
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: svdotext.cxx:1432
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override
Definition: svdorect.cxx:542
#define SDRATTR_CAPTIONESCISREL
Definition: svddef.hxx:191
const SfxItemSet & GetObjectItemSet() const
Definition: svdobj.cxx:1878
SdrObject * SdrObjectPrimitiveHit(const SdrObject &rObject, const Point &rPnt, sal_uInt16 nTol, const SdrPageView &rSdrPageView, const SdrLayerIDSet *pVisiLayer, bool bTextOnly, drawinglayer::primitive2d::Primitive2DContainer *pHitContainer)
tools::Rectangle maRect
Definition: svdotext.hxx:182
SdrCaptionType
Definition: sxctitm.hxx:26
virtual 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:661
long Top() const
static SVX_DLLPRIVATE void ImpCalcTail(const ImpCaptParams &rPara, tools::Polygon &rPoly, tools::Rectangle const &rRect)
Definition: svdocapt.cxx:513
#define SDRATTR_CAPTIONTYPE
Definition: svddef.hxx:186
#define SDRATTR_CAPTIONGAP
Definition: svddef.hxx:189
static SVX_DLLPRIVATE void ImpCalcTail3(const ImpCaptParams &rPara, tools::Polygon &rPoly, tools::Rectangle const &rRect)
Definition: svdocapt.cxx:480
virtual sal_uInt16 GetObjIdentifier() const override
Definition: svdocapt.cxx:227
tools::Polygon aTailPoly
Definition: svdocapt.hxx:38
#define SDRATTR_CAPTIONLINELEN
Definition: svddef.hxx:194
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const override
Definition: svdocapt.cxx:373
static bool less(const double &rfValA, const double &rfValB)
void SetNoSnap(bool bOn=true)
Definition: svddrag.hxx:121
void SetEndDragChangesGeoAndAttributes(bool bOn)
Definition: svddrag.hxx:135
SVX_DLLPRIVATE void ImpRecalcTail()
Definition: svdocapt.cxx:418
OUString sName
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
SdrObject * GetCreateObj() const
Definition: svdcrtv.hxx:119
virtual bool applySpecialDrag(SdrDragStat &rDrag) override
Definition: svdocapt.cxx:341
class SdrCaptionGapItem Distance of the line start from the Rect
Definition: sxcgitm.hxx:29
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
Definition: svdorect.cxx:294
SdrPathObjUniquePtr ImpConvertMakeObj(const basegfx::B2DPolyPolygon &rPolyPolygon, bool bClosed, bool bBezier) const
Definition: svdotxtr.cxx:429
virtual SdrCaptionObj * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdocapt.cxx:232
#define SDRATTR_CAPTIONESCDIR
Definition: svddef.hxx:190
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
Definition: svdocapt.cxx:280
void BroadcastObjectChange() const
Definition: svdobj.cxx:904
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
sal_Int32 GetPointCount() const
Definition: svddrag.hxx:91
void ActionChanged() const
Definition: svdobj.cxx:256
SdrView * GetView() const
Definition: svddrag.hxx:86
void SetXPolyDirty()
Definition: svdorect.cxx:93
long Bottom() const
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:272
sal_uInt16 GetSize() const
virtual SdrObjList * GetSubList() const override
Definition: svdogrp.cxx:169
void SetEndDragChangesAttributes(bool bOn)
Definition: svddrag.hxx:133
::basegfx::B2DPolygon getB2DPolygon() const
#define SDRATTR_CAPTIONFITLINELEN
Definition: svddef.hxx:195
OUString GetName() const
Definition: svdobj.cxx:697
Point aAnchor
Definition: svdobj.hxx:922
#define Y
long BigMulDiv(long nVal, long nMul, long nDiv)
Definition: svdtrans.cxx:558
tools::Polygon aTailPoly
Definition: svdocapt.hxx:59
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
virtual OUString TakeObjNamePlural() const override
Definition: svdocapt.cxx:267
const Point & GetPoint(sal_uInt16 nPos) const
void MovePoly(tools::Polygon &rPoly, const Size &S)
Definition: svdtrans.hxx:51
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: svdorect.cxx:288
virtual const tools::Rectangle & GetLastBoundRect() const
Definition: svdobj.cxx:867
virtual bool MovCreate(SdrDragStat &rStat) override
Definition: svdocapt.cxx:536
SdrRectObj & operator=(const SdrRectObj &rCopy)
Definition: svdorect.cxx:250
void SetActionRect(const tools::Rectangle &rR)
Definition: svddrag.hxx:157
virtual PointerStyle GetCreatePointer() const override
get the cursor/pointer that signals creating this object
Definition: svdocapt.cxx:576
virtual OUString TakeObjNameSingul() const override
Definition: svdocapt.cxx:251
void setY(double fY)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: svdocapt.cxx:176
#define SDRATTR_CAPTIONESCREL
Definition: svddef.hxx:192
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdorect.cxx:466
OUString ImpGetDescriptionStr(const char *pStrCacheID) const
Definition: svdobj.cxx:1037
OUString aName
bool bMovProt
Definition: svdobj.hxx:930
virtual void BrkCreate(SdrDragStat &rStat) override
Definition: svdocapt.cxx:563
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdocapt.cxx:581
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
Definition: svdobj.hxx:114
const Point & GetNow() const
Definition: svddrag.hxx:95
long Left() const
PointerStyle
const Point & GetAnchorPos() const
Definition: svdobj.cxx:1587
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: svdocapt.cxx:210
virtual void RestGeoData(const SdrObjGeoData &rGeo) override
Definition: svdorect.cxx:576
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:434
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: svdorect.cxx:299
virtual bool hasSpecialDrag() const override
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdocapt.cxx:297
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1621
EscDir
Definition: svdocapt.cxx:57
bool LineGeometryUsageIsNecessary() const
Definition: svdobj.cxx:961
void NbcSetTailPos(const Point &rPos)
Definition: svdocapt.cxx:637
SdrCreateCmd
Definition: svdtypes.hxx:27
virtual void SetChanged()
Definition: svdobj.cxx:928
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdocapt.cxx:589
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: svdocapt.cxx:272
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: svdocapt.cxx:615
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
Definition: svdobj.cxx:2648
SdrCaptionEscDir eEscDir
Definition: svdocapt.cxx:69
static SVX_DLLPRIVATE void ImpCalcTail2(const ImpCaptParams &rPara, tools::Polygon &rPoly, tools::Rectangle const &rRect)
Definition: svdocapt.cxx:463
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
Definition: svdhdl.cxx:2294
const Point & GetFixedTailPos() const
Definition: svdocapt.hxx:150
const Point & GetTailPos() const
Definition: svdocapt.cxx:621
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
Definition: svdorect.cxx:570
virtual sal_uInt32 GetSnapPointCount() const override
snap to special points of an Object (polygon points, center of circle)
Definition: svdocapt.cxx:643
virtual bool BegCreate(SdrDragStat &rStat) override
Every object must be able to create itself interactively.
Definition: svdocapt.cxx:523
bool bFixedAngle
Definition: svdocapt.cxx:72