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