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"
41 // --------------------------------------------------------------------
43 // implementation of ScDPTableData with database data
46 struct ScImportSourceDesc
50 USHORT nType
; // enum DataImportMode
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;
70 class ScDatabaseDPData
: public ScDPTableData
73 ScDPCacheTable aCacheTable
;
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;