Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef SC_DPSDBTAB_HXX
30 : : #define SC_DPSDBTAB_HXX
31 : :
32 : : #include <com/sun/star/uno/Reference.hxx>
33 : :
34 : : #include "dptabdat.hxx"
35 : :
36 : : #include <vector>
37 : : #include <boost/unordered_set.hpp>
38 : :
39 : : class ScDPCacheTable;
40 : : class ScDocument;
41 : : class ScDPCache;
42 : : class ScDPDimensionSaveData;
43 : :
44 : 0 : struct ScImportSourceDesc
45 : : {
46 : : ::rtl::OUString aDBName;
47 : : ::rtl::OUString aObject;
48 : : sal_uInt16 nType; // enum DataImportMode
49 : : bool bNative;
50 : : ScDocument* mpDoc;
51 : :
52 : 0 : ScImportSourceDesc(ScDocument* pDoc) : nType(0), bNative(false), mpDoc(pDoc) {}
53 : :
54 : 0 : bool operator== ( const ScImportSourceDesc& rOther ) const
55 : 0 : { return aDBName == rOther.aDBName &&
56 : 0 : aObject == rOther.aObject &&
57 : : nType == rOther.nType &&
58 : : bNative == rOther.bNative &&
59 [ # # ][ # # ]: 0 : mpDoc == rOther.mpDoc; }
[ # # ]
[ # # # # ]
60 : :
61 : : sal_Int32 GetCommandType() const;
62 : : const ScDPCache* CreateCache(const ScDPDimensionSaveData* pDimData) const;
63 : : };
64 : :
65 : : /**
66 : : * This class represents source data from database source.
67 : : */
68 : : class ScDatabaseDPData : public ScDPTableData
69 : : {
70 : : private:
71 : : const ScImportSourceDesc& mrImport;
72 : : ScDPCacheTable aCacheTable;
73 : : public:
74 : : ScDatabaseDPData(ScDocument* pDoc, const ScImportSourceDesc& rImport, const ScDPCache* pCache);
75 : : virtual ~ScDatabaseDPData();
76 : :
77 : : virtual long GetColumnCount();
78 : : virtual rtl::OUString getDimensionName(long nColumn);
79 : : virtual sal_Bool getIsDataLayoutDimension(long nColumn);
80 : : virtual sal_Bool IsDateDimension(long nDim);
81 : : virtual void DisposeData();
82 : : virtual void SetEmptyFlags( sal_Bool bIgnoreEmptyRows, sal_Bool bRepeatIfEmpty );
83 : :
84 : : virtual void CreateCacheTable();
85 : : virtual void FilterCacheTable(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria, const ::boost::unordered_set<sal_Int32>& rDataDims);
86 : : virtual void GetDrillDownData(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria,
87 : : const ::boost::unordered_set<sal_Int32>& rCatDims,
88 : : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData);
89 : : virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow);
90 : : virtual const ScDPCacheTable& GetCacheTable() const;
91 : : virtual void ReloadCacheTable();
92 : : };
93 : :
94 : :
95 : :
96 : : #endif
97 : :
98 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|