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