fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / filter / source / flash / swfexporter.hxx
blob8e95687fb22c503bff855305a343026fd53bacc1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
33 #include <vector>
34 #include <map>
36 #include <stdio.h>
38 typedef ::std::map<sal_uInt32, sal_uInt16> ChecksumCache;
40 class GDIMetaFile;
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);
52 namespace swf {
54 class Writer;
55 // -----------------------------------------------------------------------------
57 class ShapeInfo
59 public:
60 sal_uInt16 mnID; // the character id for the sprite definition of this shape
62 sal_Int32 mnX;
63 sal_Int32 mnY;
65 sal_Int32 mnWidth;
66 sal_Int32 mnHeight;
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;
75 OUString maBookmark;
77 sal_Int32 mnDimColor;
78 sal_Bool mbDimHide;
79 sal_Bool mbDimPrev;
81 sal_Bool mbSoundOn;
82 sal_Bool mbPlayFull;
83 OUString maSoundURL;
85 sal_Int32 mnBlueScreenColor;
87 ShapeInfo() :
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 ),
92 mnPresOrder( 0 ),
93 meClickAction( ::com::sun::star::presentation::ClickAction_NONE ),
94 mnDimColor( 0 ),
95 mbDimHide( false ),
96 mbDimPrev( false ),
97 mbSoundOn( false ),
98 mbPlayFull( false ),
99 mnBlueScreenColor( 0 ) {}
102 typedef ::std::vector<ShapeInfo*> ShapeInfoVector;
104 // -----------------------------------------------------------------------------
106 struct ShapeAnimationInfo
108 ShapeInfo* mpShapeInfo;
109 sal_uInt16 mnDepth;
111 ShapeAnimationInfo( ShapeInfo* pShapeInfo, sal_uInt16 nDepth ) : mpShapeInfo( pShapeInfo ), mnDepth( nDepth ) {}
114 typedef std::vector<ShapeAnimationInfo> ShapeAnimationInfoVector;
116 // -----------------------------------------------------------------------------
118 struct PageInfo
120 ::com::sun::star::presentation::FadeEffect meFadeEffect;
121 ::com::sun::star::presentation::AnimationSpeed meFadeSpeed;
123 sal_Int32 mnDuration;
124 sal_Int32 mnChange;
126 sal_uInt16 mnBackgroundID;
127 sal_uInt16 mnObjectsID;
128 sal_uInt16 mnForegroundID;
130 sal_Bool mbBackgroundVisible;
131 sal_Bool mbBackgroundObjectsVisible;
133 ShapeInfoVector maShapesVector;
135 PageInfo();
136 ~PageInfo();
138 #ifdef THEFUTURE
139 void addShape( ShapeInfo* pShapeInfo );
140 #endif
144 // -----------------------------------------------------------------------------
146 typedef ::std::map<sal_uInt32, PageInfo> PageInfoMap;
148 // -----------------------------------------------------------------------------
150 class FlashExporter
152 public:
153 FlashExporter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, sal_Int32 nJPEGCompressMode = -1, sal_Bool bExportOLEAsJPEG = false);
154 ~FlashExporter();
156 void Flush();
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 );
163 #ifdef AUGUSTUS
164 sal_Bool exportSound( com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > &xOutputStream, const char* wavfilename );
165 #endif
167 ChecksumCache gMasterCache;
168 ChecksumCache gPrivateCache;
169 ChecksumCache gObjectCache;
170 ChecksumCache gMetafileCache;
172 private:
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 );
193 Writer* mpWriter;
195 sal_Int32 mnDocWidth;
196 sal_Int32 mnDocHeight;
198 sal_Int32 mnJPEGcompressMode;
200 sal_Bool mbExportOLEAsJPEG;
202 sal_Bool mbPresentation;
204 sal_Int32 mnPageNumber;
209 #endif
211 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */