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 :
10 : #ifndef SC_FILER_XML_PIVOTSOURCE_HXX
11 : #define SC_FILER_XML_PIVOTSOURCE_HXX
12 :
13 : #include <dpshttab.hxx>
14 : #include <dpsdbtab.hxx>
15 : #include <dpobject.hxx>
16 :
17 : #include <vector>
18 : #include <boost/unordered_map.hpp>
19 :
20 : namespace sc {
21 :
22 : /**
23 : * Store pivot table data that need to be post-processeed at the end of the
24 : * import.
25 : */
26 0 : struct PivotTableSources
27 : {
28 : typedef boost::unordered_map<OUString, OUString, OUStringHash> SelectedPagesType;
29 : typedef boost::unordered_map<ScDPObject*, SelectedPagesType> SelectedPagesMapType;
30 :
31 0 : struct SelectedPages
32 : {
33 : ScDPObject* mpDP;
34 : SelectedPagesType maSelectedPages;
35 :
36 : SelectedPages( ScDPObject* pObj, const SelectedPagesType& rSelected );
37 : };
38 :
39 0 : struct SheetSource
40 : {
41 : ScDPObject* mpDP;
42 : ScSheetSourceDesc maDesc;
43 :
44 : SheetSource( ScDPObject* pObj, const ScSheetSourceDesc& rDesc );
45 : };
46 :
47 0 : struct DBSource
48 : {
49 : ScDPObject* mpDP;
50 : ScImportSourceDesc maDesc;
51 :
52 : DBSource( ScDPObject* pObj, const ScImportSourceDesc& rDesc );
53 : };
54 :
55 0 : struct ServiceSource
56 : {
57 : ScDPObject* mpDP;
58 : ScDPServiceDesc maDesc;
59 :
60 : ServiceSource( ScDPObject* pObj, const ScDPServiceDesc& rDesc );
61 : };
62 :
63 : typedef std::vector<SelectedPages> SelectedPagesListType;
64 :
65 : typedef std::vector<SheetSource> SheetSourcesType;
66 : typedef std::vector<DBSource> DBSourcesType;
67 : typedef std::vector<ServiceSource> ServiceSourcesType;
68 :
69 : SelectedPagesListType maSelectedPagesList;
70 :
71 : SheetSourcesType maSheetSources;
72 : DBSourcesType maDBSources;
73 : ServiceSourcesType maServiceSources;
74 :
75 : PivotTableSources();
76 :
77 : void appendSheetSource( ScDPObject* pObj, const ScSheetSourceDesc& rDesc );
78 : void appendDBSource( ScDPObject* pObj, const ScImportSourceDesc& rDesc );
79 : void appendServiceSource( ScDPObject* pObj, const ScDPServiceDesc& rDesc );
80 :
81 : void appendSelectedPages( ScDPObject* pObj, const SelectedPagesType& rSelected );
82 :
83 : void process();
84 : };
85 :
86 : }
87 :
88 : #endif
89 :
90 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|