Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / xmloff / table / XMLTableExport.hxx
bloba98546421c007ab9f85bc371308b0ae24c6e2b58
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 .
19 #ifndef INCLUDED_XMLOFF_TABLE_XMLTABLEEXPORT_HXX
20 #define INCLUDED_XMLOFF_TABLE_XMLTABLEEXPORT_HXX
22 #include <sal/config.h>
24 #include <sal/types.h>
25 #include <rtl/ustring.hxx>
26 #include <rtl/ustrbuf.hxx>
28 #include <map>
29 #include <memory>
30 #include <vector>
32 #include <com/sun/star/table/XTableColumns.hpp>
33 #include <com/sun/star/table/XColumnRowRange.hpp>
34 #include <com/sun/star/table/XCell.hpp>
35 #include <com/sun/star/text/XText.hpp>
36 #include <com/sun/star/container/XIndexAccess.hpp>
38 #include <rtl/ref.hxx>
40 #include <xmloff/dllapi.h>
41 #include <salhelper/simplereferenceobject.hxx>
42 #include <xmloff/xmlprmap.hxx>
43 #include <xmloff/xmlexppr.hxx>
45 class SvXMLExport;
46 class SvXMLExportPropertyMapper;
48 typedef std::map< const css::uno::Reference< css::uno::XInterface >, OUString > TableStyleMap;
50 struct XMLTableInfo
52 TableStyleMap maColumnStyleMap;
53 TableStyleMap maRowStyleMap;
54 TableStyleMap maCellStyleMap;
55 std::vector< OUString > maDefaultRowCellStyles;
58 class XMLOFF_DLLPUBLIC XMLTableExport : public salhelper::SimpleReferenceObject
60 public:
61 XMLTableExport(SvXMLExport& rExp, const rtl::Reference< SvXMLExportPropertyMapper >& xCellExportPropertySetMapper, const rtl::Reference< XMLPropertyHandlerFactory >& xFactoryRef );
62 virtual ~XMLTableExport() override;
64 // This method collects all automatic styles for the given table
65 void collectTableAutoStyles(const css::uno::Reference < css::table::XColumnRowRange >& xColumnRowRange);
67 // This method exports the given table
68 void exportTable(const css::uno::Reference < css::table::XColumnRowRange >& xColumnRowRange);
70 // export the styles from the cell style family
71 void exportTableStyles();
73 // Export the collected automatic styles
74 void exportAutoStyles();
76 private:
77 void exportTableTemplates();
79 SvXMLExport& mrExport;
80 rtl::Reference< SvXMLExportPropertyMapper > mxCellExportPropertySetMapper;
81 rtl::Reference< SvXMLExportPropertyMapper > mxRowExportPropertySetMapper;
82 rtl::Reference< SvXMLExportPropertyMapper > mxColumnExportPropertySetMapper;
83 std::map< const css::uno::Reference< css::table::XColumnRowRange >, std::shared_ptr< XMLTableInfo > >
84 maTableInfoMap;
85 bool mbExportTables;
86 bool mbWriter;
88 protected:
89 SvXMLExport& GetExport() { return mrExport; }
90 const SvXMLExport& GetExport() const { return mrExport; }
91 private:
93 SAL_DLLPRIVATE void ImpExportText( const css::uno::Reference < css::table::XCell >& xCell );
95 void ExportCell( const css::uno::Reference < css::table::XCell >& xCell, const std::shared_ptr< XMLTableInfo >& pTableInfo, const OUString& sDefaultCellStyle );
96 void ExportTableColumns( const css::uno::Reference < css::container::XIndexAccess >& xtableColumns, const std::shared_ptr< XMLTableInfo >& pTableInfo );
100 #endif
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */