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