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 #include <vector>
27 
28 class SwDoc;
29 class SwFormat;
30 class SwFrameFormat;
31 class SvXMLUnitConverter;
34 class SwTableLine;
35 class SwTableLines;
36 class SwTableBox;
42 class SwTableNode;
45 
46 typedef std::vector< SwXMLTableLines_Impl* > SwXMLTableLinesCache_Impl;
47 
48 class SwXMLExport : public SvXMLExport
49 {
50  std::unique_ptr<SvXMLUnitConverter> m_pTwipUnitConverter;
51  std::unique_ptr<SvXMLExportItemMapper> m_pTableItemMapper;
52  std::unique_ptr<SwXMLTableLinesCache_Impl> m_pTableLines;
53 
57 
58  bool m_bBlock : 1; // export text block?
59  bool m_bShowProgress : 1;
61 
62  SwDoc* m_pDoc; // cached for getDoc()
63 
64  void InitItemExport();
65  void FinitItemExport();
66  void ExportTableLinesAutoStyles( const SwTableLines& rLines,
67  sal_uInt32 nAbsWidth,
68  sal_uInt32 nBaseWidth,
69  const OUString& rNamePrefix,
73  SwXMLTableInfo_Impl& rTableInfo,
74  bool bTop=false );
75 
76  void ExportFormat( const SwFormat& rFormat, enum ::xmloff::token::XMLTokenEnum eClass );
77  void ExportTableFormat( const SwFrameFormat& rFormat, sal_uInt32 nAbsWidth );
78 
80  void ExportTableBox( const SwTableBox& rBox, sal_uInt32 nColSpan, sal_uInt32 nRowSpan,
81  SwXMLTableInfo_Impl& rTableInfo );
82  void ExportTableLine( const SwTableLine& rLine,
83  const SwXMLTableLines_Impl& rLines,
84  SwXMLTableInfo_Impl& rTableInfo );
85  void ExportTableLines( const SwTableLines& rLines,
86  SwXMLTableInfo_Impl& rTableInfo,
87  sal_uInt32 nHeaderRows = 0 );
88 
89  virtual void ExportMeta_() override;
90  virtual void ExportFontDecls_() override;
91  virtual void ExportStyles_( bool bUsed ) override;
92  virtual void ExportAutoStyles_() override;
93  virtual void ExportMasterStyles_() override;
94  virtual void SetBodyAttributes() override;
95  virtual void ExportContent_() override;
96  virtual void GetViewSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override;
97  virtual void GetConfigurationSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override;
98  virtual sal_Int32 GetDocumentSpecificSettings( std::vector< SettingsGroup >& _out_rSettings ) override;
99 
100 private:
101  void DeleteTableLines();
102 protected:
103 
105  virtual SvXMLAutoStylePoolP* CreateAutoStylePool() override;
106  virtual XMLPageExport* CreatePageExport() override;
107  virtual XMLShapeExport* CreateShapeExport() override;
108  virtual XMLFontAutoStylePool* CreateFontAutoStylePool() override;
109 
110 public:
111  SwXMLExport(
112  const css::uno::Reference< css::uno::XComponentContext >& rContext,
113  OUString const & implementationName, SvXMLExportFlags nExportFlags);
114 
115  virtual ~SwXMLExport() override;
116 
117  void collectAutoStyles() override;
118 
119  virtual ErrCode exportDoc( enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID ) override;
120 
121  inline const SvXMLUnitConverter& GetTwipUnitConverter() const;
122 
123  void ExportTableAutoStyles( const SwTableNode& rTableNd );
124  void ExportTable( const SwTableNode& rTableNd );
125 
126  bool IsShowProgress() const { return m_bShowProgress; }
127  void SetShowProgress( bool b ) { m_bShowProgress = b; }
128 
129  // XUnoTunnel
130  static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
131  virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
132 
133  const SwDoc* getDoc() const;
134  SwDoc* getDoc();
135 };
136 
138 {
139  return *m_pTwipUnitConverter;
140 }
141 
142 #endif // INCLUDED_SW_SOURCE_FILTER_XML_XMLEXP_HXX
143 
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool m_bBlock
Definition: xmlexp.hxx:58
void ExportTableAutoStyles(const SwTableNode &rTableNd)
Definition: xmltble.cxx:717
signed char sal_Int8
SvXMLItemMapEntriesRef m_xTableRowItemMap
Definition: xmlexp.hxx:55
SvXMLExportFlags
std::vector< SwXMLTableLines_Impl * > SwXMLTableLinesCache_Impl
Definition: xmlexp.hxx:44
Definition: doc.hxx:185
SwTableLine is one table row in the document model.
Definition: swtable.hxx:344
SwXMLExport(const css::uno::Reference< css::uno::XComponentContext > &rContext, OUString const &implementationName, SvXMLExportFlags nExportFlags)
Definition: xmlexp.cxx:88
void InitItemExport()
Definition: xmliteme.cxx:200
virtual void GetConfigurationSettings(css::uno::Sequence< css::beans::PropertyValue > &aProps) override
Definition: xmlexp.cxx:387
SvXMLItemMapEntriesRef m_xTableItemMap
Definition: xmlexp.hxx:54
SvXMLItemMapEntriesRef m_xTableCellItemMap
Definition: xmlexp.hxx:56
virtual void ExportMasterStyles_() override
Definition: xmlfmte.cxx:254
virtual XMLShapeExport * CreateShapeExport() override
Definition: xmlexp.cxx:311
bool m_bSavedShowChanges
Definition: xmlexp.hxx:60
bool m_bShowProgress
Definition: xmlexp.hxx:59
void DeleteTableLines()
Definition: xmltble.cxx:1192
virtual void ExportMeta_() override
Definition: xmlmeta.cxx:168
void FinitItemExport()
Definition: xmliteme.cxx:212
Base class for various Writer styles.
Definition: format.hxx:43
void ExportFormat(const SwFormat &rFormat, enum::xmloff::token::XMLTokenEnum eClass)
Definition: xmlfmte.cxx:49
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
Definition: xmlexp.cxx:490
Style of a layout element.
Definition: frmfmt.hxx:57
bool IsShowProgress() const
Definition: xmlexp.hxx:126
const SwDoc * getDoc() const
Definition: xmlexp.cxx:521
void ExportTableColumnStyle(const SwXMLTableColumn_Impl &rCol)
Definition: xmltble.cxx:515
std::unique_ptr< SvXMLUnitConverter > m_pTwipUnitConverter
Definition: xmlexp.hxx:50
virtual void ExportStyles_(bool bUsed) override
Definition: xmlfmte.cxx:158
virtual sal_Int32 GetDocumentSpecificSettings(std::vector< SettingsGroup > &_out_rSettings) override
Definition: xmlexp.cxx:398
const SvXMLUnitConverter & GetTwipUnitConverter() const
Definition: xmlexp.hxx:137
virtual SvXMLAutoStylePoolP * CreateAutoStylePool() override
Definition: xmlfmte.cxx:340
void ExportTableLines(const SwTableLines &rLines, SwXMLTableInfo_Impl &rTableInfo, sal_uInt32 nHeaderRows=0)
Definition: xmltble.cxx:964
void ExportTableFormat(const SwFrameFormat &rFormat, sal_uInt32 nAbsWidth)
Definition: xmliteme.cxx:218
virtual ErrCode exportDoc(enum::xmloff::token::XMLTokenEnum eClass=::xmloff::token::XML_TOKEN_INVALID) override
Definition: xmlexp.cxx:101
virtual XMLTextParagraphExport * CreateTextParagraphExport() override
Definition: xmlexp.cxx:306
void ExportTable(const SwTableNode &rTableNd)
Definition: xmltble.cxx:1077
void ExportTableLine(const SwTableLine &rLine, const SwXMLTableLines_Impl &rLines, SwXMLTableInfo_Impl &rTableInfo)
Definition: xmltble.cxx:887
virtual void ExportFontDecls_() override
Definition: xmlexp.cxx:330
virtual void ExportContent_() override
Definition: xmlexp.cxx:429
void collectAutoStyles() override
Definition: xmlfmte.cxx:173
virtual void SetBodyAttributes() override
Definition: xmlexp.cxx:415
virtual ~SwXMLExport() override
Definition: xmlexp.cxx:324
virtual void ExportAutoStyles_() override
Definition: xmlfmte.cxx:219
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:386
virtual void GetViewSettings(css::uno::Sequence< css::beans::PropertyValue > &aProps) override
Definition: xmlexp.cxx:336
void ExportTableBox(const SwTableBox &rBox, sal_uInt32 nColSpan, sal_uInt32 nRowSpan, SwXMLTableInfo_Impl &rTableInfo)
Definition: xmltble.cxx:755
SwDoc * m_pDoc
Definition: xmlexp.hxx:62
void ExportTableLinesAutoStyles(const SwTableLines &rLines, sal_uInt32 nAbsWidth, sal_uInt32 nBaseWidth, const OUString &rNamePrefix, SwXMLTableColumnsSortByWidth_Impl &rExpCols, SwXMLTableFrameFormatsSort_Impl &rExpRows, SwXMLTableFrameFormatsSort_Impl &rExpCells, SwXMLTableInfo_Impl &rTableInfo, bool bTop=false)
Definition: xmltble.cxx:557
void SetShowProgress(bool b)
Definition: xmlexp.hxx:127
virtual XMLPageExport * CreatePageExport() override
Definition: xmlfmte.cxx:249
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: xmlexp.cxx:485
virtual XMLFontAutoStylePool * CreateFontAutoStylePool() override
Definition: xmlfonte.cxx:70
std::unique_ptr< SvXMLExportItemMapper > m_pTableItemMapper
Definition: xmlexp.hxx:51
std::unique_ptr< SwXMLTableLinesCache_Impl > m_pTableLines
Definition: xmlexp.hxx:52