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 .
19 #ifndef _FLASH_EXPORTER_HXX
20 #define _FLASH_EXPORTER_HXX
22 #include <com/sun/star/beans/XPropertySet.hpp>
23 #include <com/sun/star/lang/XComponent.hpp>
24 #include <com/sun/star/drawing/XDrawPage.hpp>
25 #include <com/sun/star/drawing/XGraphicExportFilter.hpp>
26 #include <com/sun/star/io/XOutputStream.hpp>
27 #include <com/sun/star/presentation/AnimationEffect.hpp>
28 #include <com/sun/star/presentation/AnimationSpeed.hpp>
29 #include <com/sun/star/presentation/ClickAction.hpp>
30 #include <com/sun/star/presentation/FadeEffect.hpp>
31 #include <osl/file.hxx>
38 typedef ::std::map
<sal_uInt32
, sal_uInt16
> ChecksumCache
;
42 inline OUString
STR(const sal_Char
* in
)
44 return OUString::createFromAscii(in
);
47 inline OUString
VAL(sal_Int32 in
)
49 return OUString::valueOf(in
);
55 // -----------------------------------------------------------------------------
60 sal_uInt16 mnID
; // the character id for the sprite definition of this shape
68 ::com::sun::star::presentation::AnimationEffect meEffect
;
69 ::com::sun::star::presentation::AnimationEffect meTextEffect
;
70 ::com::sun::star::presentation::AnimationSpeed meEffectSpeed
;
72 sal_Int32 mnPresOrder
;
74 ::com::sun::star::presentation::ClickAction meClickAction
;
85 sal_Int32 mnBlueScreenColor
;
88 mnID(0), mnX(0), mnY(0),
89 meEffect( ::com::sun::star::presentation::AnimationEffect_NONE
),
90 meTextEffect( ::com::sun::star::presentation::AnimationEffect_NONE
),
91 meEffectSpeed( ::com::sun::star::presentation::AnimationSpeed_MEDIUM
),
93 meClickAction( ::com::sun::star::presentation::ClickAction_NONE
),
99 mnBlueScreenColor( 0 ) {}
102 typedef ::std::vector
<ShapeInfo
*> ShapeInfoVector
;
104 // -----------------------------------------------------------------------------
106 struct ShapeAnimationInfo
108 ShapeInfo
* mpShapeInfo
;
111 ShapeAnimationInfo( ShapeInfo
* pShapeInfo
, sal_uInt16 nDepth
) : mpShapeInfo( pShapeInfo
), mnDepth( nDepth
) {}
114 typedef std::vector
<ShapeAnimationInfo
> ShapeAnimationInfoVector
;
116 // -----------------------------------------------------------------------------
120 ::com::sun::star::presentation::FadeEffect meFadeEffect
;
121 ::com::sun::star::presentation::AnimationSpeed meFadeSpeed
;
123 sal_Int32 mnDuration
;
126 sal_uInt16 mnBackgroundID
;
127 sal_uInt16 mnObjectsID
;
128 sal_uInt16 mnForegroundID
;
130 sal_Bool mbBackgroundVisible
;
131 sal_Bool mbBackgroundObjectsVisible
;
133 ShapeInfoVector maShapesVector
;
139 void addShape( ShapeInfo
* pShapeInfo
);
144 // -----------------------------------------------------------------------------
146 typedef ::std::map
<sal_uInt32
, PageInfo
> PageInfoMap
;
148 // -----------------------------------------------------------------------------
153 FlashExporter( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& rxContext
, sal_Int32 nJPEGCompressMode
= -1, sal_Bool bExportOLEAsJPEG
= false);
158 sal_Bool
exportAll( ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
> xDoc
, com::sun::star::uno::Reference
< com::sun::star::io::XOutputStream
> &xOutputStream
, ::com::sun::star::uno::Reference
< ::com::sun::star::task::XStatusIndicator
> &xStatusIndicator
);
159 sal_Bool
exportSlides( ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
> xDrawPage
, com::sun::star::uno::Reference
< com::sun::star::io::XOutputStream
> &xOutputStream
, sal_uInt16 nPage
);
160 sal_uInt16
exportBackgrounds( ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
> xDrawPage
, com::sun::star::uno::Reference
< com::sun::star::io::XOutputStream
> &xOutputStream
, sal_uInt16 nPage
, sal_Bool bExportObjects
);
161 sal_uInt16
exportBackgrounds( ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
> xDrawPage
, sal_uInt16 nPage
, sal_Bool bExportObjects
);
164 sal_Bool
exportSound( com::sun::star::uno::Reference
< com::sun::star::io::XOutputStream
> &xOutputStream
, const char* wavfilename
);
167 ChecksumCache gMasterCache
;
168 ChecksumCache gPrivateCache
;
169 ChecksumCache gObjectCache
;
170 ChecksumCache gMetafileCache
;
173 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> mxContext
;
174 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XGraphicExportFilter
> mxGraphicExporter
;
176 PageInfoMap maPagesMap
;
178 sal_uInt16
exportDrawPageBackground(sal_uInt16 nPage
, ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
>& xPage
);
179 sal_uInt16
exportMasterPageObjects(sal_uInt16 nPage
, ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
>& xMasterPage
);
181 void exportDrawPageContents( ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
>& xPage
, bool bStream
, bool bMaster
);
182 void exportShapes( ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapes
>& xShapes
, bool bStream
, bool bMaster
);
183 void exportShape( ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& xShape
, bool bMaster
);
185 sal_uInt32
ActionSummer(::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& xShape
);
186 sal_uInt32
ActionSummer(::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapes
>& xShapes
);
188 void animateShape( ShapeAnimationInfo
& rAnimInfo
);
189 void animatePage( PageInfo
* pPageInfo
);
191 bool getMetaFile( ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>&xComponent
, GDIMetaFile
& rMtf
, bool bOnlyBackground
= false, bool bExportAsJPEG
= false );
195 sal_Int32 mnDocWidth
;
196 sal_Int32 mnDocHeight
;
198 sal_Int32 mnJPEGcompressMode
;
200 sal_Bool mbExportOLEAsJPEG
;
202 sal_Bool mbPresentation
;
204 sal_Int32 mnPageNumber
;
211 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */