LCOV - code coverage report
Current view: top level - libreoffice/svx/inc/svx - svdotext.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 15 16 93.8 %
Date: 2012-12-27 Functions: 13 15 86.7 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10