Bump version to 6.4-15
[LibreOffice.git] / filter / source / flash / swfexporter.hxx
blobf39f4c6a0a0b1319aa37767da0706f9a20c2b2d7
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 INCLUDED_FILTER_SOURCE_FLASH_SWFEXPORTER_HXX
20 #define INCLUDED_FILTER_SOURCE_FLASH_SWFEXPORTER_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 <vcl/checksum.hxx>
29 #include <vector>
30 #include <map>
31 #include <memory>
33 typedef ::std::map<BitmapChecksum, sal_uInt16> ChecksumCache;
35 class GDIMetaFile;
37 namespace swf {
39 class Writer;
42 class ShapeInfo
44 public:
45 sal_uInt16 mnID; // the character id for the sprite definition of this shape
47 sal_Int32 mnX;
48 sal_Int32 mnY;
50 sal_Int32 mnWidth;
51 sal_Int32 mnHeight;
53 ShapeInfo() :
54 mnID(0), mnX(0), mnY(0), mnWidth(0), mnHeight(0) {}
58 struct PageInfo
60 sal_uInt16 mnBackgroundID;
61 sal_uInt16 mnObjectsID;
62 sal_uInt16 mnForegroundID;
64 PageInfo();
65 ~PageInfo();
69 class FlashExporter
71 public:
72 FlashExporter(
73 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
75 // #i56084# variables for selection export
76 const css::uno::Reference< css::drawing::XShapes >& rxSelectedShapes,
77 const css::uno::Reference< css::drawing::XDrawPage >& rxSelectedDrawPage,
79 sal_Int32 nJPEGCompressMode,
80 bool bExportOLEAsJPEG);
81 ~FlashExporter();
83 void Flush();
85 bool exportAll( const css::uno::Reference< css::lang::XComponent >& xDoc, css::uno::Reference< css::io::XOutputStream > const &xOutputStream, css::uno::Reference< css::task::XStatusIndicator> const &xStatusIndicator );
86 bool exportSlides( const css::uno::Reference< css::drawing::XDrawPage >& xDrawPage, css::uno::Reference< css::io::XOutputStream > const &xOutputStream);
87 sal_uInt16 exportBackgrounds( const css::uno::Reference< css::drawing::XDrawPage >& xDrawPage, css::uno::Reference< css::io::XOutputStream > const &xOutputStream, sal_uInt16 nPage, bool bExportObjects );
88 sal_uInt16 exportBackgrounds( css::uno::Reference< css::drawing::XDrawPage > const & xDrawPage, sal_uInt16 nPage, bool bExportObjects );
90 ChecksumCache gMasterCache;
91 ChecksumCache gPrivateCache;
92 ChecksumCache gObjectCache;
93 ChecksumCache gMetafileCache;
95 private:
96 css::uno::Reference< css::uno::XComponentContext > mxContext;
98 // #i56084# variables for selection export
99 const css::uno::Reference< css::drawing::XShapes > mxSelectedShapes;
100 const css::uno::Reference< css::drawing::XDrawPage > mxSelectedDrawPage;
101 bool mbExportSelection;
103 css::uno::Reference< css::drawing::XGraphicExportFilter > mxGraphicExporter;
105 ::std::map<sal_uInt32, PageInfo> maPagesMap;
107 sal_uInt16 exportDrawPageBackground(sal_uInt16 nPage, css::uno::Reference< css::drawing::XDrawPage > const & xPage);
108 sal_uInt16 exportMasterPageObjects(sal_uInt16 nPage, css::uno::Reference< css::drawing::XDrawPage > const & xMasterPage);
110 void exportDrawPageContents( const css::uno::Reference< css::drawing::XDrawPage >& xPage, bool bStream, bool bMaster );
111 void exportShapes( const css::uno::Reference< css::drawing::XShapes >& xShapes, bool bStream, bool bMaster );
112 void exportShape( const css::uno::Reference< css::drawing::XShape >& xShape, bool bMaster);
114 BitmapChecksum ActionSummer(css::uno::Reference< css::drawing::XShape > const & xShape);
115 BitmapChecksum ActionSummer(css::uno::Reference< css::drawing::XShapes > const & xShapes);
117 bool getMetaFile( css::uno::Reference< css::lang::XComponent > const &xComponent, GDIMetaFile& rMtf, bool bOnlyBackground = false, bool bExportAsJPEG = false );
119 std::unique_ptr<Writer> mpWriter;
121 sal_Int32 mnDocWidth;
122 sal_Int32 mnDocHeight;
124 sal_Int32 mnJPEGcompressMode;
126 bool mbExportOLEAsJPEG;
128 bool mbPresentation;
130 sal_Int32 mnPageNumber;
135 #endif
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */