LibreOffice Module xmloff (master)  1
XMLTableExport.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 #ifndef INCLUDED_XMLOFF_TABLE_XMLTABLEEXPORT_HXX
20 #define INCLUDED_XMLOFF_TABLE_XMLTABLEEXPORT_HXX
21 
22 #include <sal/config.h>
23 
24 #include <sal/types.h>
25 #include <rtl/ustring.hxx>
26 
27 #include <map>
28 #include <memory>
29 #include <vector>
30 
31 #include <com/sun/star/table/XColumnRowRange.hpp>
32 #include <com/sun/star/table/XCell.hpp>
33 #include <com/sun/star/container/XIndexAccess.hpp>
34 
35 #include <rtl/ref.hxx>
36 
37 #include <xmloff/dllapi.h>
39 #include <xmloff/prhdlfac.hxx>
40 #include <xmloff/xmlexppr.hxx>
41 #include <xmloff/styleexp.hxx>
42 
43 class SvXMLExport;
45 
46 typedef std::map< const css::uno::Reference< css::uno::XInterface >, OUString > TableStyleMap;
47 
49 {
53  std::vector< OUString > maDefaultRowCellStyles;
54 };
55 
57 {
58 public:
59  XMLTableExport(SvXMLExport& rExp, const rtl::Reference< SvXMLExportPropertyMapper >& xCellExportPropertySetMapper, const rtl::Reference< XMLPropertyHandlerFactory >& xFactoryRef );
60  virtual ~XMLTableExport() override;
61 
62  // This method collects all automatic styles for the given table
63  void collectTableAutoStyles(const css::uno::Reference < css::table::XColumnRowRange >& xColumnRowRange);
64 
65  // This method exports the given table
66  void exportTable(const css::uno::Reference < css::table::XColumnRowRange >& xColumnRowRange);
67 
68  // export the styles from the cell style family
69  void exportTableStyles();
70 
71  // Export the collected automatic styles
72  void exportAutoStyles();
73 
74 private:
75  void exportTableTemplates();
76 
81  std::map< const css::uno::Reference< css::table::XColumnRowRange >, std::shared_ptr< XMLTableInfo > >
84  bool mbWriter;
85 
86  SvXMLExport& GetExport() { return mrExport; }
87  const SvXMLExport& GetExport() const { return mrExport; }
88 
89  SAL_DLLPRIVATE void ImpExportText( const css::uno::Reference < css::table::XCell >& xCell );
90 
91  void ExportCell( const css::uno::Reference < css::table::XCell >& xCell, const std::shared_ptr< XMLTableInfo >& pTableInfo, const OUString& sDefaultCellStyle );
92  void ExportTableColumns( const css::uno::Reference < css::container::XIndexAccess >& xtableColumns, const std::shared_ptr< XMLTableInfo >& pTableInfo );
93 
94 };
95 
97 {
99  virtual void exportStyleAttributes(const css::uno::Reference<css::style::XStyle>& rStyle) override;
100  virtual void exportStyleContent(const css::uno::Reference<css::style::XStyle>& rStyle) override;
101 };
102 
103 #endif
104 
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
TableStyleMap maRowStyleMap
rtl::Reference< SvXMLExportPropertyMapper > mxColumnExportPropertySetMapper
std::vector< OUString > maDefaultRowCellStyles
std::map< const css::uno::Reference< css::uno::XInterface >, OUString > TableStyleMap
TableStyleMap maColumnStyleMap
SvXMLExport & GetExport()
SvXMLExport & mrExport
virtual void exportStyleAttributes(const css::uno::Reference< css::style::XStyle > &rStyle)
Definition: styleexp.cxx:73
virtual void exportStyleContent(const css::uno::Reference< css::style::XStyle > &rStyle)
Definition: styleexp.cxx:77
XMLStyleExport(SvXMLExport &rExp, SvXMLAutoStylePoolP *pAutoStyleP=nullptr)
Definition: styleexp.cxx:61
std::map< const css::uno::Reference< css::table::XColumnRowRange >, std::shared_ptr< XMLTableInfo > > maTableInfoMap
rtl::Reference< SvXMLExportPropertyMapper > mxRowExportPropertySetMapper
const SvXMLExport & GetExport() const
rtl::Reference< SvXMLExportPropertyMapper > mxCellExportPropertySetMapper
#define XMLOFF_DLLPUBLIC
Definition: dllapi.h:29
TableStyleMap maCellStyleMap