tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / include / xmloff / table / XMLTableExport.hxx
blobdfdb08d7315d8a4affc3471659f5bc534ee7a243
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>
27 #include <map>
28 #include <memory>
29 #include <vector>
31 #include <com/sun/star/table/XColumnRowRange.hpp>
32 #include <com/sun/star/table/XCell.hpp>
33 #include <com/sun/star/container/XIndexAccess.hpp>
35 #include <rtl/ref.hxx>
37 #include <xmloff/dllapi.h>
38 #include <salhelper/simplereferenceobject.hxx>
39 #include <xmloff/prhdlfac.hxx>
40 #include <xmloff/xmlexppr.hxx>
41 #include <xmloff/styleexp.hxx>
43 class SvXMLExport;
44 class SvXMLExportPropertyMapper;
46 typedef std::map< const css::uno::Reference< css::uno::XInterface >, OUString > TableStyleMap;
48 struct XMLTableInfo
50 TableStyleMap maColumnStyleMap;
51 TableStyleMap maRowStyleMap;
52 TableStyleMap maCellStyleMap;
53 std::vector< OUString > maDefaultRowCellStyles;
56 class XMLOFF_DLLPUBLIC XMLTableExport final : public salhelper::SimpleReferenceObject
58 public:
59 XMLTableExport(SvXMLExport& rExp, const rtl::Reference< SvXMLExportPropertyMapper >& xCellExportPropertySetMapper, const rtl::Reference< XMLPropertyHandlerFactory >& xFactoryRef );
60 virtual ~XMLTableExport() override;
62 // This method collects all automatic styles for the given table
63 void collectTableAutoStyles(const css::uno::Reference < css::table::XColumnRowRange >& xColumnRowRange);
65 // This method exports the given table
66 void exportTable(const css::uno::Reference < css::table::XColumnRowRange >& xColumnRowRange);
68 // export the styles from the cell style family
69 void exportTableStyles();
71 // Export the collected automatic styles
72 void exportAutoStyles();
74 private:
75 void exportTableTemplates();
77 SvXMLExport& mrExport;
78 rtl::Reference< SvXMLExportPropertyMapper > mxCellExportPropertySetMapper;
79 rtl::Reference< SvXMLExportPropertyMapper > mxRowExportPropertySetMapper;
80 rtl::Reference< SvXMLExportPropertyMapper > mxColumnExportPropertySetMapper;
81 std::map< const css::uno::Reference< css::table::XColumnRowRange >, std::shared_ptr< XMLTableInfo > >
82 maTableInfoMap;
83 bool mbExportTables;
84 bool mbWriter;
86 SvXMLExport& GetExport() { return mrExport; }
87 const SvXMLExport& GetExport() const { return mrExport; }
89 SAL_DLLPRIVATE void ImpExportText( const css::uno::Reference < css::table::XCell >& xCell );
91 void ExportCell( const css::uno::Reference < css::table::XCell >& xCell, const std::shared_ptr< XMLTableInfo >& pTableInfo, std::u16string_view sDefaultCellStyle );
92 void ExportTableColumns( const css::uno::Reference < css::container::XIndexAccess >& xtableColumns, const std::shared_ptr< XMLTableInfo >& pTableInfo );
96 class XMLOFF_DLLPUBLIC XMLCellStyleExport final : public XMLStyleExport
98 using XMLStyleExport::XMLStyleExport;
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;
103 #endif
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */