1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef EPPT_POWERPOINT_EXPORT_HXX
21 #define EPPT_POWERPOINT_EXPORT_HXX
23 #include <oox/core/xmlfilterbase.hxx>
24 #include <oox/helper/zipstorage.hxx>
25 #include <oox/vml/vmldrawing.hxx>
26 #include <oox/export/shapes.hxx>
27 #include <comphelper/stl_types.hxx>
28 #include "epptbase.hxx"
30 namespace com
{ namespace sun
{ namespace star
{
31 namespace animations
{
43 class PowerPointShapeExport
;
47 std::vector
< sal_Int32
> mnFileIdArray
;
64 class PowerPointExport
: public XmlFilterBase
, public PPTWriterBase
66 friend class PowerPointShapeExport
;
69 PowerPointExport( const com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
> & rxCtxt
);
74 virtual bool importDocument() throw();
75 virtual bool exportDocument() throw();
77 // only needed for import, leave them empty, refactor later XmlFilterBase to export and import base?
78 virtual sal_Int32
getSchemeClr( sal_Int32
/* nColorSchemeToken */ ) const { return 0; }
79 virtual oox::vml::Drawing
* getVmlDrawing() { return NULL
; }
80 virtual const oox::drawingml::Theme
* getCurrentTheme() const { return NULL
; }
81 virtual const oox::drawingml::table::TableStyleListPtr
getTableStyles() { return oox::drawingml::table::TableStyleListPtr(); }
82 virtual oox::drawingml::chart::ChartConverter
* getChartConverter() { return NULL
; }
84 static const char* GetSideDirection( sal_uInt8 nDirection
);
85 static const char* GetCornerDirection( sal_uInt8 nDirection
);
86 static const char* Get8Direction( sal_uInt8 nDirection
);
87 static int GetPPTXLayoutId( int nOffset
);
91 virtual void ImplWriteSlide( sal_uInt32 nPageNum
, sal_uInt32 nMasterNum
, sal_uInt16 nMode
,
92 sal_Bool bHasBackground
, ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> aXBackgroundPropSet
);
93 virtual void ImplWriteNotes( sal_uInt32 nPageNum
);
94 virtual void ImplWriteSlideMaster( sal_uInt32 nPageNum
, ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> aXBackgroundPropSet
);
95 virtual void ImplWriteLayout( sal_Int32 nOffset
, sal_uInt32 nMasterNum
);
96 void ImplWritePPTXLayout( sal_Int32 nOffset
, sal_uInt32 nMasterNum
);
97 void WriteTheme( sal_Int32 nThemeNum
);
99 virtual sal_Bool
ImplCreateDocument();
100 virtual sal_Bool
ImplCreateMainNotes();
101 virtual ::oox::ole::VbaProject
* implCreateVbaProject() const;
102 sal_Bool
WriteNotesMaster();
104 void WriteAnimateTo( ::sax_fastparser::FSHelperPtr pFS
, const ::com::sun::star::uno::Any aValue
, const OUString
& rAttributeName
);
105 void WriteAnimateValues( ::sax_fastparser::FSHelperPtr pFS
, const ::com::sun::star::uno::Reference
< ::com::sun::star::animations::XAnimate
>& rXAnimate
);
106 void WriteAnimationCondition( ::sax_fastparser::FSHelperPtr pFS
, ::com::sun::star::uno::Any
& rAny
, sal_Bool bWriteEvent
, sal_Bool bMainSeqChild
);
107 void WriteAnimationCondition( ::sax_fastparser::FSHelperPtr pFS
, const char* pDelay
, const char* pEvent
, double fDelay
, sal_Bool bHasFDelay
);
108 void WriteAnimations( ::sax_fastparser::FSHelperPtr pFS
);
109 void WriteAnimationAttributeName( ::sax_fastparser::FSHelperPtr pFS
, const OUString
& rAttributeName
);
110 void WriteAnimationNode( ::sax_fastparser::FSHelperPtr pFS
, const ::com::sun::star::uno::Reference
< ::com::sun::star::animations::XAnimationNode
>& rXNode
, sal_Bool bMainSeqChild
);
111 void WriteAnimationNodeAnimate( ::sax_fastparser::FSHelperPtr pFS
, const ::com::sun::star::uno::Reference
< ::com::sun::star::animations::XAnimationNode
>& rXNode
, sal_Int32 nXmlNodeType
, sal_Bool bMainSeqChild
);
112 void WriteAnimationNodeAnimateInside( ::sax_fastparser::FSHelperPtr pFS
, const ::com::sun::star::uno::Reference
< ::com::sun::star::animations::XAnimationNode
>& rXNode
, sal_Bool bMainSeqChild
, sal_Bool bSimple
);
113 void WriteAnimationNodeSeq( ::sax_fastparser::FSHelperPtr pFS
, const ::com::sun::star::uno::Reference
< ::com::sun::star::animations::XAnimationNode
>& rXNode
, sal_Int32 nXmlNodeType
, sal_Bool bMainSeqChild
);
114 void WriteAnimationNodeEffect( ::sax_fastparser::FSHelperPtr pFS
, const ::com::sun::star::uno::Reference
< ::com::sun::star::animations::XAnimationNode
>& rXNode
, sal_Int32 nXmlNodeType
, sal_Bool bMainSeqChild
);
115 void WriteAnimationNodeCommonPropsStart( ::sax_fastparser::FSHelperPtr pFS
, const ::com::sun::star::uno::Reference
< ::com::sun::star::animations::XAnimationNode
>& rXNode
, sal_Bool bSingle
, sal_Bool bMainSeqChild
);
116 void WriteAnimationProperty( ::sax_fastparser::FSHelperPtr pFS
, const ::com::sun::star::uno::Any
& rAny
);
117 void WriteAnimationTarget( ::sax_fastparser::FSHelperPtr pFS
, ::com::sun::star::uno::Any aTarget
);
118 bool WriteComments( sal_uInt32 nPageNum
);
119 void ImplWriteBackground( ::sax_fastparser::FSHelperPtr pFS
, ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> aXBackgroundPropSet
);
120 void WriteTransition( ::sax_fastparser::FSHelperPtr pFS
);
122 sal_Int32
GetLayoutFileId( sal_Int32 nOffset
, sal_uInt32 nMasterNum
);
125 void WriteShapeTree( ::sax_fastparser::FSHelperPtr pFS
, PageType ePageType
, sal_Bool bMaster
);
127 sal_uInt32
GetNewSlideId() { return mnSlideIdMax
++; }
128 sal_uInt32
GetNewSlideMasterId() { return mnSlideMasterIdMax
++; }
129 sal_Int32
GetAuthorIdAndLastIndex( OUString sAuthor
, sal_Int32
& nLastIndex
);
132 void AddLayoutIdAndRelation( ::sax_fastparser::FSHelperPtr pFS
, sal_Int32 nLayoutFileId
);
134 virtual OUString
implGetImplementationName() const;
136 ::boost::shared_ptr
< ::oox::drawingml::chart::ChartConverter
> mxChartConv
;
138 ::sax_fastparser::FSHelperPtr mPresentationFS
;
140 LayoutInfo mLayoutInfo
[EPP_LAYOUT_SIZE
];
141 std::vector
< ::sax_fastparser::FSHelperPtr
> mpSlidesFSArray
;
142 std::vector
< ::sax_fastparser::FSHelperPtr
> mpMasterFSArray
;
143 sal_Int32 mnLayoutFileIdMax
;
145 sal_uInt32 mnSlideIdMax
;
146 sal_uInt32 mnSlideMasterIdMax
;
147 sal_uInt32 mnAnimationNodeIdMax
;
149 sal_Bool mbCreateNotes
;
151 static sal_Int32 nStyleLevelToken
[5];
153 ::oox::drawingml::ShapeExport::ShapeHashMap maShapeMap
;
155 struct AuthorComments
{
157 sal_Int32 nLastIndex
;
159 typedef ::boost::unordered_map
< OUString
, struct AuthorComments
, OUStringHash
, comphelper::UStringEqual
> AuthorsMap
;
160 AuthorsMap maAuthors
;
170 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */