1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: eppt.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #ifndef _PptEscherEx_HXX
35 #include "escherex.hxx"
37 #include <tools/solar.h>
38 #include <sot/storage.hxx>
39 #include <tools/gen.hxx>
40 #include <vcl/graph.hxx>
41 #include <vcl/fontcvt.hxx>
42 #include <tools/string.hxx>
43 #include "pptexanimations.hxx"
44 #include <pptexsoundcollection.hxx>
46 // ------------------------------------------------------------------------
48 #include <vcl/mapmod.hxx>
49 #include <com/sun/star/uno/Any.hxx>
50 #include <com/sun/star/frame/XModel.hpp>
51 #include <com/sun/star/drawing/FillStyle.hpp>
52 #include <com/sun/star/drawing/LineStyle.hpp>
53 #include <com/sun/star/drawing/DashStyle.hpp>
54 #include <com/sun/star/drawing/HatchStyle.hpp>
55 #include <com/sun/star/drawing/LineEndType.hpp>
56 #include <com/sun/star/drawing/Alignment.hpp>
57 #include <com/sun/star/drawing/TextAdjust.hpp>
58 #include <com/sun/star/drawing/CircleKind.hpp>
59 #include <com/sun/star/drawing/PolygonKind.hpp>
60 #include <com/sun/star/drawing/PolygonFlags.hpp>
61 #include <com/sun/star/drawing/XUniversalShapeDescriptor.hpp>
62 #include <com/sun/star/drawing/XShapeGrouper.hpp>
63 #include <com/sun/star/text/XSimpleText.hpp>
64 #include <com/sun/star/drawing/XConnectorShape.hpp>
65 #include <com/sun/star/drawing/BezierPoint.hpp>
66 #include <com/sun/star/drawing/Hatch.hpp>
67 #include <com/sun/star/drawing/LineDash.hpp>
68 #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
69 #include <com/sun/star/presentation/XPresentationSupplier.hpp>
70 #include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
71 #include <com/sun/star/drawing/XMasterPageTarget.hpp>
72 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
73 #include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
74 #include <com/sun/star/awt/XGraphics.hpp>
75 #include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
76 #include <com/sun/star/presentation/AnimationEffect.hpp>
77 #include <com/sun/star/presentation/FadeEffect.hpp>
78 #include <com/sun/star/presentation/ClickAction.hpp>
79 #include <com/sun/star/presentation/AnimationSpeed.hpp>
80 #include <com/sun/star/presentation/PresentationRange.hpp>
81 #include <com/sun/star/text/XTextFieldsSupplier.hpp>
82 #include <com/sun/star/text/XTextField.hpp>
83 #include <com/sun/star/container/XNamed.hpp>
84 #include <com/sun/star/awt/FontDescriptor.hpp>
85 #include <com/sun/star/container/XIndexContainer.hpp>
86 #include <com/sun/star/awt/XControlModel.hpp>
87 #include <com/sun/star/style/TabStop.hpp>
88 #include <svx/msocximex.hxx>
89 #include <com/sun/star/beans/XPropertySet.hpp>
90 #include <com/sun/star/beans/XPropertyState.hpp>
91 #include <com/sun/star/beans/XPropertySetInfo.hpp>
92 #include <com/sun/star/awt/FontFamily.hpp>
93 #include <com/sun/star/awt/FontPitch.hpp>
94 #include <com/sun/star/awt/CharSet.hpp>
95 #include <com/sun/star/text/WritingMode.hpp>
96 #include <com/sun/star/lang/Locale.hpp>
98 enum PageType
{ NORMAL
= 0, MASTER
= 1, NOTICE
= 2, UNDEFINED
= 3 };
100 #define EPP_MAINMASTER_PERSIST_KEY 0x80010000
101 #define EPP_MAINNOTESMASTER_PERSIST_KEY 0x80020000
102 #define EPP_MAINSLIDE_PERSIST_KEY 0x80030000
103 #define EPP_MAINNOTES_PERSIST_KEY 0x80040000
105 #define EPP_Persist_Document 0x80080000
106 #define EPP_Persist_MainMaster 0x80100000
107 #define EPP_Persist_MainNotes 0x80200000
108 #define EPP_Persist_Slide 0x80400000
109 #define EPP_Persist_Notes 0x80800000
110 #define EPP_Persist_CurrentPos 0x81000000
111 #define EPP_Persist_VBAInfoAtom 0x84000000
112 #define EPP_Persist_ExObj 0x88000000
114 #define EPP_TEXTSTYLE_NORMAL 0x00000001
115 #define EPP_TEXTSTYLE_TITLE 0x00000010
116 #define EPP_TEXTSTYLE_BODY 0x00000100
117 #define EPP_TEXTSTYLE_TEXT 0x00001000
120 #define EPP_LAYOUT_TITLESLIDE 0 /* The slide is a title slide */
121 #define EPP_LAYOUT_TITLEANDBODYSLIDE 1 /* Title and body slide */
122 #define EPP_LAYOUT_TITLEMASTERSLIDE 2 /* Title master slide */
123 #define EPP_LAYOUT_MASTERSLIDE 3 /* Master slide layout */
124 #define EPP_LAYOUT_MASTERNOTES 4 /* Master notes layout */
125 #define EPP_LAYOUT_NOTESTITLEBODY 5 /* Notes title/body layout */
126 #define EPP_LAYOUT_HANDOUTLAYOUT 6 /* Handout layout, therefore it doesn't have placeholders except header, footer, and date */
127 #define EPP_LAYOUT_ONLYTITLE 7 /* Only title placeholder */
128 #define EPP_LAYOUT_2COLUMNSANDTITLE 8 /* Body of the slide has 2 columns and a title */
129 #define EPP_LAYOUT_2ROWSANDTITLE 9 /* Slide's body has 2 rows and a title */
130 #define EPP_LAYOUT_RIGHTCOLUMN2ROWS 10 /* Body contains 2 columns, right column has 2 rows */
131 #define EPP_LAYOUT_LEFTCOLUMN2ROWS 11 /* Body contains 2 columns, left column has 2 rows */
132 #define EPP_LAYOUT_BOTTOMROW2COLUMNS 12 /* Body contains 2 rows, bottom row has 2 columns */
133 #define EPP_LAYOUT_TOPROW2COLUMN 13 /* Body contains 2 rows, top row has 2 columns */
134 #define EPP_LAYOUT_4OBJECTS 14 /* 4 objects */
135 #define EPP_LAYOUT_BIGOBJECT 15 /* Big object */
136 #define EPP_LAYOUT_BLANCSLIDE 16 /* Blank slide */
137 #define EPP_LAYOUT_TITLERIGHTBODYLEFT 17 /* Vertical title on the right, body on the left */
138 #define EPP_LAYOUT_TITLERIGHT2BODIESLEFT 18 /* Vertical title on the right, body on the left split into 2 rows */
142 class XStatusIndicatorRef
;
147 sal_uInt8 nPlaceHolder
[ 8 ];
149 sal_uInt8 nUsedObjectPlaceHolder
;
150 sal_uInt8 nTypeOfTitle
;
151 sal_uInt8 nTypeOfOutliner
;
154 BOOL bOutlinerPossible
;
155 BOOL bSecOutlinerPossible
;
160 sal_Bool bExtendedParameters
;
161 sal_uInt32 nParaFlags
;
162 sal_Int16 nBulletFlags
;
165 String sGraphicUrl
; // String auf eine Graphic
167 sal_uInt32 nNumberingType
; // in wirlichkeit ist dies ein SvxEnum
168 sal_uInt32 nHorzAdjust
;
169 sal_uInt32 nBulletColor
;
170 sal_Int32 nBulletOfs
;
171 sal_Int16 nStartWith
; // Start der nummerierung
173 sal_Int16 nBulletRealSize
; // GroessenVerhaeltnis in Proz
174 sal_Int16 nDepth
; // aktuelle tiefe
175 sal_Unicode cBulletId
; // wenn Numbering Type == CharSpecial
176 ::com::sun::star::awt::FontDescriptor aFontDesc
;
178 sal_Bool bExtendedBulletsUsed
;
179 sal_uInt16 nBulletId
;
180 sal_uInt32 nMappedNumType
;
181 sal_Bool bNumberingIsNumber
;
186 bExtendedParameters
= FALSE
;
191 bExtendedBulletsUsed
= FALSE
;
193 bNumberingIsNumber
= sal_True
;
197 // ------------------------------------------------------------------------
199 class EscherGraphicProvider
;
200 class PPTExBulletProvider
202 friend struct PPTExParaSheet
;
206 SvMemoryStream aBuExPictureStream
;
207 SvMemoryStream aBuExOutlineStream
;
208 SvMemoryStream aBuExMasterStream
;
210 EscherGraphicProvider
* pGraphicProv
;
214 sal_uInt16
GetId( const ByteString
& rUniqueId
, Size
& rGraphicSize
);
216 PPTExBulletProvider();
217 ~PPTExBulletProvider();
220 struct FontCollectionEntry
229 sal_Bool bIsConverted
;
231 FontCollectionEntry( const String
& rName
, sal_Int16 nFamily
, sal_Int16 nPitch
, sal_Int16 nCharSet
) :
235 CharSet ( nCharSet
),
241 FontCollectionEntry( const String
& rName
) :
247 ~FontCollectionEntry();
251 FontCollectionEntry() {};
253 void ImplInit( const String
& rName
);
257 class FontCollection
: private List
259 VirtualDevice
* pVDev
;
264 short GetScriptDirection( const String
& rText
) const;
265 sal_uInt32
GetId( FontCollectionEntry
& rFontDescriptor
);
266 sal_uInt32
GetCount() const { return List::Count(); };
267 const FontCollectionEntry
* GetById( sal_uInt32 nId
);
268 FontCollectionEntry
& GetLast() { return *(FontCollectionEntry
*)List::Last(); };
271 // ------------------------------------------------------------------------
273 #define PPTEX_STYLESHEETENTRYS 9
279 ParaAttr_BuHardColor
,
280 ParaAttr_BuHardHeight
,
283 ParaAttr_BulletHeight
,
284 ParaAttr_BulletColor
,
303 CharAttr_AsianOrComplexFont
,
310 struct PPTExCharLevel
314 sal_uInt16 mnAsianOrComplexFont
;
315 sal_uInt16 mnFontHeight
;
316 sal_uInt16 mnEscapement
;
317 sal_uInt32 mnFontColor
;
320 struct PPTExCharSheet
322 PPTExCharLevel maCharLevel
[ 5 ];
324 PPTExCharSheet( int nInstance
);
326 void SetStyleSheet( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> &,
327 FontCollection
& rFontCollection
, int nLevel
);
328 void Write( SvStream
& rSt
, PptEscherEx
* pEx
, sal_uInt16 nLev
, sal_Bool bFirst
, sal_Bool bSimpleText
,
329 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & rPagePropSet
);
333 struct PPTExParaLevel
336 sal_uInt16 mnBulletChar
;
337 sal_uInt16 mnBulletFont
;
338 sal_uInt16 mnBulletHeight
;
339 sal_uInt32 mnBulletColor
;
342 sal_uInt16 mnLineFeed
;
343 sal_uInt16 mnUpperDist
;
344 sal_uInt16 mnLowerDist
;
345 sal_uInt16 mnTextOfs
;
346 sal_uInt16 mnBulletOfs
;
347 sal_uInt16 mnDefaultTab
;
349 sal_Bool mbExtendedBulletsUsed
;
350 sal_uInt16 mnBulletId
;
351 sal_uInt16 mnBulletStart
;
352 sal_uInt32 mnMappedNumType
;
353 sal_uInt32 mnNumberingType
;
354 sal_uInt16 mnAsianSettings
;
358 struct PPTExParaSheet
360 PPTExBulletProvider
& rBuProv
;
362 sal_uInt32 mnInstance
;
364 PPTExParaLevel maParaLevel
[ 5 ];
365 PPTExParaSheet( int nInstance
, sal_uInt16 nDefaultTab
, PPTExBulletProvider
& rProv
);
367 void SetStyleSheet( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> &,
368 FontCollection
& rFontCollection
, int nLevel
, const PPTExCharLevel
& rCharLevel
);
369 void Write( SvStream
& rSt
, PptEscherEx
* pEx
, sal_uInt16 nLev
, sal_Bool bFirst
, sal_Bool bSimpleText
,
370 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & rPagePropSet
);
373 class PPTExStyleSheet
378 PPTExCharSheet
* mpCharSheet
[ PPTEX_STYLESHEETENTRYS
];
379 PPTExParaSheet
* mpParaSheet
[ PPTEX_STYLESHEETENTRYS
];
381 PPTExStyleSheet( sal_uInt16 nDefaultTab
, PPTExBulletProvider
& rBuProv
);
384 PPTExParaSheet
& GetParaSheet( int nInstance
) { return *mpParaSheet
[ nInstance
]; };
385 PPTExCharSheet
& GetCharSheet( int nInstance
) { return *mpCharSheet
[ nInstance
]; };
387 void SetStyleSheet( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> &,
388 FontCollection
& rFontCollection
, int nInstance
, int nLevel
);
389 sal_Bool
IsHardAttribute( sal_uInt32 nInstance
, sal_uInt32 nLevel
, PPTExTextAttr eAttr
, sal_uInt32 nValue
);
391 sal_uInt32
SizeOfTxCFStyleAtom() const;
392 void WriteTxCFStyleAtom( SvStream
& rSt
);
399 sal_uInt32 nType
; // bit 0-7 : type ( 1: click action to a slide )
400 // ( 2: hyperlink url )
402 // bit 31 : hyperlink is attached to a shape
404 EPPTHyperlink( const String rURL
, sal_uInt32 nT
) :
409 enum PPTExOleObjEntryType
411 NORMAL_OLE_OBJECT
, OCX_CONTROL
414 struct PPTExOleObjEntry
416 PPTExOleObjEntryType eType
;
417 sal_uInt32 nOfsA
; // offset to the EPP_ExOleObjAtom in mpExEmbed (set at creation)
418 sal_uInt32 nOfsB
; // offset to the EPP_ExOleObjStg
420 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlModel
> xControlModel
;
421 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> xShape
;
423 PPTExOleObjEntry( PPTExOleObjEntryType eT
, sal_uInt32 nOfs
) :
431 SvMemoryStream
* pOut
;
433 TextRuleEntry( int nPg
) :
437 ~TextRuleEntry() { delete pOut
; };
440 // ------------------------------------------------------------------------
444 sal_uInt32 mnCurrentPos
;
446 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexAccess
> mXIndexAccess
;
447 GroupEntry( ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexAccess
> & rIndex
)
449 mXIndexAccess
= rIndex
;
450 mnCount
=mXIndexAccess
->getCount();
453 GroupEntry( sal_uInt32 nCount
)
461 // ------------------------------------------------------------------------
468 sal_uInt32 mnCurrentGroupEntry
;
469 sal_uInt32 mnMaxGroupEntry
;
470 sal_uInt32 mnGroupsClosed
;
471 GroupEntry
** mpGroupEntry
;
473 void ImplResizeGroupTable( sal_uInt32 nEntrys
);
477 sal_uInt32
GetCurrentGroupIndex() const { return mnIndex
; };
478 sal_Int32
GetCurrentGroupLevel() const { return mnCurrentGroupEntry
- 1; };
479 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexAccess
> &
480 GetCurrentGroupAccess() const { return mpGroupEntry
[ mnCurrentGroupEntry
- 1 ]->mXIndexAccess
; };
481 sal_uInt32
GetGroupsClosed();
482 void SkipCurrentGroup();
483 void ResetGroupTable( sal_uInt32 nCount
);
484 void ClearGroupTable();
485 sal_Bool
EnterGroup( ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexAccess
> & rIndex
);
486 sal_Bool
GetNextGroupEntry();
495 ::com::sun::star::uno::Any mAny
;
497 ::com::sun::star::uno::Reference
498 < ::com::sun::star::beans::XPropertySet
> mXPropSet
;
500 sal_Bool
ImplGetPropertyValue( const String
& rString
);
501 sal_Bool
ImplGetPropertyValue( const ::com::sun::star::uno::Reference
502 < ::com::sun::star::beans::XPropertySet
> &, const String
& );
506 static sal_Bool
GetPropertyValue(
507 ::com::sun::star::uno::Any
& rAny
,
508 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> &,
509 const String
& rPropertyName
,
510 sal_Bool bTestPropertyAvailability
= sal_False
);
512 static ::com::sun::star::beans::PropertyState
GetPropertyState(
513 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> &,
514 const String
& rPropertyName
);
517 class PropStateValue
: public PropValue
521 ::com::sun::star::beans::PropertyState ePropState
;
522 ::com::sun::star::uno::Reference
523 < ::com::sun::star::beans::XPropertyState
> mXPropState
;
525 sal_Bool
ImplGetPropertyValue( const String
& rString
, sal_Bool bGetPropertyState
= TRUE
);
529 // ------------------------------------------------------------------------
532 class PortionObj
: public PropStateValue
535 friend class ParagraphObj
;
540 void ImplConstruct( PortionObj
& rPortionObj
);
541 sal_uInt32
ImplGetTextField( ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextRange
> & rXTextRangeRef
,
542 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & rXPropSetRef
, String
& rURL
);
543 sal_uInt32
ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition
);
544 void ImplGetPortionValues( FontCollection
& rFontCollection
, sal_Bool bGetPropStateValue
= FALSE
);
548 ::com::sun::star::beans::PropertyState meCharColor
;
549 ::com::sun::star::beans::PropertyState meCharHeight
;
550 ::com::sun::star::beans::PropertyState meFontName
;
551 ::com::sun::star::beans::PropertyState meAsianOrComplexFont
;
552 ::com::sun::star::beans::PropertyState meCharEscapement
;
553 ::com::sun::star::lang::Locale meCharLocale
;
554 sal_uInt16 mnCharAttrHard
;
556 sal_uInt32 mnCharColor
;
557 sal_uInt16 mnCharAttr
;
558 sal_uInt16 mnCharHeight
;
560 sal_uInt16 mnAsianOrComplexFont
;
561 sal_Int16 mnCharEscapement
;
563 sal_uInt32 mnTextSize
;
564 sal_Bool mbLastPortion
;
567 FieldEntry
* mpFieldEntry
;
569 PortionObj( ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextRange
> & rXTextRangeRef
,
570 sal_Bool bLast
, FontCollection
& rFontCollection
);
571 PortionObj( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & rXPropSetRef
,
572 FontCollection
& rFontCollection
);
573 PortionObj( PortionObj
& rPortionObj
);
576 void Write( SvStream
* pStrm
, sal_Bool bLast
);
577 sal_uInt32
Count() const { return mnTextSize
; };
579 PortionObj
& operator=( PortionObj
& rPortionObj
);
584 sal_Bool bFirstParagraph
: 1;
585 sal_Bool bLastParagraph
: 1;
587 ParaFlags() { bFirstParagraph
= TRUE
; bLastParagraph
= FALSE
; };
590 class ParagraphObj
: public List
, public PropStateValue
, public SOParagraph
592 friend class TextObj
;
593 friend struct PPTExParaSheet
;
595 MapMode maMapModeSrc
;
596 MapMode maMapModeDest
;
600 void ImplConstruct( ParagraphObj
& rParagraphObj
);
602 sal_uInt32
ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition
);
603 ::com::sun::star::awt::Size
ImplMapSize( const ::com::sun::star::awt::Size
& rSize
);
604 void ImplGetParagraphValues( PPTExBulletProvider
& rBuProv
, sal_Bool bGetPropStateValue
= FALSE
);
605 void ImplGetNumberingLevel( PPTExBulletProvider
& rBuProv
, sal_Int16 nDepth
, sal_Bool bIsBullet
, sal_Bool bGetPropStateValue
= FALSE
);
609 ::com::sun::star::uno::Sequence
< ::com::sun::star::style::TabStop
> maTabStop
;
611 sal_uInt32 mnTextSize
;
614 sal_Bool mbFirstParagraph
;
615 sal_Bool mbLastParagraph
;
617 ::com::sun::star::beans::PropertyState meBullet
;
618 ::com::sun::star::beans::PropertyState meTextAdjust
;
619 ::com::sun::star::beans::PropertyState meLineSpacing
;
620 ::com::sun::star::beans::PropertyState meLineSpacingTop
;
621 ::com::sun::star::beans::PropertyState meLineSpacingBottom
;
622 ::com::sun::star::beans::PropertyState meForbiddenRules
;
623 ::com::sun::star::beans::PropertyState meParagraphPunctation
;
624 ::com::sun::star::beans::PropertyState meBiDi
;
626 sal_uInt16 mnTextAdjust
;
627 sal_Int16 mnLineSpacing
;
628 sal_Bool mbFixedLineSpacing
;
629 sal_Int16 mnLineSpacingTop
;
630 sal_Int16 mnLineSpacingBottom
;
631 sal_Bool mbForbiddenRules
;
632 sal_Bool mbParagraphPunctation
;
635 ParagraphObj( ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextContent
> & rXTextContentRef
,
636 ParaFlags
, FontCollection
& rFontCollection
,
637 PPTExBulletProvider
& rBuProv
);
638 ParagraphObj( ParagraphObj
& rParargraphObj
);
639 ParagraphObj( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & rXPropSetRef
,
640 PPTExBulletProvider
& rBuProv
);
642 void CalculateGraphicBulletSize( sal_uInt16 nFontHeight
);
645 void Write( SvStream
* pStrm
);
646 sal_uInt32
Count() const { return mnTextSize
; };
648 ParagraphObj
& operator=( ParagraphObj
& rParagraphObj
);
653 sal_uInt32 mnRefCount
;
654 sal_uInt32 mnTextSize
;
657 sal_Bool mbHasExtendedBullets
;
658 sal_Bool mbFixedCellHeightUsed
;
660 ImplTextObj( int nInstance
);
666 ImplTextObj
* mpImplTextObj
;
667 void ImplCalculateTextPositions();
670 TextObj( ::com::sun::star::uno::Reference
< ::com::sun::star::text::XSimpleText
> &
671 rXText
, int nInstance
, FontCollection
& rFontCollection
, PPTExBulletProvider
& rBuProv
);
672 TextObj( TextObj
& rTextObj
);
675 void Write( SvStream
* pStrm
);
677 ParagraphObj
* First(){ return (ParagraphObj
*)mpImplTextObj
->mpList
->First(); };
678 ParagraphObj
* Next(){ return(ParagraphObj
*)mpImplTextObj
->mpList
->Next(); };
679 sal_uInt32
Count() const { return mpImplTextObj
->mnTextSize
; };
680 int GetInstance() const { return mpImplTextObj
->mnInstance
; };
681 sal_Bool
HasExtendedBullets(){ return mpImplTextObj
->mbHasExtendedBullets
; };
682 void WriteTextSpecInfo( SvStream
* pStrm
);
684 TextObj
& operator=( TextObj
& rTextObj
);
687 // ------------------------------------------------------------------------
689 class PPTWriter
: public GroupTable
, public PropValue
, public PPTExBulletProvider
692 sal_Bool mbUseNewAnimations
;
693 sal_uInt32 mnStatMaxValue
;
694 sal_uInt32 mnLatestStatValue
;
695 std::vector
< PPTExStyleSheet
* > maStyleSheetList
;
696 PPTExStyleSheet
* mpStyleSheet
;
698 EscherGraphicProvider
* mpGraphicProvider
;
700 MapMode maMapModeSrc
;
701 MapMode maMapModeDest
;
702 ::com::sun::star::awt::Size maDestPageSize
;
703 ::com::sun::star::awt::Size maNotesPageSize
;
704 PageType meLatestPageType
;
705 List maSlideNameList
;
707 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> mXModel
;
708 ::com::sun::star::uno::Reference
< ::com::sun::star::task::XStatusIndicator
> mXStatusIndicator
;
709 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPagesSupplier
> mXDrawPagesSupplier
;
710 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XMasterPagesSupplier
> mXMasterPagesSupplier
;
711 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPages
> mXDrawPages
;
712 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
> mXDrawPage
;
713 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> mXPagePropSet
;
714 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> mXBackgroundPropSet
;
715 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapes
> mXShapes
;
716 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> mXShape
;
717 ::com::sun::star::uno::Reference
< ::com::sun::star::text::XSimpleText
> mXText
; // TextRef des globalen Text
718 ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextCursor
> mXCursor
;
719 ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextRange
> mXCursorText
; // TextRef des Teilstuecks des Cursors
720 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> mXCursorPropSet
; // die Properties des Teilstueckes
721 ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextField
> mXTextField
;
722 ::com::sun::star::awt::Size maSize
;
723 ::com::sun::star::awt::Point maPosition
;
727 sal_Bool mbEmptyPresObj
;
728 sal_Bool mbStatusIndicator
;
730 sal_uInt32 mnTextStyle
;
732 sal_Bool mbFontIndependentLineSpacing
;
733 sal_uInt32 mnTextSize
;
736 SvStorageStream
* mpCurUserStrm
;
737 SvStorageStream
* mpStrm
;
738 SvStorageStream
* mpPicStrm
;
739 PptEscherEx
* mpPptEscherEx
;
742 sal_uInt32 mnVBAOleOfs
;
743 SvMemoryStream
* mpVBA
;
744 sal_uInt32 mnExEmbed
;
745 SvMemoryStream
* mpExEmbed
;
747 sal_uInt32 mnPages
; // anzahl einzelner Slides ( ohne masterpages & notes & handout )
748 sal_uInt32 mnMasterPages
; //
749 sal_uInt32 mnDrawings
; // anzahl Slides + masterpages + notes + handout
750 sal_uInt32 mnPagesWritten
;
751 sal_uInt32 mnUniqueSlideIdentifier
;
752 sal_uInt32 mnTxId
; // Identifier determined by the HOST (PP) ????
753 sal_uInt32 mnDiaMode
; // 0 -> manuell
754 // 1 -> halbautomatisch
757 sal_uInt32 mnShapeMasterTitle
;
758 sal_uInt32 mnShapeMasterBody
;
760 List maTextRuleList
; // TextRuleEntry's
763 FontCollection maFontCollection
;
764 ppt::ExSoundCollection maSoundCollection
;
766 PHLayout
& ImplGetLayout( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& rXPropSet
) const;
767 void ImplWriteExtParaHeader( SvMemoryStream
& rSt
, sal_uInt32 nRef
, sal_uInt32 nInstance
, sal_uInt32 nSlideId
);
770 sal_uInt32
ImplProgBinaryTag( SvStream
* pOutStrm
= NULL
);
771 sal_uInt32
ImplProgBinaryTagContainer( SvStream
* pOutStrm
= NULL
, SvMemoryStream
* pBinTag
= NULL
);
772 sal_uInt32
ImplProgTagContainer( SvStream
* pOutStrm
= NULL
, SvMemoryStream
* pBinTag
= NULL
);
773 sal_uInt32
ImplOutlineViewInfoContainer( SvStream
* pOutStrm
= NULL
);
774 sal_uInt32
ImplSlideViewInfoContainer( sal_uInt32 nInstance
, SvStream
* pOutStrm
= NULL
);
775 sal_uInt32
ImplVBAInfoContainer( SvStream
* pOutStrm
= NULL
);
776 sal_uInt32
ImplDocumentListContainer( SvStream
* pOutStrm
= NULL
);
777 sal_uInt32
ImplMasterSlideListContainer( SvStream
* pOutStrm
= NULL
);
780 static void WriteCString( SvStream
&, const String
&, sal_uInt32 nInstance
= 0 );
784 sal_Bool
ImplCreateDocumentSummaryInformation( sal_uInt32 nCnvrtFlags
);
785 sal_Bool
ImplCreateCurrentUserStream();
786 void ImplCreateHeaderFooterStrings( SvStream
& rOut
,
787 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& rXPagePropSet
);
788 void ImplCreateHeaderFooters( ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& rXPagePropSet
);
789 sal_Bool
ImplCreateDocument();
790 sal_Bool
ImplCreateHyperBlob( SvMemoryStream
& rStream
);
791 sal_uInt32
ImplInsertBookmarkURL( const String
& rBookmark
, const sal_uInt32 nType
,
792 const String
& rStringVer0
, const String
& rStringVer1
, const String
& rStringVer2
, const String
& rStringVer3
);
793 sal_Bool
ImplCreateMaster( sal_uInt32 nPageNum
);
794 sal_Bool
ImplCreateMainNotes();
795 sal_Bool
ImplCreateSlide( sal_uInt32 nPageNum
);
796 sal_Bool
ImplCreateNotes( sal_uInt32 nPageNum
);
797 void ImplWriteBackground( ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & rXBackgroundPropSet
);
798 void ImplWriteVBA( SvMemoryStream
* pVBA
);
799 void ImplWriteOLE( sal_uInt32 nCnvrtFlags
);
800 sal_Bool
ImplWriteAtomEnding();
802 sal_Bool
ImplInitSOIface();
803 sal_Bool
ImplSetCurrentStyleSheet( sal_uInt32 nPageNum
);
804 sal_Bool
ImplGetPageByIndex( sal_uInt32 nIndex
, PageType
);
805 sal_Bool
ImplGetShapeByIndex( sal_uInt32 nIndex
, sal_Bool bGroup
= FALSE
);
806 sal_uInt32
ImplGetMasterIndex( PageType ePageType
);
807 void ImplFlipBoundingBox( EscherPropertyContainer
& rPropOpt
);
808 sal_Bool
ImplGetText();
809 sal_Bool
ImplCreatePresentationPlaceholder( const sal_Bool bMaster
, const PageType PageType
,
810 const sal_uInt32 StyleInstance
, const sal_uInt8 PlaceHolderId
);
811 sal_Bool
ImplGetEffect( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> &,
812 ::com::sun::star::presentation::AnimationEffect
& eEffect
,
813 ::com::sun::star::presentation::AnimationEffect
& eTextEffect
,
814 sal_Bool
& bHasSound
);
815 void ImplWriteObjectEffect( SvStream
& rSt
,
816 ::com::sun::star::presentation::AnimationEffect eEffect
,
817 ::com::sun::star::presentation::AnimationEffect eTextEffect
,
819 void ImplWriteClickAction( SvStream
& rSt
, ::com::sun::star::presentation::ClickAction eAction
, sal_Bool bMediaClickAction
);
820 sal_Bool
ImplGetStyleSheets();
821 void ImplWriteParagraphs( SvStream
& rOutStrm
, TextObj
& rTextObj
);
822 void ImplWritePortions( SvStream
& rOutStrm
, TextObj
& rTextObj
);
823 void ImplWriteTextStyleAtom( SvStream
& rOut
, int nTextInstance
, sal_uInt32 nAtomInstance
,
824 TextRuleEntry
* pTextRule
, SvStream
& rExtBu
, EscherPropertyContainer
* );
825 void ImplAdjustFirstLineLineSpacing( TextObj
& rTextObj
, EscherPropertyContainer
& rPropOpt
);
826 void ImplCreateShape( sal_uInt32 nType
, sal_uInt32 nFlags
, EscherSolverContainer
& );
827 void ImplCreateTextShape( EscherPropertyContainer
&, EscherSolverContainer
&, sal_Bool bFill
);
829 void ImplWritePage( const PHLayout
& rLayout
,
830 EscherSolverContainer
& rSolver
,
833 int nPageNumber
= 0 );
834 void ImplCreateCellBorder( const CellBorder
* pCellBorder
, sal_Int32 nX1
, sal_Int32 nY1
, sal_Int32 nX2
, sal_Int32 nY2
);
835 void ImplCreateTable( com::sun::star::uno::Reference
< com::sun::star::drawing::XShape
>& rXShape
, EscherSolverContainer
& aSolverContainer
,
836 EscherPropertyContainer
& aPropOpt
);
837 ::com::sun::star::awt::Point
ImplMapPoint( const ::com::sun::star::awt::Point
& );
838 ::com::sun::star::awt::Size
ImplMapSize( const ::com::sun::star::awt::Size
& );
839 Rectangle
ImplMapRectangle( const ::com::sun::star::awt::Rectangle
& );
841 sal_Bool
ImplCloseDocument(); // die font-, hyper-, Soundliste wird geschrieben ..
844 PPTWriter( SvStorageRef
& rSvStorage
,
845 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> & rModel
,
846 ::com::sun::star::uno::Reference
< ::com::sun::star::task::XStatusIndicator
> & rStatInd
,
847 SvMemoryStream
* pVBA
, sal_uInt32 nCnvrtFlags
);
851 sal_Bool
IsValid() const { return mbStatus
; };