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