update credits
[LibreOffice.git] / sw / source / filter / xml / xmlexp.hxx
bloba30bb1d74f7464cc9ab2766e539ed311d1161424
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 _XMLEXP_HXX
21 #define _XMLEXP_HXX
23 #include <xmloff/xmlexp.hxx>
24 #include "xmlitmap.hxx"
25 #include <xmloff/uniref.hxx>
26 #include <xmloff/xmltoken.hxx>
27 #include <vector>
29 class SwDoc;
30 class SwFmt;
31 class SwFrmFmt;
32 class SvXMLUnitConverter;
33 class SvXMLExportItemMapper;
34 class SvXMLAutoStylePoolP;
35 class SwTableLine;
36 class SwTableLines;
37 class SwTableBox;
38 class SwXMLTableColumn_Impl;
39 class SwXMLTableLines_Impl;
40 class SwXMLTableColumnsSortByWidth_Impl;
41 class SwXMLTableFrmFmtsSort_Impl;
42 class SwXMLTableInfo_Impl;
43 class SwTableNode;
44 class XMLPropertySetMapper;
45 class SwXMLTableLines_Impl;
47 typedef ::std::vector< SwXMLTableLines_Impl* > SwXMLTableLinesCache_Impl;
49 class SwXMLExport : public SvXMLExport
51 SvXMLUnitConverter* pTwipUnitConv;
52 SvXMLExportItemMapper* pTableItemMapper;
53 SwXMLTableLinesCache_Impl* pTableLines;
55 SvXMLItemMapEntriesRef xTableItemMap;
56 SvXMLItemMapEntriesRef xTableRowItemMap;
57 SvXMLItemMapEntriesRef xTableCellItemMap;
58 UniReference < XMLPropertySetMapper > xParaPropMapper;
60 sal_Bool bBlock : 1; // export text block?
61 sal_Bool bShowProgress : 1;
62 sal_Bool bSavedShowChanges : 1;
64 SwDoc* doc; // cached for getDoc()
66 void _InitItemExport();
67 void _FinitItemExport();
68 void ExportTableLinesAutoStyles( const SwTableLines& rLines,
69 sal_uInt32 nAbsWidth,
70 sal_uInt32 nBaseWidth,
71 const OUString& rNamePrefix,
72 SwXMLTableColumnsSortByWidth_Impl& rExpCols,
73 SwXMLTableFrmFmtsSort_Impl& rExpRows,
74 SwXMLTableFrmFmtsSort_Impl& rExpCells,
75 SwXMLTableInfo_Impl& rTblInfo,
76 sal_Bool bTop=sal_False );
79 void ExportFmt( const SwFmt& rFmt, enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID );
80 void ExportTableFmt( const SwFrmFmt& rFmt, sal_uInt32 nAbsWidth );
82 void ExportTableColumnStyle( const SwXMLTableColumn_Impl& rCol );
83 void ExportTableBox( const SwTableBox& rBox, sal_uInt16 nColSpan, sal_uInt16 nRowSpan,
84 SwXMLTableInfo_Impl& rTblInfo );
85 void ExportTableLine( const SwTableLine& rLine,
86 const SwXMLTableLines_Impl& rLines,
87 SwXMLTableInfo_Impl& rTblInfo );
88 void ExportTableLines( const SwTableLines& rLines,
89 SwXMLTableInfo_Impl& rTblInfo,
90 sal_uInt16 nHeaderRows = 0 );
92 virtual void _ExportMeta();
93 virtual void _ExportFontDecls();
94 virtual void _ExportStyles( sal_Bool bUsed );
95 virtual void _ExportAutoStyles();
96 virtual void _ExportMasterStyles();
97 virtual void SetBodyAttributes();
98 virtual void _ExportContent();
99 virtual void GetViewSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
100 virtual void GetConfigurationSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
101 virtual sal_Int32 GetDocumentSpecificSettings( ::std::list< SettingsGroup >& _out_rSettings );
103 // string constants for table cell export
104 const OUString sNumberFormat;
105 const OUString sIsProtected;
106 const OUString sCell;
108 void setBlockMode();
109 private:
110 void DeleteTableLines();
111 protected:
113 virtual XMLTextParagraphExport* CreateTextParagraphExport();
114 virtual SvXMLAutoStylePoolP* CreateAutoStylePool();
115 virtual XMLPageExport* CreatePageExport();
116 virtual XMLShapeExport* CreateShapeExport();
117 virtual XMLFontAutoStylePool* CreateFontAutoStylePool();
119 public:
120 SwXMLExport(
121 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext,
122 sal_uInt16 nExportFlags = EXPORT_ALL);
124 virtual ~SwXMLExport();
126 virtual sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID );
128 inline const SvXMLUnitConverter& GetTwipUnitConverter() const;
130 void ExportTableAutoStyles( const SwTableNode& rTblNd );
131 void ExportTable( const SwTableNode& rTblNd );
133 SvXMLExportItemMapper& GetTableItemMapper() { return *pTableItemMapper; }
134 const UniReference < XMLPropertySetMapper >& GetParaPropMapper()
136 return xParaPropMapper;
139 sal_Bool IsShowProgress() const { return bShowProgress; }
140 void SetShowProgress( sal_Bool b ) { bShowProgress = b; }
141 sal_Bool IsBlockMode() const { return bBlock; }
143 // XUnoTunnel
144 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
145 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
147 // XServiceInfo (override parent method)
148 OUString SAL_CALL getImplementationName()
149 throw( ::com::sun::star::uno::RuntimeException );
151 const SwDoc* getDoc() const;
152 SwDoc* getDoc();
155 inline const SvXMLUnitConverter& SwXMLExport::GetTwipUnitConverter() const
157 return *pTwipUnitConv;
161 #endif // _XMLEXP_HXX
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */