Line data Source code
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 : #include <rtl/ustrbuf.hxx>
27 :
28 : #include <boost/shared_ptr.hpp>
29 : #include <map>
30 : #include <vector>
31 :
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>
37 :
38 : #include <rtl/ref.hxx>
39 :
40 : #include <xmloff/dllapi.h>
41 : #include <salhelper/simplereferenceobject.hxx>
42 : #include <xmloff/xmlprmap.hxx>
43 : #include <xmloff/xmlexppr.hxx>
44 :
45 :
46 :
47 : // predeclarations
48 :
49 : class SvXMLExport;
50 : class SvXMLExportPropertyMapper;
51 :
52 : typedef ::std::map< const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >, OUString > TableStyleMap;
53 :
54 0 : struct XMLTableInfo
55 : {
56 : TableStyleMap maColumnStyleMap;
57 : TableStyleMap maRowStyleMap;
58 : TableStyleMap maCellStyleMap;
59 : std::vector< OUString > maDefaultRowCellStyles;
60 : };
61 :
62 : typedef ::std::map< const ::com::sun::star::uno::Reference< com::sun::star::table::XColumnRowRange >, boost::shared_ptr< XMLTableInfo > > TableInfoMap;
63 :
64 : class XMLOFF_DLLPUBLIC XMLTableExport : public salhelper::SimpleReferenceObject
65 : {
66 : public:
67 : XMLTableExport(SvXMLExport& rExp, const rtl::Reference< SvXMLExportPropertyMapper >& xCellExportPropertySetMapper, const rtl::Reference< XMLPropertyHandlerFactory >& xFactoryRef );
68 : virtual ~XMLTableExport();
69 :
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);
72 :
73 : // This method exports the given table
74 : void exportTable(const com::sun::star::uno::Reference < com::sun::star::table::XColumnRowRange >& xColumnRowRange);
75 :
76 : // export the styles from the cell style family
77 : void exportTableStyles();
78 :
79 : // Export the collected automatic styles
80 : void exportAutoStyles();
81 :
82 : private:
83 : void exportTableTemplates();
84 :
85 : SvXMLExport& mrExport;
86 : rtl::Reference< SvXMLExportPropertyMapper > mxCellExportPropertySetMapper;
87 : rtl::Reference< SvXMLExportPropertyMapper > mxRowExportPropertySetMapper;
88 : rtl::Reference< SvXMLExportPropertyMapper > mxColumnExportPropertySetMapper;
89 : TableInfoMap maTableInfoMap;
90 : bool mbExportTables;
91 :
92 : protected:
93 0 : SvXMLExport& GetExport() { return mrExport; }
94 : const SvXMLExport& GetExport() const { return mrExport; }
95 : private:
96 :
97 : SAL_DLLPRIVATE void ImpExportText( const com::sun::star::uno::Reference < com::sun::star::table::XCell >& xCell );
98 :
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 );
101 :
102 : };
103 :
104 : #endif
105 :
106 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|