LibreOffice Module xmloff (master)  1
sdxmlexp_impl.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_XMLOFF_SOURCE_DRAW_SDXMLEXP_IMPL_HXX
21 #define INCLUDED_XMLOFF_SOURCE_DRAW_SDXMLEXP_IMPL_HXX
22 
23 #include <xmloff/xmlexp.hxx>
24 
25 #include <com/sun/star/container/XNameAccess.hpp>
26 #include <com/sun/star/drawing/XDrawPage.hpp>
27 
28 #include <o3tl/sorted_vector.hxx>
29 #include <vector>
30 
31 namespace tools { class Rectangle; }
32 
38 
39 typedef ::std::vector< ImpXMLEXPPageMasterInfo* > ImpXMLEXPPageMasterList;
40 
42 {
55 };
56 
58 
60 {
64 };
65 
67 {
68  OUString maStrText;
69  bool mbFixed;
70  sal_Int32 mnFormat;
71 };
72 
73 class SdXMLExport : public SvXMLExport
74 {
75  css::uno::Reference< css::container::XNameAccess > mxDocStyleFamilies;
76  css::uno::Reference< css::container::XIndexAccess > mxDocMasterPages;
77  css::uno::Reference< css::container::XIndexAccess > mxDocDrawPages;
79  sal_Int32 mnDocDrawPageCount;
80  sal_uInt32 mnObjectCount;
81 
82  // temporary infos
83  std::vector< std::unique_ptr<ImpXMLEXPPageMasterInfo> > mvPageMasterInfoList;
87  std::vector< std::unique_ptr<ImpXMLAutoLayoutInfo> > mvAutoLayoutInfoList;
88 
89  css::uno::Sequence< OUString > maDrawPagesAutoLayoutNames;
90 
91  ::std::vector< OUString > maDrawPagesStyleNames;
92  ::std::vector< OUString > maDrawNotesPagesStyleNames;
93  ::std::vector< OUString > maMasterPagesStyleNames;
95  ::std::vector< HeaderFooterPageSettingsImpl > maDrawPagesHeaderFooterSettings;
96  ::std::vector< HeaderFooterPageSettingsImpl > maDrawNotesPagesHeaderFooterSettings;
97 
98  ::std::vector< OUString > maHeaderDeclsVector;
99  ::std::vector< OUString > maFooterDeclsVector;
100  ::std::vector< DateTimeDeclImpl > maDateTimeDeclsVector;
101 
103 
107 
108  SdXMLFormatMap maUsedDateStyles; // this is a vector with the used formattings for date fields
109  SdXMLFormatMap maUsedTimeStyles; // this is a vector with the used formattings for time fields
110 
111  bool mbIsDraw;
112 
113  virtual void ExportStyles_(bool bUsed) override;
114  virtual void ExportAutoStyles_() override;
115  virtual void ExportFontDecls_() override;
116  virtual void ExportMasterStyles_() override;
117  virtual void ExportContent_() override;
118  virtual void ExportMeta_() override;
119 
120  ImpXMLEXPPageMasterInfo* ImpGetOrCreatePageMasterInfo( const css::uno::Reference< css::drawing::XDrawPage >& xMasterPage );
121  void ImpPrepPageMasterInfos();
123  void ImpPrepAutoLayoutInfos();
124  HeaderFooterPageSettingsImpl ImpPrepDrawPageHeaderFooterDecls( const css::uno::Reference< css::drawing::XDrawPage >& xDrawPage );
125  ImpXMLEXPPageMasterInfo* ImpGetPageMasterInfoByName(const OUString& rName);
126 
127  void ImpPrepDrawPageInfos();
128  void ImpPrepMasterPageInfos();
130  OUString ImpCreatePresPageStyleName( const css::uno::Reference<css::drawing::XDrawPage>& xDrawPage, bool bExportBackground = true );
131 
132  bool ImpPrepAutoLayoutInfo(const css::uno::Reference< css::drawing::XDrawPage >& xPage, OUString& rName);
137 
138  void exportFormsElement( const css::uno::Reference< css::drawing::XDrawPage >& xDrawPage );
140 
141  // #82003# helper function for recursive object count
142  sal_uInt32 ImpRecursiveObjectCount( const css::uno::Reference< css::drawing::XShapes >& xShapes);
143 
144  OUString getNavigationOrder( const css::uno::Reference< css::drawing::XDrawPage >& xDrawPage );
145 
146  void collectAnnotationAutoStyles( const css::uno::Reference< css::drawing::XDrawPage >& xDrawPage );
147  void exportAnnotations( const css::uno::Reference< css::drawing::XDrawPage >& xDrawPage );
148 
149 protected:
150  virtual void GetViewSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override;
151  virtual void GetConfigurationSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override;
152  virtual XMLFontAutoStylePool* CreateFontAutoStylePool() override;
153 
154 public:
155  SdXMLExport(
156  const css::uno::Reference< css::uno::XComponentContext >& xContext,
157  OUString const & implementationName,
158  bool bIsDraw, SvXMLExportFlags nExportFlags );
159  virtual ~SdXMLExport() override;
160 
161  void collectAutoStyles() override;
162 
163  // XExporter
164  virtual void SAL_CALL setSourceDocument( const css::uno::Reference< css::lang::XComponent >& xDoc ) override;
165 
166  // get factories and mappers
167  XMLShapeExportPropertyMapper* GetPropertySetMapper() const { return mpPropertySetMapper.get(); }
168  XMLPageExportPropertyMapper* GetPresPagePropsMapper() const { return mpPresPagePropsMapper.get(); }
169 
170  bool IsDraw() const { return mbIsDraw; }
171  bool IsImpress() const { return !mbIsDraw; }
172 
173  virtual void addDataStyle(const sal_Int32 nNumberFormat, bool bTimeFormat = false ) override;
174  virtual void exportDataStyles() override;
175  virtual void exportAutoDataStyles() override;
176  virtual OUString getDataStyleName(const sal_Int32 nNumberFormat, bool bTimeFormat = false ) const override;
177 };
178 
179 #endif // _SDXMLEXP_HXX
180 
181 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void ExportMasterStyles_() override
Override this method to export the contents of .
Definition: sdxmlexp.cxx:2217
css::uno::Reference< css::container::XIndexAccess > mxDocDrawPages
ImpXMLEXPPageMasterList mvPageMasterUsageList
XmlPlaceholder
OUString getNavigationOrder(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage)
Definition: sdxmlexp.cxx:2439
void ImpWriteAutoLayoutInfos()
Definition: sdxmlexp.cxx:705
SdXMLExport(const css::uno::Reference< css::uno::XComponentContext > &xContext, OUString const &implementationName, bool bIsDraw, SvXMLExportFlags nExportFlags)
Definition: sdxmlexp.cxx:373
bool ImpPrepAutoLayoutInfo(const css::uno::Reference< css::drawing::XDrawPage > &xPage, OUString &rName)
Definition: sdxmlexp.cxx:646
virtual void ExportStyles_(bool bUsed) override
Override this method to export the content of .
Definition: sdxmlexp.cxx:1986
sal_Int32 mnDocDrawPageCount
XMLPageExportPropertyMapper * GetPresPagePropsMapper() const
virtual OUString getDataStyleName(const sal_Int32 nNumberFormat, bool bTimeFormat=false) const override
Definition: sdxmlexp.cxx:2427
SvXMLExportFlags
Definition: xmlexp.hxx:89
void ImpWriteHeaderFooterDecls()
Definition: sdxmlexp.cxx:1413
bool IsImpress() const
XMLShapeExportPropertyMapper * GetPropertySetMapper() const
::std::vector< OUString > maMasterPagesStyleNames
rtl::Reference< XMLPageExportPropertyMapper > mpPresPagePropsMapper
OUString maHandoutMasterStyleName
bool IsDraw() const
void ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl, const tools::Rectangle &rRect)
Definition: sdxmlexp.cxx:1090
sal_uInt32 ImpRecursiveObjectCount(const css::uno::Reference< css::drawing::XShapes > &xShapes)
Definition: sdxmlexp.cxx:569
void ImpWritePresentationStyles()
Definition: sdxmlexp.cxx:1575
virtual void exportAutoDataStyles() override
Definition: sdxmlexp.cxx:2415
HeaderFooterPageSettingsImpl ImpPrepDrawPageHeaderFooterDecls(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage)
Definition: sdxmlexp.cxx:1361
::std::vector< OUString > maHeaderDeclsVector
virtual void ExportContent_() override
Override this method to export the content of .
Definition: sdxmlexp.cxx:1627
ImpXMLEXPPageMasterList mvNotesPageMasterUsageList
::std::vector< OUString > maDrawNotesPagesStyleNames
::std::vector< ImpXMLEXPPageMasterInfo * > ImpXMLEXPPageMasterList
css::uno::Reference< css::container::XNameAccess > mxDocStyleFamilies
void ImpPrepDrawPageInfos()
Definition: sdxmlexp.cxx:1292
virtual void SAL_CALL setSourceDocument(const css::uno::Reference< css::lang::XComponent > &xDoc) override
Definition: sdxmlexp.cxx:389
::std::vector< HeaderFooterPageSettingsImpl > maDrawPagesHeaderFooterSettings
std::vector< std::unique_ptr< ImpXMLAutoLayoutInfo > > mvAutoLayoutInfoList
ImpXMLEXPPageMasterInfo * ImpGetOrCreatePageMasterInfo(const css::uno::Reference< css::drawing::XDrawPage > &xMasterPage)
Definition: sdxmlexp.cxx:1137
void exportFormsElement(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage)
Definition: sdxmlexp.cxx:2334
void collectAnnotationAutoStyles(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage)
Definition: sdxmlexp.cxx:2472
virtual void GetConfigurationSettings(css::uno::Sequence< css::beans::PropertyValue > &aProps) override
Definition: sdxmlexp.cxx:2376
sal_Int32 mnDocMasterPageCount
o3tl::sorted_vector< sal_Int32 > SdXMLFormatMap
OUString ImpCreatePresPageStyleName(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage, bool bExportBackground=true)
Definition: sdxmlexp.cxx:1488
::std::vector< DateTimeDeclImpl > maDateTimeDeclsVector
css::uno::Reference< css::container::XIndexAccess > mxDocMasterPages
void exportPresentationSettings()
Definition: sdxmlexp.cxx:1806
css::uno::Sequence< OUString > maDrawPagesAutoLayoutNames
HeaderFooterPageSettingsImpl maHandoutPageHeaderFooterSettings
std::vector< std::unique_ptr< ImpXMLEXPPageMasterInfo > > mvPageMasterInfoList
SdXMLFormatMap maUsedDateStyles
virtual void ExportAutoStyles_() override
Override this method to export the contents of .
Definition: sdxmlexp.cxx:2192
::std::vector< OUString > maDrawPagesStyleNames
::std::vector< HeaderFooterPageSettingsImpl > maDrawNotesPagesHeaderFooterSettings
void ImpPrepMasterPageInfos()
Definition: sdxmlexp.cxx:1546
sal_uInt32 mnObjectCount
void ImpPrepPageMasterInfos()
Definition: sdxmlexp.cxx:1162
void collectAutoStyles() override
Definition: sdxmlexp.cxx:2021
virtual void ExportMeta_() override
Override this method to export the content of .
Definition: sdxmlexp.cxx:1604
virtual void exportDataStyles() override
Definition: sdxmlexp.cxx:2410
virtual void ExportFontDecls_() override
Override this method to export the font declarations The default implementation will export the conte...
Definition: sdxmlexp.cxx:1621
virtual void addDataStyle(const sal_Int32 nNumberFormat, bool bTimeFormat=false) override
Definition: sdxmlexp.cxx:2394
virtual XMLFontAutoStylePool * CreateFontAutoStylePool() override
Definition: sdxmlexp.cxx:2732
ImpXMLEXPPageMasterInfo * mpHandoutPageMaster
void ImpPrepAutoLayoutInfos()
Definition: sdxmlexp.cxx:614
void ImplExportHeaderFooterDeclAttributes(const HeaderFooterPageSettingsImpl &aSettings)
Definition: sdxmlexp.cxx:1476
::std::vector< OUString > maFooterDeclsVector
virtual void GetViewSettings(css::uno::Sequence< css::beans::PropertyValue > &aProps) override
Definition: sdxmlexp.cxx:2353
void exportAnnotations(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage)
Definition: sdxmlexp.cxx:2498
ImpXMLEXPPageMasterInfo * ImpGetPageMasterInfoByName(const OUString &rName)
Definition: sdxmlexp.cxx:1274
rtl::Reference< XMLSdPropHdlFactory > mpSdPropHdlFactory
rtl::Reference< XMLShapeExportPropertyMapper > mpPropertySetMapper
virtual ~SdXMLExport() override
Definition: sdxmlexp.cxx:597
SdXMLFormatMap maUsedTimeStyles
void ImpWritePageMasterInfos()
Definition: sdxmlexp.cxx:1210