1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
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>
46 class SvXMLExportPropertyMapper
;
48 typedef std::map
< const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>, OUString
> TableStyleMap
;
52 TableStyleMap maColumnStyleMap
;
53 TableStyleMap maRowStyleMap
;
54 TableStyleMap maCellStyleMap
;
55 std::vector
< OUString
> maDefaultRowCellStyles
;
58 typedef std::map
< const ::com::sun::star::uno::Reference
< com::sun::star::table::XColumnRowRange
>, std::shared_ptr
< XMLTableInfo
> > TableInfoMap
;
60 class XMLOFF_DLLPUBLIC XMLTableExport
: public salhelper::SimpleReferenceObject
63 XMLTableExport(SvXMLExport
& rExp
, const rtl::Reference
< SvXMLExportPropertyMapper
>& xCellExportPropertySetMapper
, const rtl::Reference
< XMLPropertyHandlerFactory
>& xFactoryRef
);
64 virtual ~XMLTableExport();
66 // This method collects all automatic styles for the given table
67 void collectTableAutoStyles(const com::sun::star::uno::Reference
< com::sun::star::table::XColumnRowRange
>& xColumnRowRange
);
69 // This method exports the given table
70 void exportTable(const com::sun::star::uno::Reference
< com::sun::star::table::XColumnRowRange
>& xColumnRowRange
);
72 // export the styles from the cell style family
73 void exportTableStyles();
75 // Export the collected automatic styles
76 void exportAutoStyles();
79 void exportTableTemplates();
81 SvXMLExport
& mrExport
;
82 rtl::Reference
< SvXMLExportPropertyMapper
> mxCellExportPropertySetMapper
;
83 rtl::Reference
< SvXMLExportPropertyMapper
> mxRowExportPropertySetMapper
;
84 rtl::Reference
< SvXMLExportPropertyMapper
> mxColumnExportPropertySetMapper
;
85 TableInfoMap maTableInfoMap
;
89 SvXMLExport
& GetExport() { return mrExport
; }
90 const SvXMLExport
& GetExport() const { return mrExport
; }
93 SAL_DLLPRIVATE
void ImpExportText( const com::sun::star::uno::Reference
< com::sun::star::table::XCell
>& xCell
);
95 void ExportCell( const com::sun::star::uno::Reference
< com::sun::star::table::XCell
>& xCell
, const std::shared_ptr
< XMLTableInfo
>& pTableInfo
, const OUString
& sDefaultCellStyle
);
96 void ExportTableColumns( const com::sun::star::uno::Reference
< com::sun::star::container::XIndexAccess
>& xtableColumns
, const std::shared_ptr
< XMLTableInfo
>& pTableInfo
);
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */