LibreOffice Module svx (master) 1
svdotext.hxx
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#pragma once
21
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>
33#include <memory>
34#include <vector>
35
36#include <com/sun/star/drawing/TextFitToSizeType.hpp>
37
38// forward declarations
39
41class OverflowingText;
42class SdrOutliner;
43class SdrPathObj;
44class SdrTextObj;
45class SdrTextObjTest;
46class SvxFieldItem;
48class EditStatus;
49class TextChain;
50class TextChainFlow;
51
52enum class EEAnchorMode;
53enum class EETextFormat;
54
55namespace sdr::properties {
56 class TextProperties;
57}
58
60 class SdrContourTextPrimitive2D;
61 class SdrPathTextPrimitive2D;
62 class SdrBlockTextPrimitive2D;
63 class SdrAutoFitTextPrimitive2D;
64 class SdrStretchTextPrimitive2D;
65 class SdrChainedTextPrimitive2D;
66}
67
69 class AnimationEntryList;
70}
71
72namespace drawinglayer::geometry {
73 class ViewInformation2D;
74}
75
76namespace sdr::table {
77 class Cell;
78 class SdrTableRtfExporter;
79 class SdrTableRTFParser;
80}
81
82
83// Defines
84constexpr const sal_uInt16 SDRUSERDATA_OBJTEXTLINK = 1;
85
86
87// helper class SdrTextObjGeoData
89{
90public:
93};
94
95
96// helper class ImpSdrObjTextLinkUserData
98{
99 friend class SdrTextObj;
100 friend class ImpSdrObjTextLink;
101
102 OUString maFileName; // name of the referenced document
103 OUString maFilterName; // a filter, if need be
104 DateTime maFileDate0; // avoiding unnecessary reload
106 rtl_TextEncoding meCharSet;
107
108public:
110 virtual ~ImpSdrObjTextLinkUserData() override;
111
112 virtual std::unique_ptr<SdrObjUserData> Clone(SdrObject* pObj1) const override;
113};
114
115namespace sdr::properties
116{
117 class CustomShapeProperties;
118 class CellProperties;
119}
120
121// SdrTextObj
122
124{
125private:
126 // Cell needs access to ImpGetDrawOutliner();
127 friend class sdr::table::Cell;
130 friend class TextChain;
131 friend class TextChainFlow;
133
134 // CustomShapeproperties need to access the "mbTextFrame" member:
136
137protected:
138 virtual std::unique_ptr<sdr::properties::BaseProperties> CreateObjectSpecificProperties() override;
139 virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
140
141private:
142 // This method is only allowed for sdr::properties::TextProperties
144 {
145 return mpEditingOutliner;
146 }
147
148 // to allow sdr::properties::TextProperties access to SetPortionInfoChecked()
149 // and GetTextEditOutliner()
152
153 friend class ImpSdrObjTextLink;
155 friend class SdrPowerPointImport; // for PowerPointImport
156 friend class SdrExchangeView; // for ImpGetDrawOutliner
157 friend class SdrView; // for ImpGetDrawOutliner
158 friend class SdrObjEditView; // for TextEdit
159 friend class SdrMeasureObj; // for ImpGetDrawOutliner
160 friend class SvxMSDffManager; // for ImpGetDrawOutliner
161 friend class SdrObjCustomShape; // for ImpGetDrawOutliner
162 friend class SdrText; // for ImpGetDrawOutliner
163
164protected:
165 // The "aRect" is also the rect of RectObj and CircObj.
166 // When mbTextFrame=true the text will be formatted into this rect
167 // When mbTextFrame=false the text will be centered around its middle
169
171 {
172 return maRectangle;
173 }
174
175 void setRectangle(tools::Rectangle const& rRectangle)
176 {
177 maRectangle = rRectangle;
178 }
179
180 void setRectangleSize(sal_Int32 nWidth, sal_Int32 nHeight)
181 {
182 maRectangle.SetSize(Size(nWidth, nHeight));
183 }
184
185 void moveRectangle(sal_Int32 nXDelta, sal_Int32 nYDelta)
186 {
187 maRectangle.Move(nXDelta, nYDelta);
188 }
189
190 void moveRectanglePosition(sal_Int32 nX, sal_Int32 nY)
191 {
192 maRectangle.SetPos(Point(nX, nY));
193 }
194
195 // The GeoStat contains the rotation and shear angles
197
198 // this is the active text
200
201 // This contains the dimensions of the text
203
204 // an Outliner*, so that
205 // 1. the TextObj won't be edited simultaneously by multiple views, and
206 // 2. when streaming while editing Flush() can be done
208
209 // Possible values for eTextKind are:
210 // SdrObjKind::Text regular text frame
211 // SdrObjKind::TitleText TitleText for presentations
212 // SdrObjKind::OutlineText OutlineText for presentations
213 // eTextKind only has meaning when mbTextFrame=true, since otherwise
214 // we're dealing with a labeled graphical object
216
217 // For text editing in SW Header/Footer it is necessary to be
218 // able to set an offset for the text edit to allow text editing at the
219 // position of the virtual object. This offset is used when setting up
220 // and maintaining the OutlinerView.
222
223 virtual rtl::Reference<SdrObject> getFullDragClone() const override;
224
225
226public:
227 const Point& GetTextEditOffset() const { return maTextEditOffset; }
228 void SetTextEditOffset(const Point& rNew) { maTextEditOffset = rNew; }
229
230protected:
231 bool mbIsUnchainableClone = false;
232
233 // the successor in a chain
234 SdrTextObj* mpNextInChain = nullptr;
235 SdrTextObj* mpPrevInChain = nullptr;
236
237 // For labeled graphical objects bTextFrame is FALSE. The block of text
238 // will then be centered horizontally and vertically on aRect.
239 // For mbTextFrame=true the text will be formatted into aRect.
240 // The actual text frame is realized by an SdrRectObj with
241 // mbTextFrame=true.
242 bool mbTextFrame : 1;
243 bool mbNoShear : 1; // disable shearing (->graphic+Ole+TextFrame)
245
246 bool mbInEditMode : 1; // Is this text object in edit mode?
247
248 // For objects with free size (flow text). The flag is set by the
249 // application on create. If the object width is later resized,
250 // AutoGrowWidth will be disabled (set to sal_False). This flag will
251 // then also be set to sal_False, so that the object behaves like a
252 // normal text object.
253 // Width resize can result from:
254 // - Interactive Resize in single or multiple selections
255 // - position/size dialog
257
258 // Flag for allowing text animation. Default is sal_true.
260
261 // flag for preventing recursive onEditOutlinerStatusEvent calls
263
264 SdrOutliner& ImpGetDrawOutliner() const;
265
266private:
267 // #101029#: Extracted from ImpGetDrawOutliner()
268 SVX_DLLPRIVATE void ImpInitDrawOutliner( SdrOutliner& rOutl ) const;
269 // #101029#: Extracted from Paint()
270 SVX_DLLPRIVATE void ImpSetupDrawOutlinerForPaint( bool bContourFrame,
271 SdrOutliner& rOutliner,
272 tools::Rectangle& rTextRect,
273 tools::Rectangle& rAnchorRect,
274 tools::Rectangle& rPaintRect,
275 Fraction& aFitXCorrection ) const;
276 void ImpAutoFitText( SdrOutliner& rOutliner ) const;
277 void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting ) const;
278 void autoFitTextForCompatibility(SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting) const;
279
280 SVX_DLLPRIVATE rtl::Reference<SdrObject> ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const;
281 SVX_DLLPRIVATE void ImpRegisterLink();
282 SVX_DLLPRIVATE void ImpDeregisterLink();
283 SVX_DLLPRIVATE ImpSdrObjTextLinkUserData* GetLinkUserData() const;
284
286 static void AppendFamilyToStyleName(OUString& styleName, SfxStyleFamily family);
287
289 static SfxStyleFamily ReadFamilyFromStyleName(std::u16string_view styleName);
290
291protected:
292 bool ImpCanConvTextToCurve() const;
293 rtl::Reference<SdrPathObj> ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier) const;
294 rtl::Reference<SdrObject> ImpConvertAddText(rtl::Reference<SdrObject> pObj, bool bBezier) const;
295 void ImpSetTextStyleSheetListeners();
296 static void ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXCorrection);
297 static void ImpJustifyRect(tools::Rectangle& rRect);
298 void ImpCheckShear();
299 tools::Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
300 void ImpSetTextEditParams() const;
301 void SetTextSizeDirty() { mbTextSizeDirty = true; }
302
303 // rAnchorRect is InOut-Parameter!
304 void ImpSetContourPolygon( SdrOutliner& rOutliner, tools::Rectangle const & rAnchorRect, bool bLineWidth ) const;
305
306 virtual std::unique_ptr<SdrObjGeoData> NewGeoData() const override;
307 virtual void SaveGeoData(SdrObjGeoData& rGeo) const override;
308 virtual void RestoreGeoData(const SdrObjGeoData& rGeo) override;
309 void NbcSetEckenradius(tools::Long nRad);
310
311 // #115391# new method for SdrObjCustomShape and SdrTextObj to correctly handle and set
312 // SdrTextMinFrameWidthItem and SdrTextMinFrameHeightItem based on all settings, necessities
313 // and object sizes
314 virtual void AdaptTextMinSize();
315
316 // constructors for labeled graphical objects
317 SdrTextObj(SdrModel& rSdrModel);
319 SdrModel& rSdrModel,
320 const tools::Rectangle& rNewRect);
321
322 // constructors for text frames
324 SdrModel& rSdrModel,
325 SdrObjKind eNewTextKind);
327 SdrModel& rSdrModel,
328 SdrObjKind eNewTextKind,
329 const tools::Rectangle& rNewRect);
330
331 // copy constructor
332 SdrTextObj(SdrModel& rSdrModel, SdrTextObj const & rSource);
333
334 // protected destructor
335 virtual ~SdrTextObj() override;
336
337public:
338
339 bool IsInEditMode() const { return mbInEditMode; }
340
341 // Currently ASCII and RTF are supported and the differentiation is done
342 // internally.
343 // rFilterName has no meaning and must be empty
344 // Normally the application only has to call SetTextLink() - the
345 // remainder is automatic (SfxLinkManager).
346 // The LoadText() method can also be used to load a file into a text
347 // object (without linking.)
348 // TextLinks can't be edited (if needed later could be ReadOnly).
349 // Setting attributes can only be done on the text frame.
350 void SetTextLink(const OUString& rFileName, const OUString& rFilterName);
351 void ReleaseTextLink();
352 bool IsLinkedText() const { return m_pPlusData != nullptr && GetLinkUserData() != nullptr; }
353 bool ReloadLinkedText(bool bForceLoad);
354 bool LoadText(const OUString& rFileName, rtl_TextEncoding eCharSet);
355
356 virtual bool AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool bHgt = true, bool bWdt = true) const;
357 virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true);
358 virtual bool AdjustTextFrameWidthAndHeight();
359 bool IsTextFrame() const { return mbTextFrame; }
360 bool IsOutlText() const { return mbTextFrame && (meTextKind==SdrObjKind::OutlineText || meTextKind==SdrObjKind::TitleText); }
362 bool IsAutoFit() const;
364 bool IsFitToSize() const;
365
366 // Chaining
367 SdrTextObj *GetNextLinkInChain() const;
368 void SetNextLinkInChain(SdrTextObj *);
369 SdrTextObj *GetPrevLinkInChain() const;
370 bool IsChainable() const;
371 bool GetPreventChainable() const;
372 TextChain *GetTextChain() const;
373
374 SdrObjKind GetTextKind() const { return meTextKind; }
375
376 // #i121917#
377 virtual bool HasText() const override;
378
379 bool IsTextEditActive() const { return mpEditingOutliner != nullptr; }
380
382 virtual SdrText* getActiveText() const;
383
385 virtual SdrText* getText( sal_Int32 nIndex ) const override;
386
388 virtual sal_Int32 getTextCount() const override;
389
391 virtual bool IsReallyEdited() const;
392
394 virtual void setActiveText( sal_Int32 nIndex );
395
397 virtual sal_Int32 CheckTextHit(const Point& rPnt) const;
398
399 void SetDisableAutoWidthOnDragging(bool bOn) { mbDisableAutoWidthOnDragging=bOn; }
400 void NbcSetText(const OUString& rStr);
401 void SetText(const OUString& rStr);
402 void NbcSetText(SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat);
403 void SetText(SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat);
404
405 // FitToSize and Fontwork are not taken into account in GetTextSize()!
406 virtual const Size& GetTextSize() const;
407 void FitFrameToTextSize();
408
409 double GetFontScale() const;
410 double GetSpacingScale() const;
411
412 // Simultaneously sets the text into the Outliner (possibly
413 // the one of the EditOutliner) and sets the PaperSize.
414 virtual void TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRect, bool bNoEditText,
415 tools::Rectangle* pAnchorRect, bool bLineWidth = true ) const;
416 // Takes writing direction into account when adjusting the rectangle
417 void AdjustRectToTextDistance(tools::Rectangle& rAnchorRect) const;
418 virtual void TakeTextAnchorRect(::tools::Rectangle& rAnchorRect) const;
419 const GeoStat& GetGeoStat() const { return maGeo; }
420
421 // get corner radius
422 tools::Long GetEckenradius() const;
423 virtual bool IsAutoGrowHeight() const;
424 tools::Long GetMinTextFrameHeight() const;
425 tools::Long GetMaxTextFrameHeight() const;
426 virtual bool IsAutoGrowWidth() const;
427 tools::Long GetMinTextFrameWidth() const;
428 tools::Long GetMaxTextFrameWidth() const;
429
430 css::drawing::TextFitToSizeType GetFitToSize() const;
431 const tools::Rectangle &GetGeoRect() const;
432
433 // check if it's a TextFontwork
434 virtual bool IsFontwork() const;
435
436 // should the Fontwork contour be hidden?
437 bool IsHideContour() const;
438
439 // text flow within contour
440 bool IsContourTextFrame() const;
441
442 SdrTextHorzAdjust GetTextHorizontalAdjust(const SfxItemSet& rSet) const;
443 SdrTextHorzAdjust GetTextHorizontalAdjust() const;
444
447
449 tools::Long GetTextLeftDistance() const;
451 tools::Long GetTextRightDistance() const;
453 tools::Long GetTextUpperDistance() const;
455 tools::Long GetTextLowerDistance() const;
456 SdrTextAniKind GetTextAniKind() const;
457 SdrTextAniDirection GetTextAniDirection() const;
458
459 bool HasTextColumnsNumber() const;
460 sal_Int16 GetTextColumnsNumber() const;
461 void SetTextColumnsNumber(sal_Int16 nColumns);
462 bool HasTextColumnsSpacing() const;
463 sal_Int32 GetTextColumnsSpacing() const;
464 void SetTextColumnsSpacing(sal_Int32 nSpacing);
465
466 // react on model/page change
467 virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override;
468
469 virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
470 virtual SdrObjKind GetObjIdentifier() const override;
471
472 // needed to determine text anchor area
473 virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const;
474 virtual OUString TakeObjNameSingul() const override;
475 virtual OUString TakeObjNamePlural() const override;
476 virtual rtl::Reference<SdrObject> CloneSdrObject(SdrModel& rTargetModel) const override;
477 virtual basegfx::B2DPolyPolygon TakeXorPoly() const override;
478 virtual basegfx::B2DPolyPolygon TakeContour() const override;
479 virtual void RecalcSnapRect() override;
480 virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override;
481 virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
482 virtual const tools::Rectangle& GetLogicRect() const override;
483 virtual Degree100 GetRotateAngle() const override;
484 virtual Degree100 GetShearAngle(bool bVertical = false) const override;
485
486 virtual sal_uInt32 GetSnapPointCount() const override;
487 virtual Point GetSnapPoint(sal_uInt32 i) const override;
488
489 virtual sal_uInt32 GetHdlCount() const override;
490 virtual void AddToHdlList(SdrHdlList& rHdlList) const override;
491
492 // special drag methods
493 virtual bool hasSpecialDrag() const override;
494 virtual bool applySpecialDrag(SdrDragStat& rDrag) override;
495 virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override;
496
497 virtual bool BegCreate(SdrDragStat& rStat) override;
498 virtual bool MovCreate(SdrDragStat& rStat) override;
499 virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override;
500 virtual bool BckCreate(SdrDragStat& rStat) override;
501 virtual void BrkCreate(SdrDragStat& rStat) override;
502 virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override;
503 virtual PointerStyle GetCreatePointer() const override;
504
505 virtual void NbcMove(const Size& rSiz) override;
506 virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
507 virtual void NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs) override;
508 virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override;
509 virtual void NbcShear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear) override;
510
511 virtual bool HasTextEdit() const override;
512 // returns true if TextEditMode started
513 virtual bool BegTextEdit(SdrOutliner& rOutl);
514 virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools::Rectangle* pViewInit, tools::Rectangle* pViewMin) const;
515 virtual void EndTextEdit(SdrOutliner& rOutl);
516 virtual EEAnchorMode GetOutlinerViewAnchorMode() const;
517
518 virtual void NbcSetOutlinerParaObject(std::optional<OutlinerParaObject> pTextObject) override;
519 void NbcSetOutlinerParaObjectForText( std::optional<OutlinerParaObject> pTextObject, SdrText* pText );
520 virtual OutlinerParaObject* GetOutlinerParaObject() const override;
521 bool CanCreateEditOutlinerParaObject() const;
522 std::optional<OutlinerParaObject> CreateEditOutlinerParaObject() const;
523
524 virtual void NbcReformatText() override;
525
526 virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos,
527 bool bEdit, std::optional<Color>& rpTxtColor, std::optional<Color>& rpFldColor, std::optional<FontLineStyle>& rpFldLineStyle, OUString& rRet) const;
528
529 virtual rtl::Reference<SdrObject> DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
530
531 void SetTextEditOutliner(SdrOutliner* pOutl) { mpEditingOutliner = pOutl; }
532
549 void SetupOutlinerFormatting( SdrOutliner& rOutl, tools::Rectangle& rPaintRect ) const;
550
563 void UpdateOutlinerFormatting( SdrOutliner& rOutl, tools::Rectangle& rPaintRect ) const;
565 virtual bool IsVerticalWriting() const;
566 virtual void SetVerticalWriting(bool bVertical);
567 bool IsTopToBottom() const;
568
570 virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus );
571
573 void onChainingEvent();
574
575
576 // transformation interface for StarOfficeAPI. This implements support for
577 // homogen 3x3 matrices containing the transformation of the SdrObject. At the
578 // moment it contains a shearX, rotation and translation, but for setting all linear
579 // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
580
581
582 // gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
583 // with the base geometry and returns TRUE. Otherwise it returns FALSE.
584 virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const override;
585
586 // sets the base geometry of the object using infos contained in the homogen 3x3 matrix.
587 // If it's an SdrPathObj it will use the provided geometry information. The Polygon has
588 // to use (0,0) as upper left and will be scaled to the given size in the matrix.
589 virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon) override;
590
591 // #103836# iterates over the paragraphs of a given SdrObject and removes all
592 // hard set character attributes with the which ids contained in the
593 // given vector
594 void RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>& rCharWhichIds );
595
596 // Get necessary data for text scroll animation. ATM base it on a Text-Metafile and a
597 // painting rectangle. Rotation is taken from the object.
598 GDIMetaFile* GetTextScrollMetaFileAndRectangle(tools::Rectangle& rScrollRectangle, tools::Rectangle& rPaintRectangle);
599
600 // Access to TextAnimationAllowed flag
601 void SetTextAnimationAllowed(bool bNew);
602
603 // #i8824#
604 // Set single item at the local ItemSet. *Does not use* AllowItemChange(),
605 // ItemChange(), PostItemChange() and ItemSetChanged() calls.
606 void SetObjectItemNoBroadcast(const SfxPoolItem& rItem);
607 double GetCameraZRotation() const;
608
609public:
610
611 // text primitive decomposition helpers
612 void impDecomposeContourTextPrimitive(
614 const drawinglayer::primitive2d::SdrContourTextPrimitive2D& rSdrContourTextPrimitive,
615 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
616 void impDecomposePathTextPrimitive(
618 const drawinglayer::primitive2d::SdrPathTextPrimitive2D& rSdrPathTextPrimitive,
619 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
620 void impDecomposeBlockTextPrimitive(
622 const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive,
623 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
624 void impDecomposeAutoFitTextPrimitive(
626 const drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D& rSdrAutofitTextPrimitive,
627 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
628 void impDecomposeStretchTextPrimitive(
630 const drawinglayer::primitive2d::SdrStretchTextPrimitive2D& rSdrStretchTextPrimitive,
631 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
632 void impDecomposeChainedTextPrimitive(
634 const drawinglayer::primitive2d::SdrChainedTextPrimitive2D& rSdrChainedTextPrimitive,
635 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
636 void impHandleChainingEventsDuringDecomposition(SdrOutliner &rOutliner) const;
637
638 // timing generators
639 void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const;
640 void impGetScrollTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList, double fFrameLength, double fTextLength) const;
641
642 // Direct decomposer for text visualization when you already have a prepared
643 // Outliner containing all the needed information
644 static void impDecomposeBlockTextPrimitiveDirect(
646 SdrOutliner& rOutliner,
647 const basegfx::B2DHomMatrix& rNewTransformA,
648 const basegfx::B2DHomMatrix& rNewTransformB,
649 const basegfx::B2DRange& rClipRange);
650
655 static bool HasTextImpl( SdrOutliner const * pOutliner );
656
657 virtual bool IsSdrTextObj() const final { return true; }
658
659 friend class ::SdrTextObjTest;
660};
661
662/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
The transformation of a rectangle into a polygon, by using angle parameters from GeoStat.
Definition: svdtrans.hxx:201
virtual std::unique_ptr< SdrObjUserData > Clone(SdrObject *pObj1) const override
Definition: svdotxln.cxx:110
rtl_TextEncoding meCharSet
Definition: svdotext.hxx:106
tools::SvRef< ImpSdrObjTextLink > mpLink
Definition: svdotext.hxx:105
virtual ~ImpSdrObjTextLinkUserData() override
Definition: svdotxln.cxx:106
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: svdoattr.cxx:32
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:174
Provides information about various ZObject properties.
Definition: svdobj.hxx:196
User data of a drawing object, e.g.
Definition: svdobj.hxx:152
Abstract DrawObject.
Definition: svdobj.hxx:260
virtual bool BckCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1417
virtual void RecalcSnapRect()
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: svdobj.cxx:1658
virtual Degree100 GetShearAngle(bool bVertical=false) const
Definition: svdobj.cxx:1710
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const
Definition: svdobj.cxx:2639
virtual Degree100 GetRotateAngle() const
Definition: svdobj.cxx:1705
virtual bool HasText() const
Definition: svdobj.cxx:3083
virtual void NbcSetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
Definition: svdobj.cxx:1829
virtual rtl::Reference< SdrObject > getFullDragClone() const
Definition: svdobj.cxx:1341
virtual void NbcSetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1677
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
Definition: svdobj.cxx:1445
virtual OUString TakeObjNamePlural() const
Definition: svdobj.cxx:1097
virtual bool BegCreate(SdrDragStat &rStat)
Every object must be able to create itself interactively.
Definition: svdobj.cxx:1383
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
Definition: svdobj.cxx:1131
virtual void RestoreGeoData(const SdrObjGeoData &rGeo)
Definition: svdobj.cxx:1923
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const
Polygon dragged by the user when creating the object.
Definition: svdobj.cxx:1422
virtual OutlinerParaObject * GetOutlinerParaObject() const
Definition: svdobj.cxx:1833
virtual sal_uInt32 GetSnapPointCount() const
snap to special points of an Object (polygon points, center of circle)
Definition: svdobj.cxx:1715
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage)
Definition: svdobj.cxx:523
virtual void SaveGeoData(SdrObjGeoData &rGeo) const
Definition: svdobj.cxx:1900
virtual bool MovCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1393
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1667
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1511
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1524
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact()
Definition: svdobj.cxx:256
virtual bool HasTextEdit() const
Definition: svdobj.cxx:1753
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon)
Definition: svdobj.cxx:3008
virtual PointerStyle GetCreatePointer() const
get the cursor/pointer that signals creating this object
Definition: svdobj.cxx:1433
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const
Definition: svdobj.cxx:1370
virtual SdrObjKind GetObjIdentifier() const
Definition: svdobj.cxx:626
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const =0
virtual sal_uInt32 GetHdlCount() const
Via GetHdlCount the number of Handles can be retrieved.
Definition: svdobj.cxx:1226
virtual basegfx::B2DPolyPolygon TakeContour() const
contour for TextToContour
Definition: svdobj.cxx:1140
virtual void NbcReformatText()
Definition: svdobj.cxx:1838
virtual OUString TakeObjNameSingul() const
Definition: svdobj.cxx:1087
virtual void AddToHdlList(SdrHdlList &rHdlList) const
Definition: svdobj.cxx:1231
virtual bool applySpecialDrag(SdrDragStat &rDrag)
Definition: svdobj.cxx:1358
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd)
Definition: svdobj.cxx:1403
virtual void BrkCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1413
tools::Rectangle ImpDragCalcRect(const SdrDragStat &rDrag) const
Definition: svdobj.cxx:1261
virtual bool hasSpecialDrag() const
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdobj.cxx:1331
virtual std::unique_ptr< SdrObjGeoData > NewGeoData() const
A derived class must override these 3 methods if it has own geometric data that must be saved for Und...
Definition: svdobj.cxx:1895
virtual Point GetSnapPoint(sal_uInt32 i) const
Definition: svdobj.cxx:1720
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const
Definition: svdobj.cxx:2981
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdobj.cxx:1439
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
Definition: svdobj.cxx:631
virtual const tools::Rectangle & GetLogicRect() const
Definition: svdobj.cxx:1672
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs)=0
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:379
tools::Rectangle maRect
Definition: svdotext.hxx:91
void SetTextEditOutliner(SdrOutliner *pOutl)
Definition: svdotext.hxx:531
GeoStat maGeo
Definition: svdotext.hxx:196
const Point & GetTextEditOffset() const
Definition: svdotext.hxx:227
tools::Rectangle const & getRectangle() const
Definition: svdotext.hxx:170
Point maTextEditOffset
Definition: svdotext.hxx:221
bool IsTextEditActive() const
Definition: svdotext.hxx:379
void moveRectangle(sal_Int32 nXDelta, sal_Int32 nYDelta)
Definition: svdotext.hxx:185
bool mbInEditMode
Definition: svdotext.hxx:246
void SetTextEditOffset(const Point &rNew)
Definition: svdotext.hxx:228
bool IsInEditMode() const
Definition: svdotext.hxx:339
SdrOutliner * mpEditingOutliner
Definition: svdotext.hxx:207
void moveRectanglePosition(sal_Int32 nX, sal_Int32 nY)
Definition: svdotext.hxx:190
tools::Rectangle maRectangle
Definition: svdotext.hxx:168
bool mbInDownScale
Definition: svdotext.hxx:262
bool mbTextAnimationAllowed
Definition: svdotext.hxx:259
rtl::Reference< SdrText > mxText
Definition: svdotext.hxx:199
bool IsLinkedText() const
Definition: svdotext.hxx:352
bool mbDisableAutoWidthOnDragging
Definition: svdotext.hxx:256
void SetTextSizeDirty()
Definition: svdotext.hxx:301
bool mbTextSizeDirty
Definition: svdotext.hxx:244
SdrObjKind GetTextKind() const
Definition: svdotext.hxx:374
virtual bool IsSdrTextObj() const final
Definition: svdotext.hxx:657
bool IsOutlText() const
Definition: svdotext.hxx:360
void setRectangleSize(sal_Int32 nWidth, sal_Int32 nHeight)
Definition: svdotext.hxx:180
SdrObjKind meTextKind
Definition: svdotext.hxx:215
bool IsTextFrame() const
Definition: svdotext.hxx:359
const GeoStat & GetGeoStat() const
Definition: svdotext.hxx:419
bool mbNoShear
Definition: svdotext.hxx:243
void SetDisableAutoWidthOnDragging(bool bOn)
Definition: svdotext.hxx:399
SVX_DLLPRIVATE SdrOutliner * GetTextEditOutliner() const
Definition: svdotext.hxx:143
Size maTextSize
Definition: svdotext.hxx:202
void setRectangle(tools::Rectangle const &rRectangle)
Definition: svdotext.hxx:175
bool mbTextFrame
Definition: svdotext.hxx:242
void ForceOutlinerParaObject(OutlinerMode nOutlMode)
Definition: svdtext.cxx:96
This interface provides access to text object(s) in an SdrObject.
virtual sal_Int32 getTextCount() const =0
Return the number of texts available for this object.
virtual SdrText * getText(sal_Int32 nIndex) const =0
Return the nth available text.
void SetSize(const Size &)
void SetPos(const Point &rPoint)
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
virtual void SetText(const OUString &rStr) override
EETextFormat
EEAnchorMode
TextVerticalAdjust GetTextVerticalAdjust(sal_Int32 nToken)
float GetTextSize(std::u16string_view sValue)
long Long
PointerStyle
SdrTextAniDirection
Definition: sdtaditm.hxx:30
SdrTextVertAdjust
Definition: sdtaitm.hxx:29
SdrTextHorzAdjust
Definition: sdtaitm.hxx:53
SdrTextAniKind
Animation type for text frame.
Definition: sdtakitm.hxx:29
SfxStyleFamily
SdrObjKind
Definition: svdobjkind.hxx:25
@ OutlineText
TitleText, special text object for StarDraw.
@ TitleText
text object
constexpr const sal_uInt16 SDRUSERDATA_OBJTEXTLINK
Definition: svdotext.hxx:84
SdrCreateCmd
Definition: svdtypes.hxx:27
#define SVX_DLLPRIVATE
Definition: svxdllapi.h:30
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35