fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / filter / inc / xepivotxml.hxx
blob0b34f25282419798daf539f36989ed213c52130d
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/.
8 */
10 #ifndef INCLUDED_SC_FILTER_XEPIVOTXML_HXX
11 #define INCLUDED_SC_FILTER_XEPIVOTXML_HXX
13 #include <xerecord.hxx>
14 #include <xeroot.hxx>
16 #include <boost/ptr_container/ptr_map.hpp>
17 #include <unordered_map>
19 class ScDPCache;
20 class ScDPCollection;
21 class ScDPObject;
23 class XclExpXmlPivotCaches : public XclExpRecordBase, protected XclExpRoot
25 public:
26 enum EntryType { Worksheet, Name, Database };
28 struct Entry
30 const ScDPCache* mpCache;
31 EntryType meType;
32 ScRange maSrcRange;
35 XclExpXmlPivotCaches( const XclExpRoot& rRoot );
36 virtual void SaveXml( XclExpXmlStream& rStrm ) SAL_OVERRIDE;
38 void SetCaches( const std::vector<Entry>& rCaches );
39 bool HasCaches() const;
40 const Entry* GetCache( sal_Int32 nCacheId ) const;
42 private:
43 void SavePivotCacheXml( XclExpXmlStream& rStrm, const Entry& rEntry, sal_Int32 nCacheId );
45 private:
46 std::vector<Entry> maCaches;
49 class XclExpXmlPivotTables : public XclExpRecordBase, protected XclExpRoot
51 struct Entry
53 const ScDPObject* mpTable;
54 sal_Int32 mnCacheId;
55 sal_Int32 mnPivotId; /// used as [n] in pivotTable[n].xml part name.
57 Entry( const ScDPObject* pTable, sal_Int32 nCacheId, sal_Int32 nPivotId );
60 const XclExpXmlPivotCaches& mrCaches;
61 typedef std::vector<Entry> TablesType;
62 TablesType maTables;
64 public:
65 XclExpXmlPivotTables( const XclExpRoot& rRoot, const XclExpXmlPivotCaches& rCaches );
67 virtual void SaveXml( XclExpXmlStream& rStrm ) SAL_OVERRIDE;
69 void AppendTable( const ScDPObject* pTable, sal_Int32 nCacheId, sal_Int32 nPivotId );
71 private:
72 void SavePivotTableXml( XclExpXmlStream& rStrm, const ScDPObject& rObj, sal_Int32 nCacheId );
75 class XclExpXmlPivotTableManager : protected XclExpRoot
77 typedef boost::ptr_map<SCTAB, XclExpXmlPivotTables> TablesType;
78 typedef std::unordered_map<const ScDPObject*, sal_Int32> CacheIdMapType;
79 public:
80 XclExpXmlPivotTableManager( const XclExpRoot& rRoot );
82 void Initialize();
84 XclExpXmlPivotCaches& GetCaches();
85 XclExpXmlPivotTables* GetTablesBySheet( SCTAB nTab );
87 private:
88 XclExpXmlPivotCaches maCaches;
89 TablesType maTables;
90 CacheIdMapType maCacheIdMap;
93 #endif
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */