LibreOffice Module sw (master) 1
xmlexp.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_SW_SOURCE_FILTER_XML_XMLEXP_HXX
21#define INCLUDED_SW_SOURCE_FILTER_XML_XMLEXP_HXX
22
23#include <xmloff/xmlexp.hxx>
24#include "xmlitmap.hxx"
25#include <xmloff/xmltoken.hxx>
26
27#include <optional>
28#include <string_view>
29#include <vector>
30
31class SwDoc;
32class SwFormat;
33class SwFrameFormat;
37class SwTableLine;
38class SwTableLines;
39class SwTableBox;
45class SwTableNode;
48
49typedef std::vector< SwXMLTableLines_Impl* > SwXMLTableLinesCache_Impl;
50
52{
53 std::unique_ptr<SvXMLUnitConverter> m_pTwipUnitConverter;
54 std::unique_ptr<SvXMLExportItemMapper> m_pTableItemMapper;
55 std::unique_ptr<SwXMLTableLinesCache_Impl> m_pTableLines;
56
60
61 bool m_bBlock : 1; // export text block?
64
65 SwDoc* m_pDoc; // cached for getDoc()
66
67 void InitItemExport();
68 void FinitItemExport();
69 void ExportTableLinesAutoStyles( const SwTableLines& rLines,
70 sal_uInt32 nAbsWidth,
71 sal_uInt32 nBaseWidth,
72 std::u16string_view rNamePrefix,
76 SwXMLTableInfo_Impl& rTableInfo,
77 bool bTop=false );
78
79 void ExportFormat(const SwFormat& rFormat, enum ::xmloff::token::XMLTokenEnum eClass,
80 ::std::optional<OUString> const oStyleName);
81 void ExportTableFormat( const SwFrameFormat& rFormat, sal_uInt32 nAbsWidth );
82
84 void ExportTableBox( const SwTableBox& rBox, sal_uInt32 nColSpan, sal_uInt32 nRowSpan,
85 SwXMLTableInfo_Impl& rTableInfo );
86 void ExportTableLine( const SwTableLine& rLine,
87 const SwXMLTableLines_Impl& rLines,
88 SwXMLTableInfo_Impl& rTableInfo );
89 void ExportTableLines( const SwTableLines& rLines,
90 SwXMLTableInfo_Impl& rTableInfo,
91 sal_uInt32 nHeaderRows = 0 );
92
93 void ExportThemeElement(const css::uno::Reference<css::drawing::XDrawPage>& xDrawPage);
94
95
96 virtual void ExportMeta_() override;
97 virtual void ExportFontDecls_() override;
98 virtual void ExportStyles_( bool bUsed ) override;
99 virtual void ExportAutoStyles_() override;
100 virtual void ExportMasterStyles_() override;
101 virtual void SetBodyAttributes() override;
102 virtual void ExportContent_() override;
103 virtual void GetViewSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override;
104 virtual void GetConfigurationSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override;
105 virtual sal_Int32 GetDocumentSpecificSettings( std::vector< SettingsGroup >& _out_rSettings ) override;
106
107private:
108 void DeleteTableLines();
109protected:
110
112 virtual SvXMLAutoStylePoolP* CreateAutoStylePool() override;
113 virtual XMLPageExport* CreatePageExport() override;
114 virtual XMLShapeExport* CreateShapeExport() override;
116
117public:
119 const css::uno::Reference< css::uno::XComponentContext >& rContext,
120 OUString const & implementationName, SvXMLExportFlags nExportFlags);
121
122 virtual ~SwXMLExport() override;
123
124 void collectAutoStyles() override;
125
126 virtual ErrCode exportDoc( enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID ) override;
127
128 inline const SvXMLUnitConverter& GetTwipUnitConverter() const;
129
130 void ExportTableAutoStyles( const SwTableNode& rTableNd );
131 void ExportTable( const SwTableNode& rTableNd );
132
133 bool IsShowProgress() const { return m_bShowProgress; }
134 void SetShowProgress( bool b ) { m_bShowProgress = b; }
135
136 const SwDoc* getDoc() const;
137 SwDoc* getDoc();
138};
139
141{
142 return *m_pTwipUnitConverter;
143}
144
145#endif // INCLUDED_SW_SOURCE_FILTER_XML_XMLEXP_HXX
146
147/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:197
Base class for various Writer styles.
Definition: format.hxx:47
Style of a layout element.
Definition: frmfmt.hxx:72
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:443
SwTableLine is one table row in the document model.
Definition: swtable.hxx:376
virtual void SetBodyAttributes() override
Definition: xmlexp.cxx:449
virtual XMLTextParagraphExport * CreateTextParagraphExport() override
Definition: xmlexp.cxx:306
SvXMLItemMapEntriesRef m_xTableCellItemMap
Definition: xmlexp.hxx:59
virtual SvXMLAutoStylePoolP * CreateAutoStylePool() override
Definition: xmlfmte.cxx:422
std::unique_ptr< SwXMLTableLinesCache_Impl > m_pTableLines
Definition: xmlexp.hxx:55
void ExportTableAutoStyles(const SwTableNode &rTableNd)
Definition: xmltble.cxx:747
virtual void ExportContent_() override
Definition: xmlexp.cxx:463
virtual ErrCode exportDoc(enum ::xmloff::token::XMLTokenEnum eClass=::xmloff::token::XML_TOKEN_INVALID) override
Definition: xmlexp.cxx:96
SvXMLItemMapEntriesRef m_xTableItemMap
Definition: xmlexp.hxx:57
virtual XMLShapeExport * CreateShapeExport() override
Definition: xmlexp.cxx:311
const SvXMLUnitConverter & GetTwipUnitConverter() const
Definition: xmlexp.hxx:140
void ExportTableFormat(const SwFrameFormat &rFormat, sal_uInt32 nAbsWidth)
Definition: xmliteme.cxx:239
virtual void ExportMasterStyles_() override
Definition: xmlfmte.cxx:332
void ExportTableColumnStyle(const SwXMLTableColumn_Impl &rCol)
Definition: xmltble.cxx:541
void ExportTableBox(const SwTableBox &rBox, sal_uInt32 nColSpan, sal_uInt32 nRowSpan, SwXMLTableInfo_Impl &rTableInfo)
Definition: xmltble.cxx:790
bool IsShowProgress() const
Definition: xmlexp.hxx:133
void ExportTable(const SwTableNode &rTableNd)
Definition: xmltble.cxx:1106
virtual void GetViewSettings(css::uno::Sequence< css::beans::PropertyValue > &aProps) override
Definition: xmlexp.cxx:336
SwXMLExport(const css::uno::Reference< css::uno::XComponentContext > &rContext, OUString const &implementationName, SvXMLExportFlags nExportFlags)
Definition: xmlexp.cxx:83
void ExportFormat(const SwFormat &rFormat, enum ::xmloff::token::XMLTokenEnum eClass, ::std::optional< OUString > const oStyleName)
Definition: xmlfmte.cxx:59
SwDoc * m_pDoc
Definition: xmlexp.hxx:65
const SwDoc * getDoc() const
Definition: xmlexp.cxx:533
SvXMLItemMapEntriesRef m_xTableRowItemMap
Definition: xmlexp.hxx:58
virtual XMLFontAutoStylePool * CreateFontAutoStylePool() override
Definition: xmlfonte.cxx:79
bool m_bShowProgress
Definition: xmlexp.hxx:62
void FinitItemExport()
Definition: xmliteme.cxx:233
void ExportTableLinesAutoStyles(const SwTableLines &rLines, sal_uInt32 nAbsWidth, sal_uInt32 nBaseWidth, std::u16string_view rNamePrefix, SwXMLTableColumnsSortByWidth_Impl &rExpCols, SwXMLTableFrameFormatsSort_Impl &rExpRows, SwXMLTableFrameFormatsSort_Impl &rExpCells, SwXMLTableInfo_Impl &rTableInfo, bool bTop=false)
Definition: xmltble.cxx:582
virtual sal_Int32 GetDocumentSpecificSettings(std::vector< SettingsGroup > &_out_rSettings) override
Definition: xmlexp.cxx:432
virtual void ExportMeta_() override
Definition: xmlmeta.cxx:164
std::unique_ptr< SvXMLUnitConverter > m_pTwipUnitConverter
Definition: xmlexp.hxx:53
virtual void ExportStyles_(bool bUsed) override
Definition: xmlfmte.cxx:168
void SetShowProgress(bool b)
Definition: xmlexp.hxx:134
bool m_bBlock
Definition: xmlexp.hxx:61
void InitItemExport()
Definition: xmliteme.cxx:220
virtual XMLPageExport * CreatePageExport() override
Definition: xmlfmte.cxx:327
virtual void ExportFontDecls_() override
Definition: xmlexp.cxx:330
std::unique_ptr< SvXMLExportItemMapper > m_pTableItemMapper
Definition: xmlexp.hxx:54
virtual void GetConfigurationSettings(css::uno::Sequence< css::beans::PropertyValue > &aProps) override
Definition: xmlexp.cxx:387
virtual void ExportAutoStyles_() override
Definition: xmlfmte.cxx:297
void DeleteTableLines()
Definition: xmltble.cxx:1265
void ExportTableLines(const SwTableLines &rLines, SwXMLTableInfo_Impl &rTableInfo, sal_uInt32 nHeaderRows=0)
Definition: xmltble.cxx:1016
void ExportThemeElement(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage)
Definition: xmlfmte.cxx:194
bool m_bSavedShowChanges
Definition: xmlexp.hxx:63
void ExportTableLine(const SwTableLine &rLine, const SwXMLTableLines_Impl &rLines, SwXMLTableInfo_Impl &rTableInfo)
Definition: xmltble.cxx:924
void collectAutoStyles() override
Definition: xmlfmte.cxx:251
virtual ~SwXMLExport() override
Definition: xmlexp.cxx:324
SvXMLExportFlags
std::vector< SwXMLTableLines_Impl * > SwXMLTableLinesCache_Impl
Definition: xmlexp.hxx:47