make ValueTransfer easier to understand
[LibreOffice.git] / include / svx / svdotext.hxx
blobd192552d16ad808da32ef6bf0b20876b0d573dd0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
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 <tools/datetime.hxx>
29 #include <svl/style.hxx>
30 #include <svx/svdtext.hxx>
31 #include <svx/svxdllapi.h>
32 #include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
33 #include <memory>
34 #include <vector>
36 #include <com/sun/star/drawing/TextFitToSizeType.hpp>
38 // forward declarations
40 class OutlinerParaObject;
41 class OverflowingText;
42 class SdrOutliner;
43 class SdrPathObj;
44 class SdrTextObj;
45 class SdrTextObjTest;
46 class SvxFieldItem;
47 class ImpSdrObjTextLink;
48 class EditStatus;
49 class TextChain;
50 class TextChainFlow;
52 enum class EEAnchorMode;
53 enum class EETextFormat;
55 namespace sdr::properties {
56 class TextProperties;
59 namespace drawinglayer::primitive2d {
60 class SdrContourTextPrimitive2D;
61 class SdrPathTextPrimitive2D;
62 class SdrBlockTextPrimitive2D;
63 class SdrAutoFitTextPrimitive2D;
64 class SdrStretchTextPrimitive2D;
65 class SdrChainedTextPrimitive2D;
68 namespace drawinglayer::animation {
69 class AnimationEntryList;
72 namespace drawinglayer::geometry {
73 class ViewInformation2D;
76 namespace sdr::table {
77 class Cell;
78 class SdrTableRtfExporter;
79 class SdrTableRTFParser;
83 // Defines
84 constexpr const sal_uInt16 SDRUSERDATA_OBJTEXTLINK = 1;
87 // helper class SdrTextObjGeoData
88 class SdrTextObjGeoData : public SdrObjGeoData
90 public:
91 tools::Rectangle maRect;
92 GeoStat maGeo;
96 // helper class ImpSdrObjTextLinkUserData
97 class ImpSdrObjTextLinkUserData final : public SdrObjUserData
99 friend class SdrTextObj;
100 friend class ImpSdrObjTextLink;
102 OUString maFileName; // name of the referenced document
103 OUString maFilterName; // a filter, if need be
104 DateTime maFileDate0; // avoiding unnecessary reload
105 tools::SvRef<ImpSdrObjTextLink> mpLink;
106 rtl_TextEncoding meCharSet;
108 public:
109 ImpSdrObjTextLinkUserData();
110 virtual ~ImpSdrObjTextLinkUserData() override;
112 virtual std::unique_ptr<SdrObjUserData> Clone(SdrObject* pObj1) const override;
115 namespace sdr::properties
117 class CustomShapeProperties;
118 class CellProperties;
121 // SdrTextObj
123 typedef std::unique_ptr<SdrPathObj, SdrObjectFreeOp> SdrPathObjUniquePtr;
125 class SVXCORE_DLLPUBLIC SdrTextObj : public SdrAttrObj, public svx::ITextProvider
127 private:
128 // Cell needs access to ImpGetDrawOutliner();
129 friend class sdr::table::Cell;
130 friend class sdr::table::SdrTableRtfExporter;
131 friend class sdr::table::SdrTableRTFParser;
132 friend class TextChain;
133 friend class TextChainFlow;
134 friend class EditingTextChainFlow;
136 // CustomShapeproperties need to access the "bTextFrame" member:
137 friend class sdr::properties::CustomShapeProperties;
139 protected:
140 virtual std::unique_ptr<sdr::properties::BaseProperties> CreateObjectSpecificProperties() override;
141 virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
143 private:
144 // This method is only allowed for sdr::properties::TextProperties
145 SVX_DLLPRIVATE SdrOutliner* GetTextEditOutliner() const
147 return mpEditingOutliner;
150 // to allow sdr::properties::TextProperties access to SetPortionInfoChecked()
151 // and GetTextEditOutliner()
152 friend class sdr::properties::TextProperties;
153 friend class sdr::properties::CellProperties;
155 friend class ImpSdrObjTextLink;
156 friend class ImpSdrObjTextLinkUserData;
157 friend class SdrPowerPointImport; // for PowerPointImport
158 friend class SdrExchangeView; // for ImpGetDrawOutliner
159 friend class SdrView; // for ImpGetDrawOutliner
160 friend class SdrObjEditView; // for TextEdit
161 friend class SdrMeasureObj; // for ImpGetDrawOutliner
162 friend class SvxMSDffManager; // for ImpGetDrawOutliner
163 friend class SdrObjCustomShape; // for ImpGetDrawOutliner
164 friend class SdrText; // for ImpGetDrawOutliner
166 protected:
167 // The "aRect" is also the rect of RectObj and CircObj.
168 // When bTextFrame=sal_True the text will be formatted into this rect
169 // When bTextFrame=sal_False the text will be centered around its middle
170 tools::Rectangle maRect;
172 // The GeoStat contains the rotation and shear angles
173 GeoStat maGeo;
175 // this is the active text
176 std::unique_ptr<SdrText> mpText;
178 // This contains the dimensions of the text
179 Size maTextSize;
181 // an Outliner*, so that
182 // 1. the TextObj won't be edited simultaneously by multiple views, and
183 // 2. when streaming while editing Flush() can be done
184 SdrOutliner* mpEditingOutliner;
186 // Possible values for eTextKind are:
187 // OBJ_TEXT regular text frame
188 // OBJ_TITLETEXT TitleText for presentations
189 // OBJ_OUTLINETEXT OutlineText for presentations
190 // eTextKind only has meaning when bTextFrame=sal_True, since otherwise
191 // we're dealing with a labeled graphical object
192 SdrObjKind meTextKind;
194 // For text editing in SW Header/Footer it is necessary to be
195 // able to set an offset for the text edit to allow text editing at the
196 // position of the virtual object. This offset is used when setting up
197 // and maintaining the OutlinerView.
198 Point maTextEditOffset;
200 virtual SdrObjectUniquePtr getFullDragClone() const override;
203 public:
204 const Point& GetTextEditOffset() const { return maTextEditOffset; }
205 void SetTextEditOffset(const Point& rNew) { maTextEditOffset = rNew; }
207 protected:
208 bool mbIsUnchainableClone = false;
210 // the successor in a chain
211 SdrTextObj* mpNextInChain = nullptr;
212 SdrTextObj* mpPrevInChain = nullptr;
214 // For labeled graphical objects bTextFrame is FALSE. The block of text
215 // will then be centered horizontally and vertically on aRect.
216 // For bTextFalse=sal_True the text will be formatted into aRect.
217 // The actual text frame is realized by an SdrRectObj with
218 // bTextFrame=sal_True.
219 bool mbTextFrame : 1;
220 bool mbNoShear : 1; // disable shearing (->graphic+Ole+TextFrame)
221 bool mbTextSizeDirty : 1;
223 bool mbInEditMode : 1; // Is this text object in edit mode?
225 // For objects with free size (flow text). The flag is set by the
226 // application on create. If the object width is later resized,
227 // AutoGrowWidth will be disabled (set to sal_False). This flag will
228 // then also be set to sal_False, so that the object behaves like a
229 // normal text object.
230 // Width resize can result from:
231 // - Interactive Resize in single or multiple selections
232 // - position/size dialog
233 bool mbDisableAutoWidthOnDragging : 1;
235 // Flag for allowing text animation. Default is sal_true.
236 bool mbTextAnimationAllowed : 1;
238 // flag for preventing recursive onEditOutlinerStatusEvent calls
239 bool mbInDownScale : 1;
241 SdrOutliner& ImpGetDrawOutliner() const;
243 private:
244 // #101029#: Extracted from ImpGetDrawOutliner()
245 SVX_DLLPRIVATE void ImpInitDrawOutliner( SdrOutliner& rOutl ) const;
246 // #101029#: Extracted from Paint()
247 SVX_DLLPRIVATE void ImpSetupDrawOutlinerForPaint( bool bContourFrame,
248 SdrOutliner& rOutliner,
249 tools::Rectangle& rTextRect,
250 tools::Rectangle& rAnchorRect,
251 tools::Rectangle& rPaintRect,
252 Fraction& aFitXCorrection ) const;
253 void ImpAutoFitText( SdrOutliner& rOutliner ) const;
254 void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting ) const;
255 SVX_DLLPRIVATE SdrObjectUniquePtr ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const;
256 SVX_DLLPRIVATE void ImpRegisterLink();
257 SVX_DLLPRIVATE void ImpDeregisterLink();
258 SVX_DLLPRIVATE ImpSdrObjTextLinkUserData* GetLinkUserData() const;
260 /** Appends the style family to a provided style name */
261 static void AppendFamilyToStyleName(OUString& styleName, SfxStyleFamily family);
263 /** Reads the style family from a style name to which the family has been appended. */
264 static SfxStyleFamily ReadFamilyFromStyleName(const OUString& styleName);
266 protected:
267 bool ImpCanConvTextToCurve() const;
268 SdrPathObjUniquePtr ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier) const;
269 SdrObjectUniquePtr ImpConvertAddText(SdrObjectUniquePtr pObj, bool bBezier) const;
270 void ImpSetTextStyleSheetListeners();
271 static void ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXCorrection);
272 static void ImpJustifyRect(tools::Rectangle& rRect);
273 void ImpCheckShear();
274 tools::Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
275 void ImpSetTextEditParams() const;
276 void SetTextSizeDirty() { mbTextSizeDirty = true; }
278 // rAnchorRect is InOut-Parameter!
279 void ImpSetContourPolygon( SdrOutliner& rOutliner, tools::Rectangle const & rAnchorRect, bool bLineWidth ) const;
281 virtual std::unique_ptr<SdrObjGeoData> NewGeoData() const override;
282 virtual void SaveGeoData(SdrObjGeoData& rGeo) const override;
283 virtual void RestoreGeoData(const SdrObjGeoData& rGeo) override;
284 void NbcSetEckenradius(tools::Long nRad);
286 // #115391# new method for SdrObjCustomShape and SdrTextObj to correctly handle and set
287 // SdrTextMinFrameWidthItem and SdrTextMinFrameHeightItem based on all settings, necessities
288 // and object sizes
289 virtual void AdaptTextMinSize();
291 // constructors for labeled graphical objects
292 SdrTextObj(SdrModel& rSdrModel);
293 SdrTextObj(
294 SdrModel& rSdrModel,
295 const tools::Rectangle& rNewRect);
297 // constructors for text frames
298 SdrTextObj(
299 SdrModel& rSdrModel,
300 SdrObjKind eNewTextKind);
301 SdrTextObj(
302 SdrModel& rSdrModel,
303 SdrObjKind eNewTextKind,
304 const tools::Rectangle& rNewRect);
306 // copy constructor
307 SdrTextObj(SdrModel& rSdrModel, SdrTextObj const & rSource);
309 // protected destructor
310 virtual ~SdrTextObj() override;
312 public:
314 bool IsInEditMode() const { return mbInEditMode; }
316 // Currently ASCII and RTF are supported and the differentiation is done
317 // internally.
318 // rFilterName has no meaning and must be empty
319 // Normally the application only has to call SetTextLink() - the
320 // remainder is automatic (SfxLinkManager).
321 // The LoadText() method can also be used to load a file into a text
322 // object (without linking.)
323 // TextLinks can't be edited (if needed later could be ReadOnly).
324 // Setting attributes can only be done on the text frame.
325 void SetTextLink(const OUString& rFileName, const OUString& rFilterName);
326 void ReleaseTextLink();
327 bool IsLinkedText() const { return m_pPlusData != nullptr && GetLinkUserData() != nullptr; }
328 bool ReloadLinkedText(bool bForceLoad);
329 bool LoadText(const OUString& rFileName, rtl_TextEncoding eCharSet);
331 virtual bool AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool bHgt = true, bool bWdt = true) const;
332 virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true);
333 virtual bool AdjustTextFrameWidthAndHeight();
334 bool IsTextFrame() const { return mbTextFrame; }
335 bool IsOutlText() const { return mbTextFrame && (meTextKind==OBJ_OUTLINETEXT || meTextKind==OBJ_TITLETEXT); }
336 /// returns true if the PPT autofit of text into shape bounds is enabled. implies IsFitToSize()==false!
337 bool IsAutoFit() const;
338 /// returns true if the old feature for fitting shape content should into shape is enabled. implies IsAutoFit()==false!
339 bool IsFitToSize() const;
341 // Chaining
342 SdrTextObj *GetNextLinkInChain() const;
343 void SetNextLinkInChain(SdrTextObj *);
344 SdrTextObj *GetPrevLinkInChain() const;
345 bool IsChainable() const;
346 bool GetPreventChainable() const;
347 TextChain *GetTextChain() const;
349 SdrObjKind GetTextKind() const { return meTextKind; }
351 // #i121917#
352 virtual bool HasText() const override;
354 bool IsTextEditActive() const { return mpEditingOutliner != nullptr; }
356 /** returns the currently active text. */
357 virtual SdrText* getActiveText() const;
359 /** returns the nth available text. */
360 virtual SdrText* getText( sal_Int32 nIndex ) const override;
362 /** returns the number of texts available for this object. */
363 virtual sal_Int32 getTextCount() const override;
365 /** returns true only if we are in edit mode and the user actually changed anything */
366 virtual bool IsReallyEdited() const;
368 /** changes the current active text */
369 virtual void setActiveText( sal_Int32 nIndex );
371 /** returns the index of the text that contains the given point or -1 */
372 virtual sal_Int32 CheckTextHit(const Point& rPnt) const;
374 void SetDisableAutoWidthOnDragging(bool bOn) { mbDisableAutoWidthOnDragging=bOn; }
375 void NbcSetText(const OUString& rStr);
376 void SetText(const OUString& rStr);
377 void NbcSetText(SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat);
378 void SetText(SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat);
380 // FitToSize and Fontwork are not taken into account in GetTextSize()!
381 virtual const Size& GetTextSize() const;
382 void FitFrameToTextSize();
383 sal_uInt16 GetFontScaleY() const;
385 // Simultaneously sets the text into the Outliner (possibly
386 // the one of the EditOutliner) and sets the PaperSize.
387 virtual void TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRect, bool bNoEditText,
388 tools::Rectangle* pAnchorRect, bool bLineWidth = true ) const;
389 // Takes writing direction into account when adjusting the rectangle
390 void AdjustRectToTextDistance(tools::Rectangle& rAnchorRect) const;
391 virtual void TakeTextAnchorRect(::tools::Rectangle& rAnchorRect) const;
392 const GeoStat& GetGeoStat() const { return maGeo; }
394 // get corner radius
395 tools::Long GetEckenradius() const;
396 virtual bool IsAutoGrowHeight() const;
397 tools::Long GetMinTextFrameHeight() const;
398 tools::Long GetMaxTextFrameHeight() const;
399 virtual bool IsAutoGrowWidth() const;
400 tools::Long GetMinTextFrameWidth() const;
401 tools::Long GetMaxTextFrameWidth() const;
403 css::drawing::TextFitToSizeType GetFitToSize() const;
404 const tools::Rectangle &GetGeoRect() const;
406 // check if it's a TextFontwork
407 virtual bool IsFontwork() const;
409 // should the Fontwork contour be hidden?
410 bool IsHideContour() const;
412 // text flow within contour
413 bool IsContourTextFrame() const;
415 SdrTextHorzAdjust GetTextHorizontalAdjust(const SfxItemSet& rSet) const;
416 SdrTextHorzAdjust GetTextHorizontalAdjust() const;
418 SdrTextVertAdjust GetTextVerticalAdjust(const SfxItemSet& rSet) const;
419 SdrTextVertAdjust GetTextVerticalAdjust() const;
421 /** Left inner spacing to borders */
422 tools::Long GetTextLeftDistance() const;
423 /** Right inner spacing to borders */
424 tools::Long GetTextRightDistance() const;
425 /** Top inner spacing to borders */
426 tools::Long GetTextUpperDistance() const;
427 /** Bottom inner spacing to borders */
428 tools::Long GetTextLowerDistance() const;
429 SdrTextAniKind GetTextAniKind() const;
430 SdrTextAniDirection GetTextAniDirection() const;
432 bool HasTextColumnsNumber() const;
433 sal_Int16 GetTextColumnsNumber() const;
434 void SetTextColumnsNumber(sal_Int16 nColumns);
435 bool HasTextColumnsSpacing() const;
436 sal_Int32 GetTextColumnsSpacing() const;
437 void SetTextColumnsSpacing(sal_Int32 nSpacing);
439 // react on model/page change
440 virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override;
442 virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
443 virtual SdrObjKind GetObjIdentifier() const override;
445 // needed to determine text anchor area
446 virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const;
447 virtual OUString TakeObjNameSingul() const override;
448 virtual OUString TakeObjNamePlural() const override;
449 virtual SdrTextObj* CloneSdrObject(SdrModel& rTargetModel) const override;
450 virtual basegfx::B2DPolyPolygon TakeXorPoly() const override;
451 virtual basegfx::B2DPolyPolygon TakeContour() const override;
452 virtual void RecalcSnapRect() override;
453 virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override;
454 virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
455 virtual const tools::Rectangle& GetLogicRect() const override;
456 virtual Degree100 GetRotateAngle() const override;
457 virtual Degree100 GetShearAngle(bool bVertical = false) const override;
459 virtual sal_uInt32 GetSnapPointCount() const override;
460 virtual Point GetSnapPoint(sal_uInt32 i) const override;
462 virtual sal_uInt32 GetHdlCount() const override;
463 virtual void AddToHdlList(SdrHdlList& rHdlList) const override;
465 // special drag methods
466 virtual bool hasSpecialDrag() const override;
467 virtual bool applySpecialDrag(SdrDragStat& rDrag) override;
468 virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override;
470 virtual bool BegCreate(SdrDragStat& rStat) override;
471 virtual bool MovCreate(SdrDragStat& rStat) override;
472 virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override;
473 virtual bool BckCreate(SdrDragStat& rStat) override;
474 virtual void BrkCreate(SdrDragStat& rStat) override;
475 virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override;
476 virtual PointerStyle GetCreatePointer() const override;
478 virtual void NbcMove(const Size& rSiz) override;
479 virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
480 virtual void NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs) override;
481 virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override;
482 virtual void NbcShear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear) override;
484 virtual bool HasTextEdit() const override;
485 // returns true if TextEditMode started
486 virtual bool BegTextEdit(SdrOutliner& rOutl);
487 virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools::Rectangle* pViewInit, tools::Rectangle* pViewMin) const;
488 virtual void EndTextEdit(SdrOutliner& rOutl);
489 virtual EEAnchorMode GetOutlinerViewAnchorMode() const;
491 virtual void NbcSetOutlinerParaObject(std::optional<OutlinerParaObject> pTextObject) override;
492 void NbcSetOutlinerParaObjectForText( std::optional<OutlinerParaObject> pTextObject, SdrText* pText );
493 virtual OutlinerParaObject* GetOutlinerParaObject() const override;
494 bool CanCreateEditOutlinerParaObject() const;
495 std::optional<OutlinerParaObject> CreateEditOutlinerParaObject() const;
497 virtual void NbcReformatText() override;
499 virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos,
500 bool bEdit, std::optional<Color>& rpTxtColor, std::optional<Color>& rpFldColor, OUString& rRet) const;
502 virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
504 void SetTextEditOutliner(SdrOutliner* pOutl) { mpEditingOutliner = pOutl; }
506 /** Setup given Outliner equivalently to SdrTextObj::Paint()
508 To setup an arbitrary Outliner in the same way as the draw
509 outliner on SdrTextObj::Paint(). Among others, the paper size,
510 control word and character stretching are initialized, such
511 that the formatting should match the screen representation.
512 The textual content of the outliner is not touched, i.e. no
513 Init() or Clear() is called on the Outliner.
515 @param rOutl
516 The Outliner to setup.
518 @param rPaintRect
519 The region to paint the outliner content into. This is useful
520 to e.g. determine the top, left position of text in shapes.
522 void SetupOutlinerFormatting( SdrOutliner& rOutl, tools::Rectangle& rPaintRect ) const;
524 /** Update given Outliner equivalently to SdrTextObj::Paint()
526 Same functionality as in SetupOutlinerFormatting(), except
527 that the outliner content is not cleared.
529 @param rOutl
530 The Outliner to update.
532 @param rPaintRect
533 The region to paint the outliner content into. This is useful
534 to e.g. determine the top, left position of text in shapes.
536 void UpdateOutlinerFormatting( SdrOutliner& rOutl, tools::Rectangle& rPaintRect ) const;
537 void ForceOutlinerParaObject();
538 virtual bool IsVerticalWriting() const;
539 virtual void SetVerticalWriting(bool bVertical);
540 bool IsTopToBottom() const;
542 /** called from the SdrObjEditView during text edit when the status of the edit outliner changes */
543 virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus );
545 /** called from the SdrObjEditView during text edit when a chain of boxes is to be updated */
546 void onChainingEvent();
549 // transformation interface for StarOfficeAPI. This implements support for
550 // homogen 3x3 matrices containing the transformation of the SdrObject. At the
551 // moment it contains a shearX, rotation and translation, but for setting all linear
552 // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
555 // gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
556 // with the base geometry and returns TRUE. Otherwise it returns FALSE.
557 virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const override;
559 // sets the base geometry of the object using infos contained in the homogen 3x3 matrix.
560 // If it's an SdrPathObj it will use the provided geometry information. The Polygon has
561 // to use (0,0) as upper left and will be scaled to the given size in the matrix.
562 virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon) override;
564 // #103836# iterates over the paragraphs of a given SdrObject and removes all
565 // hard set character attributes with the which ids contained in the
566 // given vector
567 void RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>& rCharWhichIds );
569 // Get necessary data for text scroll animation. ATM base it on a Text-Metafile and a
570 // painting rectangle. Rotation is taken from the object.
571 GDIMetaFile* GetTextScrollMetaFileAndRectangle(tools::Rectangle& rScrollRectangle, tools::Rectangle& rPaintRectangle);
573 // Access to TextAnimationAllowed flag
574 void SetTextAnimationAllowed(bool bNew);
576 // #i8824#
577 // Set single item at the local ItemSet. *Does not use* AllowItemChange(),
578 // ItemChange(), PostItemChange() and ItemSetChanged() calls.
579 void SetObjectItemNoBroadcast(const SfxPoolItem& rItem);
580 double GetCameraZRotation() const;
582 public:
584 // text primitive decomposition helpers
585 void impDecomposeContourTextPrimitive(
586 drawinglayer::primitive2d::Primitive2DContainer& rTarget,
587 const drawinglayer::primitive2d::SdrContourTextPrimitive2D& rSdrContourTextPrimitive,
588 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
589 void impDecomposePathTextPrimitive(
590 drawinglayer::primitive2d::Primitive2DContainer& rTarget,
591 const drawinglayer::primitive2d::SdrPathTextPrimitive2D& rSdrPathTextPrimitive,
592 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
593 void impDecomposeBlockTextPrimitive(
594 drawinglayer::primitive2d::Primitive2DContainer& rTarget,
595 const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive,
596 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
597 void impDecomposeAutoFitTextPrimitive(
598 drawinglayer::primitive2d::Primitive2DContainer& rTarget,
599 const drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D& rSdrAutofitTextPrimitive,
600 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
601 void impDecomposeStretchTextPrimitive(
602 drawinglayer::primitive2d::Primitive2DContainer& rTarget,
603 const drawinglayer::primitive2d::SdrStretchTextPrimitive2D& rSdrStretchTextPrimitive,
604 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
605 void impDecomposeChainedTextPrimitive(
606 drawinglayer::primitive2d::Primitive2DContainer& rTarget,
607 const drawinglayer::primitive2d::SdrChainedTextPrimitive2D& rSdrChainedTextPrimitive,
608 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
609 void impHandleChainingEventsDuringDecomposition(SdrOutliner &rOutliner) const;
611 // timing generators
612 void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const;
613 void impGetScrollTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList, double fFrameLength, double fTextLength) const;
615 // Direct decomposer for text visualization when you already have a prepared
616 // Outliner containing all the needed information
617 static void impDecomposeBlockTextPrimitiveDirect(
618 drawinglayer::primitive2d::Primitive2DContainer& rTarget,
619 SdrOutliner& rOutliner,
620 const basegfx::B2DHomMatrix& rNewTransformA,
621 const basegfx::B2DHomMatrix& rNewTransformB,
622 const basegfx::B2DRange& rClipRange);
624 /** returns false if the given pointer is NULL
625 or if the given SdrOutliner contains no text.
626 Also checks for one empty paragraph.
628 static bool HasTextImpl( SdrOutliner const * pOutliner );
630 friend class ::SdrTextObjTest;
633 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */