merged tag ooo/OOO330_m14
[LibreOffice.git] / sc / inc / dpsdbtab.hxx
blob732e3d30e8df4590c2969754a6c62df0f617c868
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef SC_DPSDBTAB_HXX
29 #define SC_DPSDBTAB_HXX
31 #include <com/sun/star/uno/Reference.hxx>
33 #include "dptabdat.hxx"
35 #include <vector>
36 #include <set>
38 class ScDPCacheTable;
39 class ScDocument;
41 // --------------------------------------------------------------------
43 // implementation of ScDPTableData with database data
46 struct ScImportSourceDesc
48 String aDBName;
49 String aObject;
50 USHORT nType; // enum DataImportMode
51 BOOL bNative;
53 ScImportSourceDesc() : nType(0), bNative(FALSE) {}
55 BOOL operator== ( const ScImportSourceDesc& rOther ) const
56 { return aDBName == rOther.aDBName &&
57 aObject == rOther.aObject &&
58 nType == rOther.nType &&
59 bNative == rOther.bNative; }
61 // Wang Xu Ming -- 2009-9-15
62 // DataPilot Migration - Cache&&Performance
63 ScDPTableDataCache* GetExistDPObjectCache( ScDocument* pDoc ) const;
64 ScDPTableDataCache* CreateCache( ScDocument* pDoc , long nID ) const;
65 ScDPTableDataCache* GetCache( ScDocument* pDoc, long nID ) const;
66 long GetCacheId( ScDocument* pDoc, long nID ) const;
67 // End Comments
70 class ScDatabaseDPData : public ScDPTableData
72 private:
73 ScDPCacheTable aCacheTable;
74 public:
75 ScDatabaseDPData(ScDocument* pDoc, const ScImportSourceDesc& rImport, long nCacheId = -1);
76 virtual ~ScDatabaseDPData();
78 virtual long GetColumnCount();
79 virtual String getDimensionName(long nColumn);
80 virtual BOOL getIsDataLayoutDimension(long nColumn);
81 virtual BOOL IsDateDimension(long nDim);
82 virtual void DisposeData();
83 virtual void SetEmptyFlags( BOOL bIgnoreEmptyRows, BOOL bRepeatIfEmpty );
85 virtual void CreateCacheTable();
86 virtual void FilterCacheTable(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria, const ::std::hash_set<sal_Int32>& rDataDims);
87 virtual void GetDrillDownData(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria,
88 const ::std::hash_set<sal_Int32>& rCatDims,
89 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData);
90 virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow);
91 virtual const ScDPCacheTable& GetCacheTable() const;
96 #endif