1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <svx/itextprovider.hxx>
23 #include <svx/svdoattr.hxx>
24 #include <svx/sdtaitm.hxx>
25 #include <svx/sdtakitm.hxx>
26 #include <svx/sdtaditm.hxx>
27 #include <svx/svdtrans.hxx>
28 #include <svx/svdgeodata.hxx>
29 #include <tools/datetime.hxx>
30 #include <svl/style.hxx>
31 #include <svx/svdtext.hxx>
32 #include <svx/svxdllapi.h>
33 #include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
37 #include <com/sun/star/drawing/TextFitToSizeType.hpp>
39 // forward declarations
41 class OutlinerParaObject
;
42 class OverflowingText
;
48 class ImpSdrObjTextLink
;
53 enum class EEAnchorMode
;
54 enum class EETextFormat
;
56 namespace sdr::properties
{
60 namespace drawinglayer::primitive2d
{
61 class SdrContourTextPrimitive2D
;
62 class SdrPathTextPrimitive2D
;
63 class SdrBlockTextPrimitive2D
;
64 class SdrAutoFitTextPrimitive2D
;
65 class SdrStretchTextPrimitive2D
;
66 class SdrChainedTextPrimitive2D
;
69 namespace drawinglayer::animation
{
70 class AnimationEntryList
;
73 namespace drawinglayer::geometry
{
74 class ViewInformation2D
;
77 namespace sdr::table
{
79 class SdrTableRtfExporter
;
80 class SdrTableRTFParser
;
85 constexpr const sal_uInt16 SDRUSERDATA_OBJTEXTLINK
= 1;
88 // helper class SdrTextObjGeoData
89 class SdrTextObjGeoData
: public SdrObjGeoData
92 tools::Rectangle maRect
;
97 // helper class ImpSdrObjTextLinkUserData
98 class ImpSdrObjTextLinkUserData final
: public SdrObjUserData
100 friend class SdrTextObj
;
101 friend class ImpSdrObjTextLink
;
103 OUString maFileName
; // name of the referenced document
104 OUString maFilterName
; // a filter, if need be
105 DateTime maFileDate0
; // avoiding unnecessary reload
106 tools::SvRef
<ImpSdrObjTextLink
> mpLink
;
107 rtl_TextEncoding meCharSet
;
110 ImpSdrObjTextLinkUserData();
111 virtual ~ImpSdrObjTextLinkUserData() override
;
113 virtual std::unique_ptr
<SdrObjUserData
> Clone(SdrObject
* pObj1
) const override
;
116 namespace sdr::properties
118 class CustomShapeProperties
;
119 class CellProperties
;
124 class SVXCORE_DLLPUBLIC SdrTextObj
: public SdrAttrObj
, public svx::ITextProvider
127 // Cell needs access to ImpGetDrawOutliner();
128 friend class sdr::table::Cell
;
129 friend class sdr::table::SdrTableRtfExporter
;
130 friend class sdr::table::SdrTableRTFParser
;
131 friend class TextChain
;
132 friend class TextChainFlow
;
133 friend class EditingTextChainFlow
;
135 // CustomShapeproperties need to access the "mbTextFrame" member:
136 friend class sdr::properties::CustomShapeProperties
;
139 virtual std::unique_ptr
<sdr::properties::BaseProperties
> CreateObjectSpecificProperties() override
;
140 virtual std::unique_ptr
<sdr::contact::ViewContact
> CreateObjectSpecificViewContact() override
;
143 // This method is only allowed for sdr::properties::TextProperties
144 SVX_DLLPRIVATE SdrOutliner
* GetTextEditOutliner() const
146 return mpEditingOutliner
;
149 // to allow sdr::properties::TextProperties access to SetPortionInfoChecked()
150 // and GetTextEditOutliner()
151 friend class sdr::properties::TextProperties
;
152 friend class sdr::properties::CellProperties
;
154 friend class ImpSdrObjTextLink
;
155 friend class ImpSdrObjTextLinkUserData
;
156 friend class SdrPowerPointImport
; // for PowerPointImport
157 friend class SdrExchangeView
; // for ImpGetDrawOutliner
158 friend class SdrView
; // for ImpGetDrawOutliner
159 friend class SdrObjEditView
; // for TextEdit
160 friend class SdrMeasureObj
; // for ImpGetDrawOutliner
161 friend class SvxMSDffManager
; // for ImpGetDrawOutliner
162 friend class SdrObjCustomShape
; // for ImpGetDrawOutliner
163 friend class SdrText
; // for ImpGetDrawOutliner
166 // The "aRect" is also the rect of RectObj and CircObj.
167 // When mbTextFrame=true the text will be formatted into this rect
168 // When mbTextFrame=false the text will be centered around its middle
169 tools::Rectangle maRectangle
;
171 tools::Rectangle
const& getRectangle() const
176 void setRectangle(tools::Rectangle
const& rRectangle
)
178 maRectangle
= rRectangle
;
181 void setRectangleSize(sal_Int32 nWidth
, sal_Int32 nHeight
)
183 maRectangle
.SetSize(Size(nWidth
, nHeight
));
186 void moveRectangle(sal_Int32 nXDelta
, sal_Int32 nYDelta
)
188 maRectangle
.Move(nXDelta
, nYDelta
);
191 void moveRectanglePosition(sal_Int32 nX
, sal_Int32 nY
)
193 maRectangle
.SetPos(Point(nX
, nY
));
196 // The GeoStat contains the rotation and shear angles
199 // this is the active text
200 rtl::Reference
<SdrText
> mxText
;
202 // This contains the dimensions of the text
205 // an Outliner*, so that
206 // 1. the TextObj won't be edited simultaneously by multiple views, and
207 // 2. when streaming while editing Flush() can be done
208 SdrOutliner
* mpEditingOutliner
;
210 // Possible values for eTextKind are:
211 // SdrObjKind::Text regular text frame
212 // SdrObjKind::TitleText TitleText for presentations
213 // SdrObjKind::OutlineText OutlineText for presentations
214 // eTextKind only has meaning when mbTextFrame=true, since otherwise
215 // we're dealing with a labeled graphical object
216 SdrObjKind meTextKind
;
218 // For text editing in SW Header/Footer it is necessary to be
219 // able to set an offset for the text edit to allow text editing at the
220 // position of the virtual object. This offset is used when setting up
221 // and maintaining the OutlinerView.
222 Point maTextEditOffset
;
224 virtual rtl::Reference
<SdrObject
> getFullDragClone() const override
;
228 const Point
& GetTextEditOffset() const { return maTextEditOffset
; }
229 void SetTextEditOffset(const Point
& rNew
) { maTextEditOffset
= rNew
; }
232 bool mbIsUnchainableClone
= false;
234 // the successor in a chain
235 SdrTextObj
* mpNextInChain
= nullptr;
236 SdrTextObj
* mpPrevInChain
= nullptr;
238 // For labeled graphical objects bTextFrame is FALSE. The block of text
239 // will then be centered horizontally and vertically on aRect.
240 // For mbTextFrame=true the text will be formatted into aRect.
241 // The actual text frame is realized by an SdrRectObj with
243 bool mbTextFrame
: 1;
244 bool mbNoShear
: 1; // disable shearing (->graphic+Ole+TextFrame)
245 bool mbTextSizeDirty
: 1;
247 bool mbInEditMode
: 1; // Is this text object in edit mode?
249 // For objects with free size (flow text). The flag is set by the
250 // application on create. If the object width is later resized,
251 // AutoGrowWidth will be disabled (set to sal_False). This flag will
252 // then also be set to sal_False, so that the object behaves like a
253 // normal text object.
254 // Width resize can result from:
255 // - Interactive Resize in single or multiple selections
256 // - position/size dialog
257 bool mbDisableAutoWidthOnDragging
: 1;
259 // Flag for allowing text animation. Default is sal_true.
260 bool mbTextAnimationAllowed
: 1;
262 // flag for preventing recursive onEditOutlinerStatusEvent calls
263 bool mbInDownScale
: 1;
265 SdrOutliner
& ImpGetDrawOutliner() const;
268 // #101029#: Extracted from ImpGetDrawOutliner()
269 SVX_DLLPRIVATE
void ImpInitDrawOutliner( SdrOutliner
& rOutl
) const;
270 // #101029#: Extracted from Paint()
271 SVX_DLLPRIVATE
void ImpSetupDrawOutlinerForPaint( bool bContourFrame
,
272 SdrOutliner
& rOutliner
,
273 tools::Rectangle
& rTextRect
,
274 tools::Rectangle
& rAnchorRect
,
275 tools::Rectangle
& rPaintRect
,
276 Fraction
& aFitXCorrection
) const;
277 void ImpAutoFitText( SdrOutliner
& rOutliner
) const;
278 void ImpAutoFitText( SdrOutliner
& rOutliner
, const Size
& rShapeSize
, bool bIsVerticalWriting
) const;
279 void autoFitTextForCompatibility(SdrOutliner
& rOutliner
, const Size
& rShapeSize
, bool bIsVerticalWriting
) const;
281 SVX_DLLPRIVATE
rtl::Reference
<SdrObject
> ImpConvertContainedTextToSdrPathObjs(bool bToPoly
) const;
282 SVX_DLLPRIVATE
void ImpRegisterLink();
283 SVX_DLLPRIVATE
void ImpDeregisterLink();
284 SVX_DLLPRIVATE ImpSdrObjTextLinkUserData
* GetLinkUserData() const;
286 /** Appends the style family to a provided style name */
287 static void AppendFamilyToStyleName(OUString
& styleName
, SfxStyleFamily family
);
289 /** Reads the style family from a style name to which the family has been appended. */
290 static SfxStyleFamily
ReadFamilyFromStyleName(std::u16string_view styleName
);
293 bool ImpCanConvTextToCurve() const;
294 rtl::Reference
<SdrPathObj
> ImpConvertMakeObj(const basegfx::B2DPolyPolygon
& rPolyPolygon
, bool bClosed
, bool bBezier
) const;
295 rtl::Reference
<SdrObject
> ImpConvertAddText(rtl::Reference
<SdrObject
> pObj
, bool bBezier
) const;
296 void ImpSetTextStyleSheetListeners();
297 static void ImpSetCharStretching(SdrOutliner
& rOutliner
, const Size
& rTextSize
, const Size
& rShapeSize
, Fraction
& rFitXCorrection
);
298 static void ImpJustifyRect(tools::Rectangle
& rRect
);
299 void ImpCheckShear();
300 tools::Rectangle
ImpDragCalcRect(const SdrDragStat
& rDrag
) const;
301 void ImpSetTextEditParams() const;
302 void SetTextSizeDirty() { mbTextSizeDirty
= true; }
304 // rAnchorRect is InOut-Parameter!
305 void ImpSetContourPolygon( SdrOutliner
& rOutliner
, tools::Rectangle
const & rAnchorRect
, bool bLineWidth
) const;
307 virtual std::unique_ptr
<SdrObjGeoData
> NewGeoData() const override
;
308 virtual void SaveGeoData(SdrObjGeoData
& rGeo
) const override
;
309 virtual void RestoreGeoData(const SdrObjGeoData
& rGeo
) override
;
310 void NbcSetEckenradius(tools::Long nRad
);
312 // #115391# new method for SdrObjCustomShape and SdrTextObj to correctly handle and set
313 // SdrTextMinFrameWidthItem and SdrTextMinFrameHeightItem based on all settings, necessities
315 virtual void AdaptTextMinSize();
317 // constructors for labeled graphical objects
318 SdrTextObj(SdrModel
& rSdrModel
);
321 const tools::Rectangle
& rNewRect
);
323 // constructors for text frames
326 SdrObjKind eNewTextKind
);
329 SdrObjKind eNewTextKind
,
330 const tools::Rectangle
& rNewRect
);
333 SdrTextObj(SdrModel
& rSdrModel
, SdrTextObj
const & rSource
);
335 // protected destructor
336 virtual ~SdrTextObj() override
;
340 bool IsInEditMode() const { return mbInEditMode
; }
342 // Currently ASCII and RTF are supported and the differentiation is done
344 // rFilterName has no meaning and must be empty
345 // Normally the application only has to call SetTextLink() - the
346 // remainder is automatic (SfxLinkManager).
347 // The LoadText() method can also be used to load a file into a text
348 // object (without linking.)
349 // TextLinks can't be edited (if needed later could be ReadOnly).
350 // Setting attributes can only be done on the text frame.
351 void SetTextLink(const OUString
& rFileName
, const OUString
& rFilterName
);
352 void ReleaseTextLink();
353 bool IsLinkedText() const { return m_pPlusData
!= nullptr && GetLinkUserData() != nullptr; }
354 bool ReloadLinkedText(bool bForceLoad
);
355 bool LoadText(const OUString
& rFileName
, rtl_TextEncoding eCharSet
);
357 virtual bool AdjustTextFrameWidthAndHeight(tools::Rectangle
& rR
, bool bHgt
= true, bool bWdt
= true) const;
358 virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt
= true, bool bWdt
= true);
359 virtual bool AdjustTextFrameWidthAndHeight();
360 bool IsTextFrame() const { return mbTextFrame
; }
361 bool IsOutlText() const { return mbTextFrame
&& (meTextKind
==SdrObjKind::OutlineText
|| meTextKind
==SdrObjKind::TitleText
); }
362 /// returns true if the PPT autofit of text into shape bounds is enabled. implies IsFitToSize()==false!
363 bool IsAutoFit() const;
364 /// returns true if the old feature for fitting shape content should into shape is enabled. implies IsAutoFit()==false!
365 bool IsFitToSize() const;
368 SdrTextObj
*GetNextLinkInChain() const;
369 void SetNextLinkInChain(SdrTextObj
*);
370 SdrTextObj
*GetPrevLinkInChain() const;
371 bool IsChainable() const;
372 bool GetPreventChainable() const;
373 TextChain
*GetTextChain() const;
375 SdrObjKind
GetTextKind() const { return meTextKind
; }
378 virtual bool HasText() const override
;
380 bool IsTextEditActive() const { return mpEditingOutliner
!= nullptr; }
382 /** returns the currently active text. */
383 virtual SdrText
* getActiveText() const;
385 /** returns the nth available text. */
386 virtual SdrText
* getText( sal_Int32 nIndex
) const override
;
388 /** returns the number of texts available for this object. */
389 virtual sal_Int32
getTextCount() const override
;
391 /** returns true only if we are in edit mode and the user actually changed anything */
392 virtual bool IsReallyEdited() const;
394 /** changes the current active text */
395 virtual void setActiveText( sal_Int32 nIndex
);
397 /** returns the index of the text that contains the given point or -1 */
398 virtual sal_Int32
CheckTextHit(const Point
& rPnt
) const;
400 void SetDisableAutoWidthOnDragging(bool bOn
) { mbDisableAutoWidthOnDragging
=bOn
; }
401 void NbcSetText(const OUString
& rStr
);
402 void SetText(const OUString
& rStr
);
403 void NbcSetText(SvStream
& rInput
, const OUString
& rBaseURL
, EETextFormat eFormat
);
404 void SetText(SvStream
& rInput
, const OUString
& rBaseURL
, EETextFormat eFormat
);
406 // FitToSize and Fontwork are not taken into account in GetTextSize()!
407 virtual const Size
& GetTextSize() const;
408 void FitFrameToTextSize();
410 double GetFontScale() const;
411 double GetSpacingScale() const;
413 // Simultaneously sets the text into the Outliner (possibly
414 // the one of the EditOutliner) and sets the PaperSize.
415 virtual void TakeTextRect( SdrOutliner
& rOutliner
, tools::Rectangle
& rTextRect
, bool bNoEditText
,
416 tools::Rectangle
* pAnchorRect
, bool bLineWidth
= true ) const;
417 // Takes writing direction into account when adjusting the rectangle
418 void AdjustRectToTextDistance(tools::Rectangle
& rAnchorRect
) const;
419 virtual void TakeTextAnchorRect(::tools::Rectangle
& rAnchorRect
) const;
420 const GeoStat
& GetGeoStat() const { return maGeo
; }
423 tools::Long
GetEckenradius() const;
424 virtual bool IsAutoGrowHeight() const;
425 tools::Long
GetMinTextFrameHeight() const;
426 tools::Long
GetMaxTextFrameHeight() const;
427 virtual bool IsAutoGrowWidth() const;
428 tools::Long
GetMinTextFrameWidth() const;
429 tools::Long
GetMaxTextFrameWidth() const;
431 css::drawing::TextFitToSizeType
GetFitToSize() const;
432 const tools::Rectangle
&GetGeoRect() const;
434 // check if it's a TextFontwork
435 virtual bool IsFontwork() const;
437 // should the Fontwork contour be hidden?
438 bool IsHideContour() const;
440 // text flow within contour
441 bool IsContourTextFrame() const;
443 SdrTextHorzAdjust
GetTextHorizontalAdjust(const SfxItemSet
& rSet
) const;
444 SdrTextHorzAdjust
GetTextHorizontalAdjust() const;
446 SdrTextVertAdjust
GetTextVerticalAdjust(const SfxItemSet
& rSet
) const;
447 SdrTextVertAdjust
GetTextVerticalAdjust() const;
449 /** Left inner spacing to borders */
450 tools::Long
GetTextLeftDistance() const;
451 /** Right inner spacing to borders */
452 tools::Long
GetTextRightDistance() const;
453 /** Top inner spacing to borders */
454 tools::Long
GetTextUpperDistance() const;
455 /** Bottom inner spacing to borders */
456 tools::Long
GetTextLowerDistance() const;
457 SdrTextAniKind
GetTextAniKind() const;
458 SdrTextAniDirection
GetTextAniDirection() const;
460 bool HasTextColumnsNumber() const;
461 sal_Int16
GetTextColumnsNumber() const;
462 void SetTextColumnsNumber(sal_Int16 nColumns
);
463 bool HasTextColumnsSpacing() const;
464 sal_Int32
GetTextColumnsSpacing() const;
465 void SetTextColumnsSpacing(sal_Int32 nSpacing
);
467 // react on model/page change
468 virtual void handlePageChange(SdrPage
* pOldPage
, SdrPage
* pNewPage
) override
;
470 virtual void TakeObjInfo(SdrObjTransformInfoRec
& rInfo
) const override
;
471 virtual SdrObjKind
GetObjIdentifier() const override
;
473 // needed to determine text anchor area
474 virtual void TakeUnrotatedSnapRect(tools::Rectangle
& rRect
) const;
475 virtual OUString
TakeObjNameSingul() const override
;
476 virtual OUString
TakeObjNamePlural() const override
;
477 virtual rtl::Reference
<SdrObject
> CloneSdrObject(SdrModel
& rTargetModel
) const override
;
478 virtual basegfx::B2DPolyPolygon
TakeXorPoly() const override
;
479 virtual basegfx::B2DPolyPolygon
TakeContour() const override
;
480 virtual void RecalcSnapRect() override
;
481 virtual void NbcSetSnapRect(const tools::Rectangle
& rRect
) override
;
482 virtual void NbcSetLogicRect(const tools::Rectangle
& rRect
) override
;
483 virtual const tools::Rectangle
& GetLogicRect() const override
;
484 virtual Degree100
GetRotateAngle() const override
;
485 virtual Degree100
GetShearAngle(bool bVertical
= false) const override
;
487 virtual sal_uInt32
GetSnapPointCount() const override
;
488 virtual Point
GetSnapPoint(sal_uInt32 i
) const override
;
490 virtual sal_uInt32
GetHdlCount() const override
;
491 virtual void AddToHdlList(SdrHdlList
& rHdlList
) const override
;
493 // special drag methods
494 virtual bool hasSpecialDrag() const override
;
495 virtual bool applySpecialDrag(SdrDragStat
& rDrag
) override
;
496 virtual OUString
getSpecialDragComment(const SdrDragStat
& rDrag
) const override
;
498 virtual bool BegCreate(SdrDragStat
& rStat
) override
;
499 virtual bool MovCreate(SdrDragStat
& rStat
) override
;
500 virtual bool EndCreate(SdrDragStat
& rStat
, SdrCreateCmd eCmd
) override
;
501 virtual bool BckCreate(SdrDragStat
& rStat
) override
;
502 virtual void BrkCreate(SdrDragStat
& rStat
) override
;
503 virtual basegfx::B2DPolyPolygon
TakeCreatePoly(const SdrDragStat
& rDrag
) const override
;
504 virtual PointerStyle
GetCreatePointer() const override
;
506 virtual void NbcMove(const Size
& rSiz
) override
;
507 virtual void NbcResize(const Point
& rRef
, const Fraction
& xFact
, const Fraction
& yFact
) override
;
508 virtual void NbcRotate(const Point
& rRef
, Degree100 nAngle
, double sn
, double cs
) override
;
509 virtual void NbcMirror(const Point
& rRef1
, const Point
& rRef2
) override
;
510 virtual void NbcShear(const Point
& rRef
, Degree100 nAngle
, double tn
, bool bVShear
) override
;
512 virtual bool HasTextEdit() const override
;
513 // returns true if TextEditMode started
514 virtual bool BegTextEdit(SdrOutliner
& rOutl
);
515 virtual void TakeTextEditArea(Size
* pPaperMin
, Size
* pPaperMax
, tools::Rectangle
* pViewInit
, tools::Rectangle
* pViewMin
) const;
516 virtual void EndTextEdit(SdrOutliner
& rOutl
);
517 virtual EEAnchorMode
GetOutlinerViewAnchorMode() const;
519 virtual void NbcSetOutlinerParaObject(std::optional
<OutlinerParaObject
> pTextObject
) override
;
520 void NbcSetOutlinerParaObjectForText( std::optional
<OutlinerParaObject
> pTextObject
, SdrText
* pText
);
521 virtual OutlinerParaObject
* GetOutlinerParaObject() const override
;
522 bool CanCreateEditOutlinerParaObject() const;
523 std::optional
<OutlinerParaObject
> CreateEditOutlinerParaObject() const;
525 virtual void NbcReformatText() override
;
527 virtual bool CalcFieldValue(const SvxFieldItem
& rField
, sal_Int32 nPara
, sal_uInt16 nPos
,
528 bool bEdit
, std::optional
<Color
>& rpTxtColor
, std::optional
<Color
>& rpFldColor
, std::optional
<FontLineStyle
>& rpFldLineStyle
, OUString
& rRet
) const;
530 virtual rtl::Reference
<SdrObject
> DoConvertToPolyObj(bool bBezier
, bool bAddText
) const override
;
532 void SetTextEditOutliner(SdrOutliner
* pOutl
) { mpEditingOutliner
= pOutl
; }
534 /** Setup given Outliner equivalently to SdrTextObj::Paint()
536 To setup an arbitrary Outliner in the same way as the draw
537 outliner on SdrTextObj::Paint(). Among others, the paper size,
538 control word and character stretching are initialized, such
539 that the formatting should match the screen representation.
540 The textual content of the outliner is not touched, i.e. no
541 Init() or Clear() is called on the Outliner.
544 The Outliner to setup.
547 The region to paint the outliner content into. This is useful
548 to e.g. determine the top, left position of text in shapes.
550 void SetupOutlinerFormatting( SdrOutliner
& rOutl
, tools::Rectangle
& rPaintRect
) const;
552 /** Update given Outliner equivalently to SdrTextObj::Paint()
554 Same functionality as in SetupOutlinerFormatting(), except
555 that the outliner content is not cleared.
558 The Outliner to update.
561 The region to paint the outliner content into. This is useful
562 to e.g. determine the top, left position of text in shapes.
564 void UpdateOutlinerFormatting( SdrOutliner
& rOutl
, tools::Rectangle
& rPaintRect
) const;
565 void ForceOutlinerParaObject();
566 virtual bool IsVerticalWriting() const;
567 virtual void SetVerticalWriting(bool bVertical
);
568 bool IsTopToBottom() const;
570 /** called from the SdrObjEditView during text edit when the status of the edit outliner changes */
571 virtual void onEditOutlinerStatusEvent( EditStatus
* pEditStatus
);
573 /** called from the SdrObjEditView during text edit when a chain of boxes is to be updated */
574 void onChainingEvent();
577 // transformation interface for StarOfficeAPI. This implements support for
578 // homogen 3x3 matrices containing the transformation of the SdrObject. At the
579 // moment it contains a shearX, rotation and translation, but for setting all linear
580 // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
583 // gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
584 // with the base geometry and returns TRUE. Otherwise it returns FALSE.
585 virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix
& rMatrix
, basegfx::B2DPolyPolygon
& rPolyPolygon
) const override
;
587 // sets the base geometry of the object using infos contained in the homogen 3x3 matrix.
588 // If it's an SdrPathObj it will use the provided geometry information. The Polygon has
589 // to use (0,0) as upper left and will be scaled to the given size in the matrix.
590 virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix
& rMatrix
, const basegfx::B2DPolyPolygon
& rPolyPolygon
) override
;
592 // #103836# iterates over the paragraphs of a given SdrObject and removes all
593 // hard set character attributes with the which ids contained in the
595 void RemoveOutlinerCharacterAttribs( const std::vector
<sal_uInt16
>& rCharWhichIds
);
597 // Get necessary data for text scroll animation. ATM base it on a Text-Metafile and a
598 // painting rectangle. Rotation is taken from the object.
599 GDIMetaFile
* GetTextScrollMetaFileAndRectangle(tools::Rectangle
& rScrollRectangle
, tools::Rectangle
& rPaintRectangle
);
601 // Access to TextAnimationAllowed flag
602 void SetTextAnimationAllowed(bool bNew
);
605 // Set single item at the local ItemSet. *Does not use* AllowItemChange(),
606 // ItemChange(), PostItemChange() and ItemSetChanged() calls.
607 void SetObjectItemNoBroadcast(const SfxPoolItem
& rItem
);
608 double GetCameraZRotation() const;
612 // text primitive decomposition helpers
613 void impDecomposeContourTextPrimitive(
614 drawinglayer::primitive2d::Primitive2DContainer
& rTarget
,
615 const drawinglayer::primitive2d::SdrContourTextPrimitive2D
& rSdrContourTextPrimitive
,
616 const drawinglayer::geometry::ViewInformation2D
& aViewInformation
) const;
617 void impDecomposePathTextPrimitive(
618 drawinglayer::primitive2d::Primitive2DContainer
& rTarget
,
619 const drawinglayer::primitive2d::SdrPathTextPrimitive2D
& rSdrPathTextPrimitive
,
620 const drawinglayer::geometry::ViewInformation2D
& aViewInformation
) const;
621 void impDecomposeBlockTextPrimitive(
622 drawinglayer::primitive2d::Primitive2DContainer
& rTarget
,
623 const drawinglayer::primitive2d::SdrBlockTextPrimitive2D
& rSdrBlockTextPrimitive
,
624 const drawinglayer::geometry::ViewInformation2D
& aViewInformation
) const;
625 void impDecomposeAutoFitTextPrimitive(
626 drawinglayer::primitive2d::Primitive2DContainer
& rTarget
,
627 const drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D
& rSdrAutofitTextPrimitive
,
628 const drawinglayer::geometry::ViewInformation2D
& aViewInformation
) const;
629 void impDecomposeStretchTextPrimitive(
630 drawinglayer::primitive2d::Primitive2DContainer
& rTarget
,
631 const drawinglayer::primitive2d::SdrStretchTextPrimitive2D
& rSdrStretchTextPrimitive
,
632 const drawinglayer::geometry::ViewInformation2D
& aViewInformation
) const;
633 void impDecomposeChainedTextPrimitive(
634 drawinglayer::primitive2d::Primitive2DContainer
& rTarget
,
635 const drawinglayer::primitive2d::SdrChainedTextPrimitive2D
& rSdrChainedTextPrimitive
,
636 const drawinglayer::geometry::ViewInformation2D
& aViewInformation
) const;
637 void impHandleChainingEventsDuringDecomposition(SdrOutliner
&rOutliner
) const;
640 void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList
& rAnimList
) const;
641 void impGetScrollTextTiming(drawinglayer::animation::AnimationEntryList
& rAnimList
, double fFrameLength
, double fTextLength
) const;
643 // Direct decomposer for text visualization when you already have a prepared
644 // Outliner containing all the needed information
645 static void impDecomposeBlockTextPrimitiveDirect(
646 drawinglayer::primitive2d::Primitive2DContainer
& rTarget
,
647 SdrOutliner
& rOutliner
,
648 const basegfx::B2DHomMatrix
& rNewTransformA
,
649 const basegfx::B2DHomMatrix
& rNewTransformB
,
650 const basegfx::B2DRange
& rClipRange
);
652 /** returns false if the given pointer is NULL
653 or if the given SdrOutliner contains no text.
654 Also checks for one empty paragraph.
656 static bool HasTextImpl( SdrOutliner
const * pOutliner
);
658 virtual bool IsSdrTextObj() const final
{ return true; }
660 friend class ::SdrTextObjTest
;
663 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */