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>
28 #include <boost/shared_ptr.hpp>
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 <xmloff/uniref.hxx>
42 #include <xmloff/xmlprmap.hxx>
43 #include <xmloff/xmlexppr.hxx>
46 //////////////////////////////////////////////////////////////////////////////
50 class SvXMLExportPropertyMapper
;
52 typedef ::std::map
< const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>, OUString
> TableStyleMap
;
56 TableStyleMap maColumnStyleMap
;
57 TableStyleMap maRowStyleMap
;
58 TableStyleMap maCellStyleMap
;
59 std::vector
< OUString
> maDefaultRowCellStyles
;
62 typedef ::std::map
< const ::com::sun::star::uno::Reference
< com::sun::star::table::XColumnRowRange
>, boost::shared_ptr
< XMLTableInfo
> > TableInfoMap
;
64 class XMLOFF_DLLPUBLIC XMLTableExport
: public UniRefBase
67 XMLTableExport(SvXMLExport
& rExp
, const rtl::Reference
< SvXMLExportPropertyMapper
>& xCellExportPropertySetMapper
, const rtl::Reference
< XMLPropertyHandlerFactory
>& xFactoryRef
);
68 virtual ~XMLTableExport();
70 // This method collects all automatic styles for the given table
71 void collectTableAutoStyles(const com::sun::star::uno::Reference
< com::sun::star::table::XColumnRowRange
>& xColumnRowRange
);
73 // This method exports the given table
74 void exportTable(const com::sun::star::uno::Reference
< com::sun::star::table::XColumnRowRange
>& xColumnRowRange
);
76 // export the styles from the cell style family
77 void exportTableStyles();
79 // Export the collected automatic styles
80 void exportAutoStyles();
83 void exportTableTemplates();
85 SvXMLExport
& mrExport
;
86 rtl::Reference
< SvXMLExportPropertyMapper
> mxCellExportPropertySetMapper
;
87 rtl::Reference
< SvXMLExportPropertyMapper
> mxRowExportPropertySetMapper
;
88 rtl::Reference
< SvXMLExportPropertyMapper
> mxColumnExportPropertySetMapper
;
89 TableInfoMap maTableInfoMap
;
93 SvXMLExport
& GetExport() { return mrExport
; }
94 const SvXMLExport
& GetExport() const { return mrExport
; }
97 SAL_DLLPRIVATE
void ImpExportText( const com::sun::star::uno::Reference
< com::sun::star::table::XCell
>& xCell
);
99 void ExportCell( const com::sun::star::uno::Reference
< com::sun::star::table::XCell
>& xCell
, const boost::shared_ptr
< XMLTableInfo
>& pTableInfo
, const OUString
& sDefaultCellStyle
);
100 void ExportTableColumns( const com::sun::star::uno::Reference
< com::sun::star::container::XIndexAccess
>& xtableColumns
, const boost::shared_ptr
< XMLTableInfo
>& pTableInfo
);
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */