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