bump product version to 5.0.4.1
[LibreOffice.git] / xmloff / source / draw / sdxmlexp_impl.hxx
blobcff480cb0a8f2bb8afe18866d67fd613844088f6
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 .
20 #ifndef INCLUDED_XMLOFF_SOURCE_DRAW_SDXMLEXP_IMPL_HXX
21 #define INCLUDED_XMLOFF_SOURCE_DRAW_SDXMLEXP_IMPL_HXX
23 #include <xmloff/xmlexp.hxx>
25 #include <com/sun/star/frame/XModel.hpp>
26 #include <com/sun/star/task/XStatusIndicator.hpp>
27 #include <com/sun/star/container/XNameAccess.hpp>
28 #include <com/sun/star/drawing/XDrawPage.hpp>
30 #include <set>
31 #include <vector>
33 class Rectangle;
35 class ImpXMLEXPPageMasterInfo;
36 class ImpXMLAutoLayoutInfo;
37 class XMLSdPropHdlFactory;
38 class XMLShapeExportPropertyMapper;
39 class XMLPageExportPropertyMapper;
41 typedef ::std::vector< ImpXMLEXPPageMasterInfo* > ImpXMLEXPPageMasterList;
42 typedef ::std::vector< ImpXMLAutoLayoutInfo* > ImpXMLAutoLayoutInfoList;
44 enum XmlPlaceholder
46 XmlPlaceholderTitle,
47 XmlPlaceholderOutline,
48 XmlPlaceholderSubtitle,
49 XmlPlaceholderText,
50 XmlPlaceholderGraphic,
51 XmlPlaceholderObject,
52 XmlPlaceholderChart,
53 XmlPlaceholderOrgchart,
54 XmlPlaceholderTable,
55 XmlPlaceholderPage,
56 XmlPlaceholderNotes,
57 XmlPlaceholderHandout,
58 XmlPlaceholderVerticalTitle,
59 XmlPlaceholderVerticalOutline
62 typedef std::set<sal_Int32> SdXMLFormatMap;
64 struct HeaderFooterPageSettingsImpl
66 OUString maStrHeaderDeclName;
67 OUString maStrFooterDeclName;
68 OUString maStrDateTimeDeclName;
71 struct DateTimeDeclImpl
73 OUString maStrText;
74 bool mbFixed;
75 sal_Int32 mnFormat;
78 class SdXMLExport : public SvXMLExport
80 com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > mxDocStyleFamilies;
81 com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > mxDocMasterPages;
82 com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > mxDocDrawPages;
83 sal_Int32 mnDocMasterPageCount;
84 sal_Int32 mnDocDrawPageCount;
85 sal_uInt32 mnShapeStyleInfoIndex;
86 sal_uInt32 mnObjectCount;
88 // temporary infos
89 ImpXMLEXPPageMasterList* mpPageMasterInfoList;
90 ImpXMLEXPPageMasterList* mpPageMasterUsageList;
91 ImpXMLEXPPageMasterList* mpNotesPageMasterUsageList;
92 ImpXMLEXPPageMasterInfo* mpHandoutPageMaster;
93 ImpXMLAutoLayoutInfoList* mpAutoLayoutInfoList;
95 com::sun::star::uno::Sequence< OUString > maDrawPagesAutoLayoutNames;
97 ::std::vector< OUString > maDrawPagesStyleNames;
98 ::std::vector< OUString > maDrawNotesPagesStyleNames;
99 ::std::vector< OUString > maMasterPagesStyleNames;
100 OUString maHandoutMasterStyleName;
101 ::std::vector< HeaderFooterPageSettingsImpl > maDrawPagesHeaderFooterSettings;
102 ::std::vector< HeaderFooterPageSettingsImpl > maDrawNotesPagesHeaderFooterSettings;
104 ::std::vector< OUString > maHeaderDeclsVector;
105 ::std::vector< OUString > maFooterDeclsVector;
106 ::std::vector< DateTimeDeclImpl > maDateTimeDeclsVector;
108 HeaderFooterPageSettingsImpl maHandoutPageHeaderFooterSettings;
110 XMLSdPropHdlFactory* mpSdPropHdlFactory;
111 XMLShapeExportPropertyMapper* mpPropertySetMapper;
112 XMLPageExportPropertyMapper* mpPresPagePropsMapper;
114 SdXMLFormatMap maUsedDateStyles; // this is a vector with the used formatings for date fields
115 SdXMLFormatMap maUsedTimeStyles; // this is a vector with the used formatings for time fields
117 bool mbIsDraw;
118 bool mbFamilyGraphicUsed;
119 bool mbFamilyPresentationUsed;
121 const OUString msZIndex;
122 const OUString msEmptyPres;
123 const OUString msModel;
124 const OUString msStartShape;
125 const OUString msEndShape;
126 const OUString msPageLayoutNames;
128 virtual void _ExportStyles(bool bUsed) SAL_OVERRIDE;
129 virtual void _ExportAutoStyles() SAL_OVERRIDE;
130 virtual void _ExportFontDecls() SAL_OVERRIDE;
131 virtual void _ExportMasterStyles() SAL_OVERRIDE;
132 virtual void _ExportContent() SAL_OVERRIDE;
133 // #82003#
134 virtual void _ExportMeta() SAL_OVERRIDE;
136 ImpXMLEXPPageMasterInfo* ImpGetOrCreatePageMasterInfo( com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > xMasterPage );
137 void ImpPrepPageMasterInfos();
138 void ImpPrepDrawMasterInfos();
139 void ImpWritePageMasterInfos();
140 void ImpPrepAutoLayoutInfos();
141 HeaderFooterPageSettingsImpl ImpPrepDrawPageHeaderFooterDecls( const com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >& xDrawPage );
142 ImpXMLEXPPageMasterInfo* ImpGetPageMasterInfoByName(const OUString& rName);
144 void ImpPrepDrawPageInfos();
145 void ImpPrepMasterPageInfos();
146 void ImpWritePresentationStyles();
147 OUString ImpCreatePresPageStyleName( com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage> xDrawPage, bool bExportBackground = true );
149 bool ImpPrepAutoLayoutInfo(const com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >& xPage, OUString& rName);
150 void ImpWriteAutoLayoutInfos();
151 void ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl, const Rectangle& rRect);
152 void ImpWriteHeaderFooterDecls();
153 void ImplExportHeaderFooterDeclAttributes( const HeaderFooterPageSettingsImpl& aSettings );
155 void exportFormsElement( com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > xDrawPage );
156 void exportPresentationSettings();
158 // #82003# helper function for recursive object count
159 sal_uInt32 ImpRecursiveObjectCount( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xShapes);
161 OUString getNavigationOrder( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
163 void collectAnnotationAutoStyles( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
164 void exportAnnotations( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
166 protected:
167 virtual void GetViewSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps) SAL_OVERRIDE;
168 virtual void GetConfigurationSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps) SAL_OVERRIDE;
169 virtual XMLFontAutoStylePool* CreateFontAutoStylePool() SAL_OVERRIDE;
171 public:
172 SdXMLExport(
173 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
174 OUString const & implementationName,
175 bool bIsDraw, SvXMLExportFlags nExportFlags = SvXMLExportFlags::ALL );
176 virtual ~SdXMLExport();
178 void SetProgress(sal_Int32 nProg);
180 // XExporter
181 virtual void SAL_CALL setSourceDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
183 // get factories and mappers
184 XMLSdPropHdlFactory* GetSdPropHdlFactory() const { return mpSdPropHdlFactory; }
185 XMLShapeExportPropertyMapper* GetPropertySetMapper() const { return mpPropertySetMapper; }
186 XMLPageExportPropertyMapper* GetPresPagePropsMapper() const { return mpPresPagePropsMapper; }
188 bool IsDraw() const { return mbIsDraw; }
189 bool IsImpress() const { return !mbIsDraw; }
191 bool IsFamilyGraphicUsed() const { return mbFamilyGraphicUsed; }
192 void SetFamilyGraphicUsed() { mbFamilyGraphicUsed = true; }
193 bool IsFamilyPresentationUsed() const { return mbFamilyPresentationUsed; }
194 void SetFamilyPresentationUsed() { mbFamilyPresentationUsed = true; }
196 virtual void addDataStyle(const sal_Int32 nNumberFormat, bool bTimeFormat = false ) SAL_OVERRIDE;
197 virtual void exportDataStyles() SAL_OVERRIDE;
198 virtual void exportAutoDataStyles() SAL_OVERRIDE;
199 virtual OUString getDataStyleName(const sal_Int32 nNumberFormat, bool bTimeFormat = false ) const SAL_OVERRIDE;
202 #endif // _SDXMLEXP_HXX
204 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */