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
170 // The GeoStat contains the rotation and shear angles
172
173 // this is the active text
175
176 // This contains the dimensions of the text
178
179 // an Outliner*, so that
180 // 1. the TextObj won't be edited simultaneously by multiple views, and
181 // 2. when streaming while editing Flush() can be done
183
184 // Possible values for eTextKind are:
185 // SdrObjKind::Text regular text frame
186 // SdrObjKind::TitleText TitleText for presentations
187 // SdrObjKind::OutlineText OutlineText for presentations
188 // eTextKind only has meaning when mbTextFrame=true, since otherwise
189 // we're dealing with a labeled graphical object
191
192 // For text editing in SW Header/Footer it is necessary to be
193 // able to set an offset for the text edit to allow text editing at the
194 // position of the virtual object. This offset is used when setting up
195 // and maintaining the OutlinerView.
197
198 virtual rtl::Reference<SdrObject> getFullDragClone() const override;
199
200
201public:
202 const Point& GetTextEditOffset() const { return maTextEditOffset; }
203 void SetTextEditOffset(const Point& rNew) { maTextEditOffset = rNew; }
204
205protected:
206 bool mbIsUnchainableClone = false;
207
208 // the successor in a chain
209 SdrTextObj* mpNextInChain = nullptr;
210 SdrTextObj* mpPrevInChain = nullptr;
211
212 // For labeled graphical objects bTextFrame is FALSE. The block of text
213 // will then be centered horizontally and vertically on aRect.
214 // For mbTextFrame=true the text will be formatted into aRect.
215 // The actual text frame is realized by an SdrRectObj with
216 // mbTextFrame=true.
217 bool mbTextFrame : 1;
218 bool mbNoShear : 1; // disable shearing (->graphic+Ole+TextFrame)
220
221 bool mbInEditMode : 1; // Is this text object in edit mode?
222
223 // For objects with free size (flow text). The flag is set by the
224 // application on create. If the object width is later resized,
225 // AutoGrowWidth will be disabled (set to sal_False). This flag will
226 // then also be set to sal_False, so that the object behaves like a
227 // normal text object.
228 // Width resize can result from:
229 // - Interactive Resize in single or multiple selections
230 // - position/size dialog
232
233 // Flag for allowing text animation. Default is sal_true.
235
236 // flag for preventing recursive onEditOutlinerStatusEvent calls
238
239 SdrOutliner& ImpGetDrawOutliner() const;
240
241private:
242 // #101029#: Extracted from ImpGetDrawOutliner()
243 SVX_DLLPRIVATE void ImpInitDrawOutliner( SdrOutliner& rOutl ) const;
244 // #101029#: Extracted from Paint()
245 SVX_DLLPRIVATE void ImpSetupDrawOutlinerForPaint( bool bContourFrame,
246 SdrOutliner& rOutliner,
247 tools::Rectangle& rTextRect,
248 tools::Rectangle& rAnchorRect,
249 tools::Rectangle& rPaintRect,
250 Fraction& aFitXCorrection ) const;
251 void ImpAutoFitText( SdrOutliner& rOutliner ) const;
252 void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting ) const;
253 SVX_DLLPRIVATE rtl::Reference<SdrObject> ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const;
254 SVX_DLLPRIVATE void ImpRegisterLink();
255 SVX_DLLPRIVATE void ImpDeregisterLink();
256 SVX_DLLPRIVATE ImpSdrObjTextLinkUserData* GetLinkUserData() const;
257
259 static void AppendFamilyToStyleName(OUString& styleName, SfxStyleFamily family);
260
262 static SfxStyleFamily ReadFamilyFromStyleName(std::u16string_view styleName);
263
264protected:
265 bool ImpCanConvTextToCurve() const;
266 rtl::Reference<SdrPathObj> ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier) const;
267 rtl::Reference<SdrObject> ImpConvertAddText(rtl::Reference<SdrObject> pObj, bool bBezier) const;
268 void ImpSetTextStyleSheetListeners();
269 static void ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXCorrection);
270 static void ImpJustifyRect(tools::Rectangle& rRect);
271 void ImpCheckShear();
272 tools::Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
273 void ImpSetTextEditParams() const;
274 void SetTextSizeDirty() { mbTextSizeDirty = true; }
275
276 // rAnchorRect is InOut-Parameter!
277 void ImpSetContourPolygon( SdrOutliner& rOutliner, tools::Rectangle const & rAnchorRect, bool bLineWidth ) const;
278
279 virtual std::unique_ptr<SdrObjGeoData> NewGeoData() const override;
280 virtual void SaveGeoData(SdrObjGeoData& rGeo) const override;
281 virtual void RestoreGeoData(const SdrObjGeoData& rGeo) override;
282 void NbcSetEckenradius(tools::Long nRad);
283
284 // #115391# new method for SdrObjCustomShape and SdrTextObj to correctly handle and set
285 // SdrTextMinFrameWidthItem and SdrTextMinFrameHeightItem based on all settings, necessities
286 // and object sizes
287 virtual void AdaptTextMinSize();
288
289 // constructors for labeled graphical objects
290 SdrTextObj(SdrModel& rSdrModel);
292 SdrModel& rSdrModel,
293 const tools::Rectangle& rNewRect);
294
295 // constructors for text frames
297 SdrModel& rSdrModel,
298 SdrObjKind eNewTextKind);
300 SdrModel& rSdrModel,
301 SdrObjKind eNewTextKind,
302 const tools::Rectangle& rNewRect);
303
304 // copy constructor
305 SdrTextObj(SdrModel& rSdrModel, SdrTextObj const & rSource);
306
307 // protected destructor
308 virtual ~SdrTextObj() override;
309
310public:
311
312 bool IsInEditMode() const { return mbInEditMode; }
313
314 // Currently ASCII and RTF are supported and the differentiation is done
315 // internally.
316 // rFilterName has no meaning and must be empty
317 // Normally the application only has to call SetTextLink() - the
318 // remainder is automatic (SfxLinkManager).
319 // The LoadText() method can also be used to load a file into a text
320 // object (without linking.)
321 // TextLinks can't be edited (if needed later could be ReadOnly).
322 // Setting attributes can only be done on the text frame.
323 void SetTextLink(const OUString& rFileName, const OUString& rFilterName);
324 void ReleaseTextLink();
325 bool IsLinkedText() const { return m_pPlusData != nullptr && GetLinkUserData() != nullptr; }
326 bool ReloadLinkedText(bool bForceLoad);
327 bool LoadText(const OUString& rFileName, rtl_TextEncoding eCharSet);
328
329 virtual bool AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool bHgt = true, bool bWdt = true) const;
330 virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true);
331 virtual bool AdjustTextFrameWidthAndHeight();
332 bool IsTextFrame() const { return mbTextFrame; }
333 bool IsOutlText() const { return mbTextFrame && (meTextKind==SdrObjKind::OutlineText || meTextKind==SdrObjKind::TitleText); }
335 bool IsAutoFit() const;
337 bool IsFitToSize() const;
338
339 // Chaining
340 SdrTextObj *GetNextLinkInChain() const;
341 void SetNextLinkInChain(SdrTextObj *);
342 SdrTextObj *GetPrevLinkInChain() const;
343 bool IsChainable() const;
344 bool GetPreventChainable() const;
345 TextChain *GetTextChain() const;
346
347 SdrObjKind GetTextKind() const { return meTextKind; }
348
349 // #i121917#
350 virtual bool HasText() const override;
351
352 bool IsTextEditActive() const { return mpEditingOutliner != nullptr; }
353
355 virtual SdrText* getActiveText() const;
356
358 virtual SdrText* getText( sal_Int32 nIndex ) const override;
359
361 virtual sal_Int32 getTextCount() const override;
362
364 virtual bool IsReallyEdited() const;
365
367 virtual void setActiveText( sal_Int32 nIndex );
368
370 virtual sal_Int32 CheckTextHit(const Point& rPnt) const;
371
372 void SetDisableAutoWidthOnDragging(bool bOn) { mbDisableAutoWidthOnDragging=bOn; }
373 void NbcSetText(const OUString& rStr);
374 void SetText(const OUString& rStr);
375 void NbcSetText(SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat);
376 void SetText(SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat);
377
378 // FitToSize and Fontwork are not taken into account in GetTextSize()!
379 virtual const Size& GetTextSize() const;
380 void FitFrameToTextSize();
381 sal_uInt16 GetFontScaleY() const;
382
383 // Simultaneously sets the text into the Outliner (possibly
384 // the one of the EditOutliner) and sets the PaperSize.
385 virtual void TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRect, bool bNoEditText,
386 tools::Rectangle* pAnchorRect, bool bLineWidth = true ) const;
387 // Takes writing direction into account when adjusting the rectangle
388 void AdjustRectToTextDistance(tools::Rectangle& rAnchorRect) const;
389 virtual void TakeTextAnchorRect(::tools::Rectangle& rAnchorRect) const;
390 const GeoStat& GetGeoStat() const { return maGeo; }
391
392 // get corner radius
393 tools::Long GetEckenradius() const;
394 virtual bool IsAutoGrowHeight() const;
395 tools::Long GetMinTextFrameHeight() const;
396 tools::Long GetMaxTextFrameHeight() const;
397 virtual bool IsAutoGrowWidth() const;
398 tools::Long GetMinTextFrameWidth() const;
399 tools::Long GetMaxTextFrameWidth() const;
400
401 css::drawing::TextFitToSizeType GetFitToSize() const;
402 const tools::Rectangle &GetGeoRect() const;
403
404 // check if it's a TextFontwork
405 virtual bool IsFontwork() const;
406
407 // should the Fontwork contour be hidden?
408 bool IsHideContour() const;
409
410 // text flow within contour
411 bool IsContourTextFrame() const;
412
413 SdrTextHorzAdjust GetTextHorizontalAdjust(const SfxItemSet& rSet) const;
414 SdrTextHorzAdjust GetTextHorizontalAdjust() const;
415
418
420 tools::Long GetTextLeftDistance() const;
422 tools::Long GetTextRightDistance() const;
424 tools::Long GetTextUpperDistance() const;
426 tools::Long GetTextLowerDistance() const;
427 SdrTextAniKind GetTextAniKind() const;
428 SdrTextAniDirection GetTextAniDirection() const;
429
430 bool HasTextColumnsNumber() const;
431 sal_Int16 GetTextColumnsNumber() const;
432 void SetTextColumnsNumber(sal_Int16 nColumns);
433 bool HasTextColumnsSpacing() const;
434 sal_Int32 GetTextColumnsSpacing() const;
435 void SetTextColumnsSpacing(sal_Int32 nSpacing);
436
437 // react on model/page change
438 virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override;
439
440 virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
441 virtual SdrObjKind GetObjIdentifier() const override;
442
443 // needed to determine text anchor area
444 virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const;
445 virtual OUString TakeObjNameSingul() const override;
446 virtual OUString TakeObjNamePlural() const override;
447 virtual rtl::Reference<SdrObject> CloneSdrObject(SdrModel& rTargetModel) const override;
448 virtual basegfx::B2DPolyPolygon TakeXorPoly() const override;
449 virtual basegfx::B2DPolyPolygon TakeContour() const override;
450 virtual void RecalcSnapRect() override;
451 virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override;
452 virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
453 virtual const tools::Rectangle& GetLogicRect() const override;
454 virtual Degree100 GetRotateAngle() const override;
455 virtual Degree100 GetShearAngle(bool bVertical = false) const override;
456
457 virtual sal_uInt32 GetSnapPointCount() const override;
458 virtual Point GetSnapPoint(sal_uInt32 i) const override;
459
460 virtual sal_uInt32 GetHdlCount() const override;
461 virtual void AddToHdlList(SdrHdlList& rHdlList) const override;
462
463 // special drag methods
464 virtual bool hasSpecialDrag() const override;
465 virtual bool applySpecialDrag(SdrDragStat& rDrag) override;
466 virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override;
467
468 virtual bool BegCreate(SdrDragStat& rStat) override;
469 virtual bool MovCreate(SdrDragStat& rStat) override;
470 virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override;
471 virtual bool BckCreate(SdrDragStat& rStat) override;
472 virtual void BrkCreate(SdrDragStat& rStat) override;
473 virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override;
474 virtual PointerStyle GetCreatePointer() const override;
475
476 virtual void NbcMove(const Size& rSiz) override;
477 virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
478 virtual void NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs) override;
479 virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override;
480 virtual void NbcShear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear) override;
481
482 virtual bool HasTextEdit() const override;
483 // returns true if TextEditMode started
484 virtual bool BegTextEdit(SdrOutliner& rOutl);
485 virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools::Rectangle* pViewInit, tools::Rectangle* pViewMin) const;
486 virtual void EndTextEdit(SdrOutliner& rOutl);
487 virtual EEAnchorMode GetOutlinerViewAnchorMode() const;
488
489 virtual void NbcSetOutlinerParaObject(std::optional<OutlinerParaObject> pTextObject) override;
490 void NbcSetOutlinerParaObjectForText( std::optional<OutlinerParaObject> pTextObject, SdrText* pText );
491 virtual OutlinerParaObject* GetOutlinerParaObject() const override;
492 bool CanCreateEditOutlinerParaObject() const;
493 std::optional<OutlinerParaObject> CreateEditOutlinerParaObject() const;
494
495 virtual void NbcReformatText() override;
496
497 virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos,
498 bool bEdit, std::optional<Color>& rpTxtColor, std::optional<Color>& rpFldColor, OUString& rRet) const;
499
500 virtual rtl::Reference<SdrObject> DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
501
502 void SetTextEditOutliner(SdrOutliner* pOutl) { mpEditingOutliner = pOutl; }
503
520 void SetupOutlinerFormatting( SdrOutliner& rOutl, tools::Rectangle& rPaintRect ) const;
521
534 void UpdateOutlinerFormatting( SdrOutliner& rOutl, tools::Rectangle& rPaintRect ) const;
536 virtual bool IsVerticalWriting() const;
537 virtual void SetVerticalWriting(bool bVertical);
538 bool IsTopToBottom() const;
539
541 virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus );
542
544 void onChainingEvent();
545
546
547 // transformation interface for StarOfficeAPI. This implements support for
548 // homogen 3x3 matrices containing the transformation of the SdrObject. At the
549 // moment it contains a shearX, rotation and translation, but for setting all linear
550 // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
551
552
553 // gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
554 // with the base geometry and returns TRUE. Otherwise it returns FALSE.
555 virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const override;
556
557 // sets the base geometry of the object using infos contained in the homogen 3x3 matrix.
558 // If it's an SdrPathObj it will use the provided geometry information. The Polygon has
559 // to use (0,0) as upper left and will be scaled to the given size in the matrix.
560 virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon) override;
561
562 // #103836# iterates over the paragraphs of a given SdrObject and removes all
563 // hard set character attributes with the which ids contained in the
564 // given vector
565 void RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>& rCharWhichIds );
566
567 // Get necessary data for text scroll animation. ATM base it on a Text-Metafile and a
568 // painting rectangle. Rotation is taken from the object.
569 GDIMetaFile* GetTextScrollMetaFileAndRectangle(tools::Rectangle& rScrollRectangle, tools::Rectangle& rPaintRectangle);
570
571 // Access to TextAnimationAllowed flag
572 void SetTextAnimationAllowed(bool bNew);
573
574 // #i8824#
575 // Set single item at the local ItemSet. *Does not use* AllowItemChange(),
576 // ItemChange(), PostItemChange() and ItemSetChanged() calls.
577 void SetObjectItemNoBroadcast(const SfxPoolItem& rItem);
578 double GetCameraZRotation() const;
579
580public:
581
582 // text primitive decomposition helpers
583 void impDecomposeContourTextPrimitive(
585 const drawinglayer::primitive2d::SdrContourTextPrimitive2D& rSdrContourTextPrimitive,
586 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
587 void impDecomposePathTextPrimitive(
589 const drawinglayer::primitive2d::SdrPathTextPrimitive2D& rSdrPathTextPrimitive,
590 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
591 void impDecomposeBlockTextPrimitive(
593 const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive,
594 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
595 void impDecomposeAutoFitTextPrimitive(
597 const drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D& rSdrAutofitTextPrimitive,
598 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
599 void impDecomposeStretchTextPrimitive(
601 const drawinglayer::primitive2d::SdrStretchTextPrimitive2D& rSdrStretchTextPrimitive,
602 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
603 void impDecomposeChainedTextPrimitive(
605 const drawinglayer::primitive2d::SdrChainedTextPrimitive2D& rSdrChainedTextPrimitive,
606 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
607 void impHandleChainingEventsDuringDecomposition(SdrOutliner &rOutliner) const;
608
609 // timing generators
610 void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const;
611 void impGetScrollTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList, double fFrameLength, double fTextLength) const;
612
613 // Direct decomposer for text visualization when you already have a prepared
614 // Outliner containing all the needed information
615 static void impDecomposeBlockTextPrimitiveDirect(
617 SdrOutliner& rOutliner,
618 const basegfx::B2DHomMatrix& rNewTransformA,
619 const basegfx::B2DHomMatrix& rNewTransformB,
620 const basegfx::B2DRange& rClipRange);
621
626 static bool HasTextImpl( SdrOutliner const * pOutliner );
627
628 virtual bool IsSdrTextObj() const final { return true; }
629
630 friend class ::SdrTextObjTest;
631};
632
633/* 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:175
Provides information about various ZObject properties.
Definition: svdobj.hxx:197
User data of a drawing object, e.g.
Definition: svdobj.hxx:153
Abstract DrawObject.
Definition: svdobj.hxx:261
virtual bool BckCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1382
virtual void RecalcSnapRect()
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: svdobj.cxx:1661
virtual Degree100 GetShearAngle(bool bVertical=false) const
Definition: svdobj.cxx:1713
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const
Definition: svdobj.cxx:2642
virtual Degree100 GetRotateAngle() const
Definition: svdobj.cxx:1708
virtual bool HasText() const
Definition: svdobj.cxx:3088
virtual void NbcSetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
Definition: svdobj.cxx:1832
virtual rtl::Reference< SdrObject > getFullDragClone() const
Definition: svdobj.cxx:1306
virtual void NbcSetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1680
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
Definition: svdobj.cxx:1410
virtual OUString TakeObjNamePlural() const
Definition: svdobj.cxx:1062
virtual bool BegCreate(SdrDragStat &rStat)
Every object must be able to create itself interactively.
Definition: svdobj.cxx:1348
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
Definition: svdobj.cxx:1096
virtual void RestoreGeoData(const SdrObjGeoData &rGeo)
Definition: svdobj.cxx:1926
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const
Polygon dragged by the user when creating the object.
Definition: svdobj.cxx:1387
virtual OutlinerParaObject * GetOutlinerParaObject() const
Definition: svdobj.cxx:1836
virtual sal_uInt32 GetSnapPointCount() const
snap to special points of an Object (polygon points, center of circle)
Definition: svdobj.cxx:1718
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage)
Definition: svdobj.cxx:523
virtual void SaveGeoData(SdrObjGeoData &rGeo) const
Definition: svdobj.cxx:1903
virtual bool MovCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1358
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1670
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1514
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1527
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact()
Definition: svdobj.cxx:256
virtual bool HasTextEdit() const
Definition: svdobj.cxx:1756
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon)
Definition: svdobj.cxx:3013
virtual PointerStyle GetCreatePointer() const
get the cursor/pointer that signals creating this object
Definition: svdobj.cxx:1398
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:1503
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const
Definition: svdobj.cxx:1335
virtual SdrObjKind GetObjIdentifier() const
Definition: svdobj.cxx:626
virtual sal_uInt32 GetHdlCount() const
Via GetHdlCount the number of Handles can be retrieved.
Definition: svdobj.cxx:1191
virtual basegfx::B2DPolyPolygon TakeContour() const
contour for TextToContour
Definition: svdobj.cxx:1105
virtual void NbcReformatText()
Definition: svdobj.cxx:1841
virtual OUString TakeObjNameSingul() const
Definition: svdobj.cxx:1052
virtual void AddToHdlList(SdrHdlList &rHdlList) const
Definition: svdobj.cxx:1196
virtual bool applySpecialDrag(SdrDragStat &rDrag)
Definition: svdobj.cxx:1323
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd)
Definition: svdobj.cxx:1368
virtual void BrkCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1378
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const
Definition: svdobj.cxx:1047
tools::Rectangle ImpDragCalcRect(const SdrDragStat &rDrag) const
Definition: svdobj.cxx:1226
virtual bool hasSpecialDrag() const
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdobj.cxx:1296
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:1898
virtual Point GetSnapPoint(sal_uInt32 i) const
Definition: svdobj.cxx:1723
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const
Definition: svdobj.cxx:2986
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdobj.cxx:1404
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
Definition: svdobj.cxx:631
virtual const tools::Rectangle & GetLogicRect() const
Definition: svdobj.cxx:1675
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:377
tools::Rectangle maRect
Definition: svdotext.hxx:91
void SetTextEditOutliner(SdrOutliner *pOutl)
Definition: svdotext.hxx:502
GeoStat maGeo
Definition: svdotext.hxx:171
const Point & GetTextEditOffset() const
Definition: svdotext.hxx:202
Point maTextEditOffset
Definition: svdotext.hxx:196
bool IsTextEditActive() const
Definition: svdotext.hxx:352
bool mbInEditMode
Definition: svdotext.hxx:221
void SetTextEditOffset(const Point &rNew)
Definition: svdotext.hxx:203
bool IsInEditMode() const
Definition: svdotext.hxx:312
SdrOutliner * mpEditingOutliner
Definition: svdotext.hxx:182
tools::Rectangle maRect
Definition: svdotext.hxx:168
bool mbInDownScale
Definition: svdotext.hxx:237
bool mbTextAnimationAllowed
Definition: svdotext.hxx:234
rtl::Reference< SdrText > mxText
Definition: svdotext.hxx:174
bool IsLinkedText() const
Definition: svdotext.hxx:325
bool mbDisableAutoWidthOnDragging
Definition: svdotext.hxx:231
void SetTextSizeDirty()
Definition: svdotext.hxx:274
bool mbTextSizeDirty
Definition: svdotext.hxx:219
SdrObjKind GetTextKind() const
Definition: svdotext.hxx:347
virtual bool IsSdrTextObj() const final
Definition: svdotext.hxx:628
bool IsOutlText() const
Definition: svdotext.hxx:333
SdrObjKind meTextKind
Definition: svdotext.hxx:190
bool IsTextFrame() const
Definition: svdotext.hxx:332
const GeoStat & GetGeoStat() const
Definition: svdotext.hxx:390
bool mbNoShear
Definition: svdotext.hxx:218
void SetDisableAutoWidthOnDragging(bool bOn)
Definition: svdotext.hxx:372
SVX_DLLPRIVATE SdrOutliner * GetTextEditOutliner() const
Definition: svdotext.hxx:143
Size maTextSize
Definition: svdotext.hxx:177
bool mbTextFrame
Definition: svdotext.hxx:217
void ForceOutlinerParaObject(OutlinerMode nOutlMode)
Definition: svdtext.cxx:117
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.
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