update emoji autocorrect entries from po-files
[LibreOffice.git] / include / svx / svdotext.hxx
blobe8f17c656ae8f3e93825dbd608b7a9b1d9d48804
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 #ifndef INCLUDED_SVX_SVDOTEXT_HXX
21 #define INCLUDED_SVX_SVDOTEXT_HXX
23 #include <vcl/field.hxx>
24 #include <svx/itextprovider.hxx>
25 #include <svx/svdoattr.hxx>
26 #include <svx/svdtrans.hxx>
27 #include <tools/datetime.hxx>
28 #include <rsc/rscsfx.hxx>
29 #include <svx/xtextit0.hxx>
30 #include <svx/svdtext.hxx>
31 #include <vector>
32 #include <svx/svxdllapi.h>
33 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
34 #include <svx/svdpagv.hxx>
37 // Vorausdeklarationen
40 class OutlinerParaObject;
41 class SdrOutliner;
42 class SdrTextObj;
43 class SdrTextObjTest;
44 class SvxFieldItem;
45 class ImpSdrObjTextLink;
46 class EditStatus;
48 namespace sdr { namespace properties {
49 class TextProperties;
52 namespace drawinglayer { namespace primitive2d {
53 class SdrContourTextPrimitive2D;
54 class SdrPathTextPrimitive2D;
55 class SdrBlockTextPrimitive2D;
56 class SdrAutoFitTextPrimitive2D;
57 class SdrStretchTextPrimitive2D;
60 namespace drawinglayer { namespace animation {
61 class AnimationEntryList;
64 namespace drawinglayer { namespace geometry {
65 class ViewInformation2D;
68 namespace sdr { namespace table {
69 class Cell;
70 class SdrTableRtfExporter;
71 class SdrTableRTFParser;
75 // Defines
78 #define SDRUSERDATA_OBJTEXTLINK (1)
81 // Hilfsklasse SdrTextObjGeoData
84 class SdrTextObjGeoData : public SdrObjGeoData
86 public:
87 Rectangle aRect;
88 GeoStat aGeo;
92 // Hilfsklasse ImpSdrObjTextLinkUserData
95 class ImpSdrObjTextLinkUserData : public SdrObjUserData
97 friend class SdrTextObj;
98 friend class ImpSdrObjTextLink;
100 SdrTextObj* pObj;
101 OUString aFileName; // Name des referenzierten Dokuments
102 OUString aFilterName; // ggf. ein Filter
103 DateTime aFileDate0; // Unnoetiges neuladen vermeiden
104 ImpSdrObjTextLink* pLink;
105 rtl_TextEncoding eCharSet;
107 public:
108 TYPEINFO_OVERRIDE();
109 ImpSdrObjTextLinkUserData(SdrTextObj* pObj1);
110 virtual ~ImpSdrObjTextLinkUserData();
112 virtual SdrObjUserData* Clone(SdrObject* pObj1) const SAL_OVERRIDE;
115 namespace sdr
117 namespace properties
119 class CustomShapeProperties;
120 class CellProperties;
121 } // end of namespace properties
122 } // end of namespace sdr
125 // SdrTextObj
128 class SVX_DLLPUBLIC SdrTextObj : public SdrAttrObj, public svx::ITextProvider
130 private:
131 // Cell needs access to ImpGetDrawOutliner();
133 friend class sdr::table::Cell;
134 friend class sdr::table::SdrTableRtfExporter;
135 friend class sdr::table::SdrTableRTFParser;
137 // CustomShapeproperties need to access the "bTextFrame" member:
138 friend class sdr::properties::CustomShapeProperties;
140 protected:
141 virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() SAL_OVERRIDE;
142 virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() SAL_OVERRIDE;
144 private:
145 // This method is only allowed for sdr::properties::TextProperties
146 SVX_DLLPRIVATE SdrOutliner* GetTextEditOutliner() const
148 return pEdtOutl;
151 // This method is only allowed for sdr::properties::TextProperties
152 SVX_DLLPRIVATE void SetPortionInfoChecked(bool bNew)
154 bPortionInfoChecked = bNew;
157 // to allow sdr::properties::TextProperties access to SetPortionInfoChecked()
158 // and GetTextEditOutliner()
159 friend class sdr::properties::TextProperties;
160 friend class sdr::properties::CellProperties;
162 friend class ImpSdrObjTextLink;
163 friend class ImpSdrObjTextLinkUserData;
164 friend class SdrPowerPointImport; // fuer PowerPointImport
165 friend class SdrExchangeView; // fuer ImpGetDrawOutliner
166 friend class SdrView; // fuer ImpGetDrawOutliner
167 friend class SdrObjEditView; // fuer TextEdit
168 friend class SdrMeasureObj; // fuer ImpGetDrawOutliner
169 friend class SvxMSDffManager; // fuer ImpGetDrawOutliner
170 friend class SdrObjCustomShape;// fuer ImpGetDrawOutliner
171 friend class SdrText; // fuer ImpGetDrawOutliner
173 protected:
174 // Das aRect ist gleichzeig auch das Rect vom RectObj und CircObj.
175 // Bei bTextFrame=sal_True wird der Text in dieses Rect hineinformatiert.
176 // Bei bTextFrame=sal_False wird der Text am Mittelpunkt des Rect zentriert.
177 Rectangle maRect;
179 // Der GeoStat enthaelt den Drehwinkel und einen Shearwinkel
180 GeoStat aGeo;
182 // this is the active text
183 SdrText* mpText;
185 // Hier merke ich mir die Ausmasse des Textes (n.i.)
186 Size aTextSize;
188 // Ein Outliner*, damit
189 // 1. das TextObj nicht von mehreren Views gleichzeitig editiert und
190 // 2. beim Streamen waerend des Editierens ein Flush() ausgefuehrt
191 // werden kann
192 SdrOutliner* pEdtOutl;
194 // Bei Fontwork muss soviel auf's BoundRect draufgerechnet werden
195 // damit es ausreichend gross ist.
196 Rectangle* pFormTextBoundRect;
198 // Moegliche Werte fuer eTextKind sind:
199 // OBJ_TEXT normaler Textrahmen
200 // OBJ_TEXTEXT Textfortsetzungsrahmen
201 // OBJ_TITLETEXT TitleText fuer StarDraw-Praesentation
202 // OBJ_OUTLINETEXT OutlineText fuer StarDraw-Praesentation
203 // eTextKind hat nur Bedeutung, wenn bTextFrame=sal_True, da es sich sonst
204 // um ein beschriftetes Grafikobjekt handelt.
205 SdrObjKind eTextKind;
207 // #108784#
208 // For text editing in SW Haeder/Footer it is necessary to be
209 // able to set an offset for the text edit to allow text editing at the
210 // position of the virtual object. This offset is used when setting up
211 // and maintaining the OutlinerView.
212 Point maTextEditOffset;
213 public:
214 const Point& GetTextEditOffset() const { return maTextEditOffset; }
215 void SetTextEditOffset(const Point& rNew) { maTextEditOffset = rNew; }
217 protected:
218 // Fuer beschriftete Zeichenobjekte ist bTextFrame=FALSE. Der Textblock
219 // wird dann hoizontal und vertikal an aRect zentriert. Bei bTextFrame=
220 // sal_True wird der Text in aRect hineinformatiert. Der eigentliche Textrahmen
221 // ist durch ein SdrRectObj mit bTextFrame=sal_True realisiert.
222 bool bTextFrame : 1;
223 bool bPortionInfoChecked : 1; // Fuer Optimierung von Textobjekten
224 bool bNoShear : 1; // Obj darf nicht gesheart werden (->Graf+Ole+TextFrame)
225 bool bNoRotate : 1; // Obj darf nicht gedreht werden (->Ole)
226 bool bNoMirror : 1; // Obj darf nicht gespiegelt werden (->Ole,TextFrame)
227 bool bTextSizeDirty : 1;
229 // #101684#
230 bool mbInEditMode : 1; // Is this text object in edit mode?
232 // Fuer Objekt mit freier Groesse im Draw (Mengentext). Das Flag wird vom
233 // der App beim Create gesetzt.
234 // Wenn das Objekt dann spaeter in der Breite resized wird, wird
235 // AutoGrowWidth abgeschaltet (Hart auf sal_False attributiert). Das Flag wird
236 // dann ebenfalls auf sal_False gesetzt, sodass sich das Objekt anschliessend
237 // wie ein normales Textobjekt verhaelt.
238 // Resize in der Breite kann sein:
239 // - Interaktives Resize in Einfach- oder Mehrfachselektion
240 // - Positions+Groesse Dialog
241 bool bDisableAutoWidthOnDragging : 1;
243 // #111096#
244 // Allow text suppression
245 bool mbTextHidden : 1;
247 // #111096#
248 // Flag for allowing text animation. Default is sal_true.
249 bool mbTextAnimationAllowed : 1;
251 // flag for preventing recursive onEditOutlinerStatusEvent calls
252 bool mbInDownScale : 1;
254 SdrOutliner& ImpGetDrawOutliner() const;
256 private:
257 SVX_DLLPRIVATE void ImpCheckMasterCachable();
258 // #101029#: Extracted from ImpGetDrawOutliner()
259 SVX_DLLPRIVATE void ImpInitDrawOutliner( SdrOutliner& rOutl ) const;
260 // #101029#: Extracted from Paint()
261 SVX_DLLPRIVATE void ImpSetupDrawOutlinerForPaint( bool bContourFrame,
262 SdrOutliner& rOutliner,
263 Rectangle& rTextRect,
264 Rectangle& rAnchorRect,
265 Rectangle& rPaintRect,
266 Fraction& aFitXKorreg ) const;
267 void ImpAutoFitText( SdrOutliner& rOutliner ) const;
268 static void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting );
269 SVX_DLLPRIVATE SdrObject* ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const;
270 SVX_DLLPRIVATE void ImpLinkAnmeldung();
271 SVX_DLLPRIVATE void ImpLinkAbmeldung();
272 SVX_DLLPRIVATE ImpSdrObjTextLinkUserData* GetLinkUserData() const;
273 // void ImpCheckItemSetChanges(const SfxItemSet& rAttr);
275 /** Appends the style family to a provided style name */
276 static void AppendFamilyToStyleName(OUString& styleName, SfxStyleFamily family);
278 /** Reads the style family from a style name to which the family has been appended. */
279 static SfxStyleFamily ReadFamilyFromStyleName(const OUString& styleName);
281 protected:
282 bool ImpCanConvTextToCurve() const;
283 SdrObject* ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier, bool bNoSetAttr = false) const;
284 SdrObject* ImpConvertAddText(SdrObject* pObj, bool bBezier) const;
285 void ImpSetTextStyleSheetListeners();
286 static void ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXKorreg);
287 static void ImpJustifyRect(Rectangle& rRect);
288 void ImpCheckShear();
289 Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
290 void ImpSetTextEditParams() const;
291 void SetTextSizeDirty() { bTextSizeDirty=true; }
293 // rAnchorRect ist InOut-Parameter!
294 void ImpSetContourPolygon( SdrOutliner& rOutliner, Rectangle& rAnchorRect, bool bLineWidth ) const;
296 virtual SdrObjGeoData* NewGeoData() const SAL_OVERRIDE;
297 virtual void SaveGeoData(SdrObjGeoData& rGeo) const SAL_OVERRIDE;
298 virtual void RestGeoData(const SdrObjGeoData& rGeo) SAL_OVERRIDE;
299 bool NbcSetEckenradius(long nRad);
301 // #115391# new method for SdrObjCustomShape and SdrTextObj to correctly handle and set
302 // SdrTextMinFrameWidthItem and SdrTextMinFrameHeightItem based on all settings, necessities
303 // and object sizes
304 virtual void AdaptTextMinSize();
306 // Konstruktoren fuer beschriftete Zeichenobjekte
307 SdrTextObj();
308 SdrTextObj(const Rectangle& rNewRect);
310 // Konstruktoren fuer Textrahmen
311 SdrTextObj(SdrObjKind eNewTextKind);
312 SdrTextObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect);
314 virtual ~SdrTextObj();
316 public:
317 TYPEINFO_OVERRIDE();
319 // #101684#
320 bool IsInEditMode() const { return mbInEditMode; }
322 // via eCharSet kann der CharSet der vorliegenden Datei uebergeben werden.
323 // Bei RTL_TEXTENCODING_DONTKNOW wird der CharSet der aktuellen Plattform verwendet.
324 // Derzeit unterstuetzt wird ASCII und RTF wobei ich die Unterscheidung
325 // selbst treffe. rFilterName ist noch ohne Bedeutung und muss leer gelassen
326 // werden.
327 // I.d.R. muss die App nur SetTextLink() rufen - der Rest geschieht von
328 // selbst (SfxLinkManager). Die Methode LoadText() kann ausserdem verwendet
329 // werden, um eine Datei in ein Textobjekt zu laden (ohne Verknuepfung).
330 // TextLinks koennen nicht editiert werden (allenfalls spaeter mal ReadOnly).
331 // Eine Attributierung kann nur am Textrahmen vollzogen werden.
332 void SetTextLink(const OUString& rFileName, const OUString& rFilterName, rtl_TextEncoding eCharSet);
333 void ReleaseTextLink();
334 bool IsLinkedText() const { return pPlusData!=NULL && GetLinkUserData()!=NULL; }
335 bool ReloadLinkedText(bool bForceLoad = false);
336 bool LoadText(const OUString& rFileName, const OUString& rFilterName, rtl_TextEncoding eCharSet);
338 virtual bool AdjustTextFrameWidthAndHeight(Rectangle& rR, bool bHgt = true, bool bWdt = true) const;
339 virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true);
340 virtual bool AdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true);
341 bool IsTextFrame() const { return bTextFrame; }
342 bool IsOutlText() const { return bTextFrame && (eTextKind==OBJ_OUTLINETEXT || eTextKind==OBJ_TITLETEXT); }
343 /// returns true if the PPT autofit of text into shape bounds is enabled. implies IsFitToSize()==false!
344 bool IsAutoFit() const;
345 /// returns true if the old feature for fitting shape content should into shape is enabled. implies IsAutoFit()==false!
346 bool IsFitToSize() const;
347 SdrObjKind GetTextKind() const { return eTextKind; }
349 // #i121917#
350 virtual bool HasText() const SAL_OVERRIDE;
352 bool HasEditText() const;
353 bool IsTextEditActive() const { return (pEdtOutl != 0L); }
355 /** returns the currently active text. */
356 virtual SdrText* getActiveText() const;
358 /** returns the nth available text. */
359 virtual SdrText* getText( sal_Int32 nIndex ) const SAL_OVERRIDE;
361 /** returns the number of texts available for this object. */
362 virtual sal_Int32 getTextCount() const SAL_OVERRIDE;
364 /** returns true only if we are in edit mode and the user actually changed anything */
365 virtual bool IsReallyEdited() const;
367 /** changes the current active text */
368 virtual void setActiveText( sal_Int32 nIndex );
370 /** returns the index of the text that contains the given point or -1 */
371 virtual sal_Int32 CheckTextHit(const Point& rPnt) const;
373 void SetDisableAutoWidthOnDragging(bool bOn) { bDisableAutoWidthOnDragging=bOn; }
374 bool IsDisableAutoWidthOnDragging() { return bDisableAutoWidthOnDragging; }
375 void NbcSetText(const OUString& rStr);
376 void SetText(const OUString& rStr);
377 void NbcSetText(SvStream& rInput, const OUString& rBaseURL, sal_uInt16 eFormat);
378 void SetText(SvStream& rInput, const OUString& rBaseURL, sal_uInt16 eFormat);
380 // FitToSize und Fontwork wird bei GetTextSize() nicht berueksichtigt!
381 virtual const Size& GetTextSize() const;
382 void FitFrameToTextSize();
384 // Gleichzeitig wird der Text in den Outliner gesetzt (ggf.
385 // der des EditOutliners) und die PaperSize gesetzt.
386 virtual void TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, bool bNoEditText = false,
387 Rectangle* pAnchorRect=NULL, bool bLineWidth = true ) const;
388 virtual void TakeTextAnchorRect(::Rectangle& rAnchorRect) const;
389 const GeoStat& GetGeoStat() const { return aGeo; }
391 long GetEckenradius() const;
392 virtual bool IsAutoGrowHeight() const;
393 long GetMinTextFrameHeight() const;
394 long GetMaxTextFrameHeight() const;
395 virtual bool IsAutoGrowWidth() const;
396 long GetMinTextFrameWidth() const;
397 long GetMaxTextFrameWidth() const;
399 SdrFitToSizeType GetFitToSize() const;
400 const Rectangle &GetGeoRect() const;
402 // Feststellen, ob TextFontwork
403 virtual bool IsFontwork() const;
405 // Soll die Fontwork-Kontour versteckt werden?
406 bool IsHideContour() const;
408 // Textfluss innerhalb Kontur
409 bool IsContourTextFrame() const;
411 // Horizontale Textausrichtung
412 SdrTextHorzAdjust GetTextHorizontalAdjust(const SfxItemSet& rSet) const;
413 SdrTextHorzAdjust GetTextHorizontalAdjust() const;
415 // Vertikale Textausrichtung
416 SdrTextVertAdjust GetTextVerticalAdjust(const SfxItemSet& rSet) const;
417 SdrTextVertAdjust GetTextVerticalAdjust() const;
419 /** Left inner spacing to borders */
420 long GetTextLeftDistance() const;
421 /** Right inner spacing to borders */
422 long GetTextRightDistance() const;
423 /** Top inner spacing to borders */
424 long GetTextUpperDistance() const;
425 /** Bottom inner spacing to borders */
426 long GetTextLowerDistance() const;
427 SdrTextAniKind GetTextAniKind() const;
428 SdrTextAniDirection GetTextAniDirection() const;
430 virtual void SetPage(SdrPage* pNewPage) SAL_OVERRIDE;
431 virtual void SetModel(SdrModel* pNewModel) SAL_OVERRIDE;
432 virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const SAL_OVERRIDE;
433 virtual sal_uInt16 GetObjIdentifier() const SAL_OVERRIDE;
435 // Wird zur Bestimmung des Textankerbereichs benoetigt
436 virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
437 virtual OUString TakeObjNameSingul() const SAL_OVERRIDE;
438 virtual OUString TakeObjNamePlural() const SAL_OVERRIDE;
439 virtual SdrTextObj* Clone() const SAL_OVERRIDE;
440 SdrTextObj& operator=(const SdrTextObj& rObj);
441 virtual basegfx::B2DPolyPolygon TakeXorPoly() const SAL_OVERRIDE;
442 virtual basegfx::B2DPolyPolygon TakeContour() const SAL_OVERRIDE;
443 virtual void RecalcSnapRect() SAL_OVERRIDE;
444 virtual void NbcSetSnapRect(const Rectangle& rRect) SAL_OVERRIDE;
445 virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
446 virtual const Rectangle& GetLogicRect() const SAL_OVERRIDE;
447 virtual long GetRotateAngle() const SAL_OVERRIDE;
448 virtual long GetShearAngle(bool bVertical = false) const SAL_OVERRIDE;
450 virtual sal_uInt32 GetSnapPointCount() const SAL_OVERRIDE;
451 virtual Point GetSnapPoint(sal_uInt32 i) const SAL_OVERRIDE;
453 virtual sal_uInt32 GetHdlCount() const SAL_OVERRIDE;
454 virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const SAL_OVERRIDE;
456 // special drag methods
457 virtual bool hasSpecialDrag() const SAL_OVERRIDE;
458 virtual bool applySpecialDrag(SdrDragStat& rDrag) SAL_OVERRIDE;
459 virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const SAL_OVERRIDE;
461 virtual bool BegCreate(SdrDragStat& rStat) SAL_OVERRIDE;
462 virtual bool MovCreate(SdrDragStat& rStat) SAL_OVERRIDE;
463 virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
464 virtual bool BckCreate(SdrDragStat& rStat) SAL_OVERRIDE;
465 virtual void BrkCreate(SdrDragStat& rStat) SAL_OVERRIDE;
466 virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const SAL_OVERRIDE;
467 virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
469 virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
470 virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
471 virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) SAL_OVERRIDE;
472 virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
473 virtual void NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) SAL_OVERRIDE;
475 virtual bool HasTextEdit() const SAL_OVERRIDE;
476 virtual bool BegTextEdit(SdrOutliner& rOutl) SAL_OVERRIDE;
477 virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const;
478 virtual void EndTextEdit(SdrOutliner& rOutl) SAL_OVERRIDE;
479 virtual sal_uInt16 GetOutlinerViewAnchorMode() const;
481 virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject) SAL_OVERRIDE;
482 void NbcSetOutlinerParaObjectForText( OutlinerParaObject* pTextObject, SdrText* pText );
483 virtual OutlinerParaObject* GetOutlinerParaObject() const SAL_OVERRIDE;
484 virtual OutlinerParaObject* GetEditOutlinerParaObject() const;
486 virtual void NbcReformatText() SAL_OVERRIDE;
487 virtual void ReformatText() SAL_OVERRIDE;
489 virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos,
490 bool bEdit, Color*& rpTxtColor, Color*& rpFldColor, OUString& rRet) const;
492 virtual SdrObject* DoConvertToPolyObj(bool bBezier, bool bAddText) const SAL_OVERRIDE;
494 void SetTextEditOutliner(SdrOutliner* pOutl) { pEdtOutl=pOutl; }
496 /** Setup given Outliner equivalently to SdrTextObj::Paint()
498 To setup an arbitrary Outliner in the same way as the draw
499 outliner on SdrTextObj::Paint(). Among others, the paper size,
500 control word and character stretching are initialized, such
501 that the formatting should match the screen representation.
502 The textual content of the outliner is not touched, i.e. no
503 Init() or Clear() is called on the Outliner.
505 @param rOutl
506 The Outliner to setup.
508 @param rPaintRect
509 The region to paint the outliner content into. This is useful
510 to e.g. determine the top, left position of text in shapes.
512 void SetupOutlinerFormatting( SdrOutliner& rOutl, Rectangle& rPaintRect ) const;
514 /** Update given Outliner equivalently to SdrTextObj::Paint()
516 Same functionality as in SetupOutlinerFormatting(), except
517 that the outliner content is not cleared.
519 @param rOutl
520 The Outliner to update.
522 @param rPaintRect
523 The region to paint the outliner content into. This is useful
524 to e.g. determine the top, left position of text in shapes.
526 void UpdateOutlinerFormatting( SdrOutliner& rOutl, Rectangle& rPaintRect ) const;
527 void ForceOutlinerParaObject();
528 virtual bool IsVerticalWriting() const;
529 virtual void SetVerticalWriting(bool bVertical);
531 /** called from the SdrObjEditView during text edit when the status of the edit outliner changes */
532 virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus );
536 // transformation interface for StarOfficeAPI. This implements support for
537 // homogen 3x3 matrices containing the transformation of the SdrObject. At the
538 // moment it contains a shearX, rotation and translation, but for setting all linear
539 // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
542 // gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
543 // with the base geometry and returns TRUE. Otherwise it returns FALSE.
544 virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const SAL_OVERRIDE;
546 // sets the base geometry of the object using infos contained in the homogen 3x3 matrix.
547 // If it's an SdrPathObj it will use the provided geometry information. The Polygon has
548 // to use (0,0) as upper left and will be scaled to the given size in the matrix.
549 virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon) SAL_OVERRIDE;
551 // #103836# iterates over the paragraphs of a given SdrObject and removes all
552 // hard set character attributes with the which ids contained in the
553 // given vector
554 void RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>& rCharWhichIds );
556 // #111096#
557 // Get necessary data for text scroll animation. ATM base it on a Text-Metafile and a
558 // painting rectangle. Rotation is taken from the object.
559 GDIMetaFile* GetTextScrollMetaFileAndRectangle(Rectangle& rScrollRectangle, Rectangle& rPaintRectangle);
561 // #111096#
562 // Access to TextAnimationAllowed flag
563 void SetTextAnimationAllowed(bool bNew);
565 // #i8824#
566 // Set single item at the local ItemSet. *Does not use* AllowItemChange(),
567 // ItemChange(), PostItemChange() and ItemSetChanged() calls.
568 void SetObjectItemNoBroadcast(const SfxPoolItem& rItem);
570 public:
572 // text primitive decomposition helpers
573 void impDecomposeContourTextPrimitive(
574 drawinglayer::primitive2d::Primitive2DSequence& rTarget,
575 const drawinglayer::primitive2d::SdrContourTextPrimitive2D& rSdrContourTextPrimitive,
576 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
577 void impDecomposePathTextPrimitive(
578 drawinglayer::primitive2d::Primitive2DSequence& rTarget,
579 const drawinglayer::primitive2d::SdrPathTextPrimitive2D& rSdrPathTextPrimitive,
580 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
581 void impDecomposeBlockTextPrimitive(
582 drawinglayer::primitive2d::Primitive2DSequence& rTarget,
583 const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive,
584 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
585 void impDecomposeAutoFitTextPrimitive(
586 drawinglayer::primitive2d::Primitive2DSequence& rTarget,
587 const drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D& rSdrAutofitTextPrimitive,
588 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
589 void impDecomposeStretchTextPrimitive(
590 drawinglayer::primitive2d::Primitive2DSequence& rTarget,
591 const drawinglayer::primitive2d::SdrStretchTextPrimitive2D& rSdrStretchTextPrimitive,
592 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
595 // timing generators
596 void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const;
597 void impGetScrollTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList, double fFrameLength, double fTextLength) const;
599 /** returns false if the given pointer is NULL
600 or if the given SdrOutliner contains no text.
601 Also checks for one empty paragraph.
603 static bool HasTextImpl( SdrOutliner* pOutliner );
605 friend class ::SdrTextObjTest;
610 #endif // INCLUDED_SVX_SVDOTEXT_HXX
612 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */