1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _SVDOTEXT_HXX 25 #define _SVDOTEXT_HXX 26 27 #include <vcl/field.hxx> 28 #include <svx/svdoattr.hxx> 29 #include <svx/svdtrans.hxx> // GeoStat 30 #include <tools/datetime.hxx> 31 #include <svx/xtextit0.hxx> 32 #include "svdtext.hxx" 33 #include <vector> 34 #include <boost/shared_ptr.hpp> 35 #include "svx/svxdllapi.h" 36 #include <drawinglayer/primitive2d/baseprimitive2d.hxx> 37 #include <svx/svdpagv.hxx> 38 39 //************************************************************ 40 // Vorausdeklarationen 41 //************************************************************ 42 43 class OutlinerParaObject; 44 class SdrOutliner; 45 class SdrTextObj; 46 class SvxFieldItem; 47 class ImpSdrObjTextLink; 48 class EditStatus; 49 50 namespace sdr { namespace properties { 51 class TextProperties; 52 }} 53 54 namespace drawinglayer { namespace primitive2d { 55 class SdrContourTextPrimitive2D; 56 class SdrPathTextPrimitive2D; 57 class SdrBlockTextPrimitive2D; 58 class SdrStretchTextPrimitive2D; 59 }} 60 61 namespace drawinglayer { namespace animation { 62 class AnimationEntryList; 63 }} 64 65 namespace drawinglayer { namespace geometry { 66 class ViewInformation2D; 67 }} 68 69 namespace sdr { namespace table { 70 class Cell; 71 class SdrTableRtfExporter; 72 class SdrTableRTFParser; 73 }} 74 75 //************************************************************ 76 // Defines 77 //************************************************************ 78 79 #define SDRUSERDATA_OBJTEXTLINK (1) 80 81 //************************************************************ 82 // Hilfsklasse SdrTextObjGeoData 83 //************************************************************ 84 85 class SdrTextObjGeoData : public SdrObjGeoData 86 { 87 public: 88 Rectangle aRect; 89 GeoStat aGeo; 90 }; 91 92 //************************************************************ 93 // Hilfsklasse ImpSdrObjTextLinkUserData 94 //************************************************************ 95 96 class ImpSdrObjTextLinkUserData : public SdrObjUserData 97 { 98 friend class SdrTextObj; 99 friend class ImpSdrObjTextLink; 100 101 SdrTextObj* pObj; 102 String aFileName; // Name des referenzierten Dokuments 103 String aFilterName; // ggf. ein Filter 104 DateTime aFileDate0; // Unnoetiges neuladen vermeiden 105 ImpSdrObjTextLink* pLink; 106 rtl_TextEncoding eCharSet; 107 108 public: 109 TYPEINFO(); 110 ImpSdrObjTextLinkUserData(SdrTextObj* pObj1); 111 virtual ~ImpSdrObjTextLinkUserData(); 112 113 virtual SdrObjUserData* Clone(SdrObject* pObj1) const; 114 }; 115 116 namespace sdr 117 { 118 namespace properties 119 { 120 class CustomShapeProperties; 121 class CellProperties; 122 } // end of namespace properties 123 } // end of namespace sdr 124 125 //************************************************************ 126 // SdrTextObj 127 //************************************************************ 128 129 class SVX_DLLPUBLIC SdrTextObj : public SdrAttrObj 130 { 131 private: 132 // Cell needs access to ImpGetDrawOutliner(); 133 134 friend class sdr::table::Cell; 135 friend class sdr::table::SdrTableRtfExporter; 136 friend class sdr::table::SdrTableRTFParser; 137 138 // CustomShapeproperties need to access the "bTextFrame" member: 139 friend class sdr::properties::CustomShapeProperties; 140 141 protected: 142 virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); 143 virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); 144 145 private: 146 // This method is only allowed for sdr::properties::TextProperties GetTextEditOutliner() const147 SVX_DLLPRIVATE SdrOutliner* GetTextEditOutliner() const 148 { 149 return pEdtOutl; 150 } 151 152 // This method is only allowed for sdr::properties::TextProperties SetPortionInfoChecked(sal_Bool bNew)153 SVX_DLLPRIVATE void SetPortionInfoChecked(sal_Bool bNew) 154 { 155 bPortionInfoChecked = bNew; 156 } 157 158 // to allow sdr::properties::TextProperties access to SetPortionInfoChecked() 159 // and GetTextEditOutliner() 160 friend class sdr::properties::TextProperties; 161 friend class sdr::properties::CellProperties; 162 163 friend class ImpTextPortionHandler; 164 friend class ImpSdrObjTextLink; 165 friend class ImpSdrObjTextLinkUserData; 166 friend class SdrPowerPointImport; // fuer PowerPointImport 167 friend class SdrExchangeView; // fuer ImpGetDrawOutliner 168 friend class SdrView; // fuer ImpGetDrawOutliner 169 friend class SdrObjEditView; // fuer TextEdit 170 friend class SdrMeasureObj; // fuer ImpGetDrawOutliner 171 friend class SvxMSDffManager; // fuer ImpGetDrawOutliner 172 friend class SdrObjCustomShape;// fuer ImpGetDrawOutliner 173 friend class SdrText; // fuer ImpGetDrawOutliner 174 175 protected: 176 // Das aRect ist gleichzeig auch das Rect vom RectObj und CircObj. 177 // Bei bTextFrame=sal_True wird der Text in dieses Rect hineinformatiert. 178 // Bei bTextFrame=sal_False wird der Text am Mittelpunkt des Rect zentriert. 179 Rectangle aRect; 180 181 // Der GeoStat enthaelt den Drehwinkel und einen Shearwinkel 182 GeoStat aGeo; 183 184 // this is the active text 185 SdrText* mpText; 186 187 // Hier merke ich mir die Ausmasse des Textes (n.i.) 188 Size aTextSize; 189 190 // Ein Outliner*, damit 191 // 1. das TextObj nicht von mehreren Views gleichzeitig editiert und 192 // 2. beim Streamen waerend des Editierens ein Flush() ausgefuehrt 193 // werden kann 194 SdrOutliner* pEdtOutl; 195 196 // Bei Fontwork muss soviel auf's BoundRect draufgerechnet werden 197 // damit es ausreichend gross ist. 198 Rectangle* pFormTextBoundRect; 199 200 // Moegliche Werte fuer eTextKind sind: 201 // OBJ_TEXT normaler Textrahmen 202 // OBJ_TEXTEXT Textfortsetzungsrahmen 203 // OBJ_TITLETEXT TitleText fuer StarDraw-Praesentation 204 // OBJ_OUTLINETEXT OutlineText fuer StarDraw-Praesentation 205 // eTextKind hat nur Bedeutung, wenn bTextFrame=sal_True, da es sich sonst 206 // um ein beschriftetes Grafikobjekt handelt. 207 SdrObjKind eTextKind; 208 209 // #108784# 210 // For text editing in SW Haeder/Footer it is necessary to be 211 // able to set an offset for the text edit to allow text editing at the 212 // position of the virtual object. This offset is used when setting up 213 // and maintaining the OutlinerView. 214 Point maTextEditOffset; 215 public: GetTextEditOffset() const216 const Point& GetTextEditOffset() const { return maTextEditOffset; } SetTextEditOffset(const Point & rNew)217 void SetTextEditOffset(const Point& rNew) { maTextEditOffset = rNew; } 218 219 protected: 220 // Fuer beschriftete Zeichenobjekte ist bTextFrame=FALSE. Der Textblock 221 // wird dann hoizontal und vertikal an aRect zentriert. Bei bTextFrame= 222 // sal_True wird der Text in aRect hineinformatiert. Der eigentliche Textrahmen 223 // ist durch ein SdrRectObj mit bTextFrame=sal_True realisiert. 224 sal_Bool bTextFrame : 1; 225 sal_Bool bPortionInfoChecked : 1; // Fuer Optimierung von Textobjekten 226 sal_Bool bNoShear : 1; // Obj darf nicht gesheart werden (->Graf+Ole+TextFrame) 227 sal_Bool bNoRotate : 1; // Obj darf nicht gedreht werden (->Ole) 228 sal_Bool bNoMirror : 1; // Obj darf nicht gespiegelt werden (->Ole,TextFrame) 229 sal_Bool bTextSizeDirty : 1; 230 231 // #101684# 232 sal_Bool mbInEditMode : 1; // Is this text obejct in edit mode? 233 234 // Fuer Objekt mit freier Groesse im Draw (Mengentext). Das Flag wird vom 235 // der App beim Create gesetzt. 236 // Wenn das Objekt dann spaeter in der Breite resized wird, wird 237 // AutoGrowWidth abgeschaltet (Hart auf sal_False attributiert). Das Flag wird 238 // dann ebenfalls auf sal_False gesetzt, sodass sich das Objekt anschliessend 239 // wie ein normales Textobjekt verhaelt. 240 // Resize in der Breite kann sein: 241 // - Interaktives Resize in Einfach- oder Mehrfachselektion 242 // - Positions+Groesse Dialog 243 sal_Bool bDisableAutoWidthOnDragging : 1; 244 245 // #111096# 246 // Allow text suppression 247 sal_Bool mbTextHidden : 1; 248 249 // #111096# 250 // Flag for allowing text animation. Default is sal_true. 251 sal_Bool mbTextAnimationAllowed : 1; 252 253 SdrOutliner& ImpGetDrawOutliner() const; 254 255 private: 256 SVX_DLLPRIVATE void ImpCheckMasterCachable(); 257 // #101029#: Extracted from ImpGetDrawOutliner() 258 SVX_DLLPRIVATE void ImpInitDrawOutliner( SdrOutliner& rOutl ) const; 259 // #101029#: Extracted from Paint() 260 SVX_DLLPRIVATE void ImpSetupDrawOutlinerForPaint( FASTBOOL bContourFrame, 261 SdrOutliner& rOutliner, 262 Rectangle& rTextRect, 263 Rectangle& rAnchorRect, 264 Rectangle& rPaintRect, 265 Fraction& aFitXKorreg ) const; 266 SVX_DLLPRIVATE SdrObject* ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const; 267 SVX_DLLPRIVATE void ImpLinkAnmeldung(); 268 SVX_DLLPRIVATE void ImpLinkAbmeldung(); 269 SVX_DLLPRIVATE ImpSdrObjTextLinkUserData* GetLinkUserData() const; 270 // void ImpCheckItemSetChanges(const SfxItemSet& rAttr); 271 272 protected: 273 bool ImpCanConvTextToCurve() const; 274 SdrObject* ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, sal_Bool bClosed, sal_Bool bBezier, sal_Bool bNoSetAttr = sal_False) const; 275 SdrObject* ImpConvertAddText(SdrObject* pObj, FASTBOOL bBezier) const; 276 void ImpSetTextStyleSheetListeners(); 277 void ImpSetCharStretching(SdrOutliner& rOutliner, const Rectangle& rTextRect, const Rectangle& rAnchorRect, Fraction& rFitXKorreg) const; 278 void ImpJustifyRect(Rectangle& rRect) const; 279 void ImpCheckShear(); 280 Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const; 281 void ImpSetTextEditParams() const; SetTextSizeDirty()282 void SetTextSizeDirty() { bTextSizeDirty=sal_True; } 283 284 // rAnchorRect ist InOut-Parameter! 285 void ImpSetContourPolygon( SdrOutliner& rOutliner, Rectangle& rAnchorRect, sal_Bool bLineWidth ) const; 286 287 virtual SdrObjGeoData* NewGeoData() const; 288 virtual void SaveGeoData(SdrObjGeoData& rGeo) const; 289 virtual void RestGeoData(const SdrObjGeoData& rGeo); 290 FASTBOOL NbcSetEckenradius(long nRad); 291 FASTBOOL NbcSetAutoGrowHeight(bool bAuto); 292 FASTBOOL NbcSetMaxTextFrameHeight(long nHgt); 293 FASTBOOL NbcSetAutoGrowWidth(bool bAuto); 294 FASTBOOL NbcSetMaxTextFrameWidth(long nWdt); 295 FASTBOOL NbcSetFitToSize(SdrFitToSizeType eFit); 296 297 // #115391# new method for SdrObjCustomShape and SdrTextObj to correctly handle and set 298 // SdrTextMinFrameWidthItem and SdrTextMinFrameHeightItem based on all settings, necessities 299 // and object sizes 300 virtual void AdaptTextMinSize(); 301 302 // Konstruktoren fuer beschriftete Zeichenobjekte 303 SdrTextObj(); 304 SdrTextObj(const Rectangle& rNewRect); 305 306 // Konstruktoren fuer Textrahmen 307 SdrTextObj(SdrObjKind eNewTextKind); 308 SdrTextObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect); 309 310 // der sal_uInt16 eFormat nimmt Werte des enum EETextFormat entgegen 311 SdrTextObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect, SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat); 312 virtual ~SdrTextObj(); 313 314 public: 315 TYPEINFO(); 316 317 // #101684# IsInEditMode() const318 sal_Bool IsInEditMode() const { return mbInEditMode; } 319 320 // via eCharSet kann der CharSet der vorliegenden Datei uebergeben werden. 321 // Bei RTL_TEXTENCODING_DONTKNOW wird der CharSet der aktuellen Plattform verwendet. 322 // Derzeit unterstuetzt wird ASCII und RTF wobei ich die Unterscheidung 323 // selbst treffe. rFilterName ist noch ohne Bedeutung und muss leer gelassen 324 // werden. 325 // I.d.R. muss die App nur SetTextLink() rufen - der Rest geschieht von 326 // selbst (SfxLinkManager). Die Methode LoadText() kann ausserdem verwendet 327 // werden, um eine Datei in ein Textobjekt zu laden (ohne Verknuepfung). 328 // TextLinks koennen nicht editiert werden (allenfalls spaeter mal ReadOnly). 329 // Eine Attributierung kann nur am Textrahmen vollzogen werden. 330 void SetTextLink(const String& rFileName, const String& rFilterName, rtl_TextEncoding eCharSet); 331 void ReleaseTextLink(); IsLinkedText() const332 FASTBOOL IsLinkedText() const { return pPlusData!=NULL && GetLinkUserData()!=NULL; } 333 FASTBOOL ReloadLinkedText(FASTBOOL bForceLoad=sal_False); 334 FASTBOOL LoadText(const String& rFileName, const String& rFilterName, rtl_TextEncoding eCharSet); 335 336 virtual FASTBOOL AdjustTextFrameWidthAndHeight(Rectangle& rR, FASTBOOL bHgt=sal_True, FASTBOOL bWdt=sal_True) const; 337 virtual FASTBOOL NbcAdjustTextFrameWidthAndHeight(FASTBOOL bHgt=sal_True, FASTBOOL bWdt=sal_True); 338 virtual FASTBOOL AdjustTextFrameWidthAndHeight(FASTBOOL bHgt=sal_True, FASTBOOL bWdt=sal_True); 339 void NbcResizeTextAttributes(const Fraction& xFact, const Fraction& yFact); IsTextFrame() const340 FASTBOOL IsTextFrame() const { return bTextFrame; } IsOutlText() const341 FASTBOOL IsOutlText() const { return bTextFrame && (eTextKind==OBJ_OUTLINETEXT || eTextKind==OBJ_TITLETEXT); } GetTextKind() const342 SdrObjKind GetTextKind() const { return eTextKind; } 343 344 // #121917# 345 virtual bool HasText() const; 346 347 FASTBOOL HasEditText() const; IsTextEditActive() const348 sal_Bool IsTextEditActive() const { return (pEdtOutl != 0L); } 349 350 /** returns the currently active text. */ 351 virtual SdrText* getActiveText() const; 352 353 /** returns the nth available text. */ 354 virtual SdrText* getText( sal_Int32 nIndex ) const; 355 356 /** returns the number of texts available for this object. */ 357 virtual sal_Int32 getTextCount() const; 358 359 /** returns true only if we are in edit mode and the user actually changed anything */ 360 virtual bool IsRealyEdited() const; 361 362 /** changes the current active text */ 363 virtual void setActiveText( sal_Int32 nIndex ); 364 365 /** returns the index of the text that contains the given point or -1 */ 366 virtual sal_Int32 CheckTextHit(const Point& rPnt) const; 367 SetDisableAutoWidthOnDragging(FASTBOOL bOn)368 void SetDisableAutoWidthOnDragging(FASTBOOL bOn) { bDisableAutoWidthOnDragging=bOn; } IsDisableAutoWidthOnDragging()369 FASTBOOL IsDisableAutoWidthOnDragging() { return bDisableAutoWidthOnDragging; } 370 void NbcSetText(const String& rStr); 371 void SetText(const String& rStr); 372 void NbcSetText(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat); 373 void SetText(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat); 374 375 // FitToSize und Fontwork wird bei GetTextSize() nicht berueksichtigt! 376 virtual const Size& GetTextSize() const; 377 void FitFrameToTextSize(); 378 379 // Gleichzeitig wird der Text in den Outliner gesetzt (ggf. 380 // der des EditOutliners) und die PaperSize gesetzt. 381 virtual void TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FASTBOOL bNoEditText=sal_False, 382 Rectangle* pAnchorRect=NULL, sal_Bool bLineWidth=sal_True ) const; 383 virtual void TakeTextAnchorRect(::Rectangle& rAnchorRect) const; GetGeoStat() const384 const GeoStat& GetGeoStat() const { return aGeo; } 385 386 long GetEckenradius() const; 387 virtual FASTBOOL IsAutoGrowHeight() const; 388 long GetMinTextFrameHeight() const; 389 long GetMaxTextFrameHeight() const; 390 virtual FASTBOOL IsAutoGrowWidth() const; 391 long GetMinTextFrameWidth() const; 392 long GetMaxTextFrameWidth() const; 393 394 SdrFitToSizeType GetFitToSize() const; GetGeoRect() const395 const Rectangle &GetGeoRect() const { return aRect; } 396 397 // Feststellen, ob TextFontwork 398 virtual FASTBOOL IsFontwork() const; 399 400 // Soll die Fontwork-Kontour versteckt werden? 401 FASTBOOL IsHideContour() const; 402 403 // Textfluss innerhalb Kontur 404 FASTBOOL IsContourTextFrame() const; 405 406 // Horizontale Textausrichtung 407 SdrTextHorzAdjust GetTextHorizontalAdjust(const SfxItemSet& rSet) const; 408 SdrTextHorzAdjust GetTextHorizontalAdjust() const; 409 410 // Vertikale Textausrichtung 411 SdrTextVertAdjust GetTextVerticalAdjust(const SfxItemSet& rSet) const; 412 SdrTextVertAdjust GetTextVerticalAdjust() const; 413 414 // Textrahmenabstaende 415 long GetTextLeftDistance() const; 416 long GetTextRightDistance() const; 417 long GetTextUpperDistance() const; 418 long GetTextLowerDistance() const; 419 SdrTextAniKind GetTextAniKind() const; 420 SdrTextAniDirection GetTextAniDirection() const; 421 422 virtual void SetPage(SdrPage* pNewPage); 423 virtual void SetModel(SdrModel* pNewModel); 424 virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; 425 virtual sal_uInt16 GetObjIdentifier() const; 426 427 // Wird zur Bestimmung des Textankerbereichs benoetigt 428 virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const; 429 virtual void TakeObjNameSingul(String& rName) const; 430 virtual void TakeObjNamePlural(String& rName) const; 431 virtual void operator=(const SdrObject& rObj); 432 virtual basegfx::B2DPolyPolygon TakeXorPoly() const; 433 virtual basegfx::B2DPolyPolygon TakeContour() const; 434 virtual void RecalcSnapRect(); 435 virtual void NbcSetSnapRect(const Rectangle& rRect); 436 virtual void NbcSetLogicRect(const Rectangle& rRect); 437 virtual const Rectangle& GetLogicRect() const; 438 virtual long GetRotateAngle() const; 439 virtual long GetShearAngle(FASTBOOL bVertical=sal_False) const; 440 441 virtual sal_uInt32 GetSnapPointCount() const; 442 virtual Point GetSnapPoint(sal_uInt32 i) const; 443 444 virtual sal_uInt32 GetHdlCount() const; 445 virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const; 446 447 // special drag methods 448 virtual bool hasSpecialDrag() const; 449 virtual bool applySpecialDrag(SdrDragStat& rDrag); 450 virtual String getSpecialDragComment(const SdrDragStat& rDrag) const; 451 452 virtual FASTBOOL BegCreate(SdrDragStat& rStat); 453 virtual FASTBOOL MovCreate(SdrDragStat& rStat); 454 virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd); 455 virtual FASTBOOL BckCreate(SdrDragStat& rStat); 456 virtual void BrkCreate(SdrDragStat& rStat); 457 virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const; 458 virtual Pointer GetCreatePointer() const; 459 460 virtual void NbcMove(const Size& rSiz); 461 virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact); 462 virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs); 463 virtual void NbcMirror(const Point& rRef1, const Point& rRef2); 464 virtual void NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear); 465 466 virtual FASTBOOL HasTextEdit() const; 467 virtual sal_Bool BegTextEdit(SdrOutliner& rOutl); 468 virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const; 469 virtual void EndTextEdit(SdrOutliner& rOutl); 470 virtual sal_uInt16 GetOutlinerViewAnchorMode() const; 471 472 void StartTextAnimation(OutputDevice* pOutDev, const Point& rOffset, long nExtraData=0L); 473 void StopTextAnimation(OutputDevice* pOutDev=NULL, long nExtraData=0L); 474 475 virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject); 476 void NbcSetOutlinerParaObjectForText( OutlinerParaObject* pTextObject, SdrText* pText ); 477 virtual OutlinerParaObject* GetOutlinerParaObject() const; 478 virtual OutlinerParaObject* GetEditOutlinerParaObject() const; 479 virtual bool HasOutlinerParaObject() const; 480 481 virtual void NbcReformatText(); 482 virtual void ReformatText(); 483 484 virtual FASTBOOL CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, 485 FASTBOOL bEdit, Color*& rpTxtColor, Color*& rpFldColor, String& rRet) const; 486 487 virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const; 488 SetTextEditOutliner(SdrOutliner * pOutl)489 void SetTextEditOutliner(SdrOutliner* pOutl) { pEdtOutl=pOutl; } 490 491 /** Setup given Outliner equivalently to SdrTextObj::Paint() 492 493 To setup an arbitrary Outliner in the same way as the draw 494 outliner on SdrTextObj::Paint(). Among others, the paper size, 495 control word and character stretching are initialized, such 496 that the formatting should match the screen representation. 497 The textual content of the outliner is not touched, i.e. no 498 Init() or Clear() is called on the Outliner. 499 500 @param rOutl 501 The Outliner to setup. 502 503 @param rPaintRect 504 The region to paint the outliner content into. This is useful 505 to e.g. determine the top, left position of text in shapes. 506 */ 507 void SetupOutlinerFormatting( SdrOutliner& rOutl, Rectangle& rPaintRect ) const; 508 509 /** Update given Outliner equivalently to SdrTextObj::Paint() 510 511 Same functionality as in SetupOutlinerFormatting(), except 512 that the outliner content is not cleared. 513 514 @param rOutl 515 The Outliner to update. 516 517 @param rPaintRect 518 The region to paint the outliner content into. This is useful 519 to e.g. determine the top, left position of text in shapes. 520 */ 521 void UpdateOutlinerFormatting( SdrOutliner& rOutl, Rectangle& rPaintRect ) const; 522 void ForceOutlinerParaObject(); 523 virtual sal_Bool IsVerticalWriting() const; 524 virtual void SetVerticalWriting(sal_Bool bVertical); 525 526 /** called from the SdrObjEditView during text edit when the status of the edit outliner changes */ 527 virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus ); 528 529 //////////////////////////////////////////////////////////////////////////////////////////////////// 530 // 531 // transformation interface for StarOfficeAPI. This implements support for 532 // homogen 3x3 matrices containing the transformation of the SdrObject. At the 533 // moment it contains a shearX, rotation and translation, but for setting all linear 534 // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported. 535 // 536 //////////////////////////////////////////////////////////////////////////////////////////////////// 537 // gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon 538 // with the base geometry and returns TRUE. Otherwise it returns FALSE. 539 virtual sal_Bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const; 540 541 // sets the base geometry of the object using infos contained in the homogen 3x3 matrix. 542 // If it's an SdrPathObj it will use the provided geometry information. The Polygon has 543 // to use (0,0) as upper left and will be scaled to the given size in the matrix. 544 virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon); 545 546 // #103836# iterates over the paragraphs of a given SdrObject and removes all 547 // hard set character attributes with the which ids contained in the 548 // given vector 549 virtual void RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>& rCharWhichIds ); 550 551 // #111096# 552 // Access to thext hidden flag 553 sal_Bool GetTextHidden() const; 554 void NbcSetTextHidden(sal_Bool bNew); 555 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); 560 561 // #111096# 562 // Access to TextAnimationAllowed flag 563 bool IsTextAnimationAllowed() const; 564 void SetTextAnimationAllowed(sal_Bool bNew); 565 566 // #i8824# 567 // Set single item at the local ItemSet. *Does not use* AllowItemChange(), 568 // ItemChange(), PostItemChange() and ItemSetChanged() calls. 569 void SetObjectItemNoBroadcast(const SfxPoolItem& rItem); 570 571 public: 572 ////////////////////////////////////////////////////////////////////////////// 573 // text primitive decomposition helpers 574 void impDecomposeContourTextPrimitive( 575 drawinglayer::primitive2d::Primitive2DSequence& rTarget, 576 const drawinglayer::primitive2d::SdrContourTextPrimitive2D& rSdrContourTextPrimitive, 577 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; 578 void impDecomposePathTextPrimitive( 579 drawinglayer::primitive2d::Primitive2DSequence& rTarget, 580 const drawinglayer::primitive2d::SdrPathTextPrimitive2D& rSdrPathTextPrimitive, 581 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; 582 void impDecomposeBlockTextPrimitive( 583 drawinglayer::primitive2d::Primitive2DSequence& rTarget, 584 const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive, 585 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; 586 void impDecomposeStretchTextPrimitive( 587 drawinglayer::primitive2d::Primitive2DSequence& rTarget, 588 const drawinglayer::primitive2d::SdrStretchTextPrimitive2D& rSdrStretchTextPrimitive, 589 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; 590 591 ////////////////////////////////////////////////////////////////////////////// 592 // timing generators 593 void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const; 594 void impGetScrollTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList, double fFrameLength, double fTextLength) const; 595 596 /** returns false if the given pointer is NULL 597 or if the given SdrOutliner contains no text. 598 Also checks for one empty paragraph. 599 */ 600 static bool HasTextImpl( SdrOutliner* pOutliner ); 601 602 /** returns a new created and non shared outliner. 603 The outliner will not get updated when the SdrModel is changed. 604 */ 605 boost::shared_ptr< SdrOutliner > CreateDrawOutliner(); 606 }; 607 608 //////////////////////////////////////////////////////////////////////////////////////////////////// 609 610 #endif //_SVDOTEXT_HXX 611 612