xref: /trunk/main/sc/inc/dpshttab.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 
28 #ifndef SC_DPSHTTAB_HXX
29 #define SC_DPSHTTAB_HXX
30 
31 #include "dptabdat.hxx"
32 #include "global.hxx"
33 #include "address.hxx"
34 #include "scdllapi.h"
35 #include "queryparam.hxx"
36 
37 #include <vector>
38 
39 namespace com { namespace sun { namespace star { namespace sheet {
40     struct DataPilotFieldFilter;
41 }}}}
42 
43 class ScDPDimension;
44 // Wang Xu Ming -- 2009-8-17
45 // DataPilot Migration - Cache&&Performance
46 class ScDPItemData;
47 // End Comments
48 // --------------------------------------------------------------------
49 //
50 //	implementation of ScDPTableData with sheet data
51 //
52 
53 struct ScSheetSourceDesc
54 {
55 	ScRange			aSourceRange;
56 	ScQueryParam	aQueryParam;
57 
58 	sal_Bool operator==	( const ScSheetSourceDesc& rOther ) const
59 		{ return aSourceRange == rOther.aSourceRange &&
60 				 aQueryParam  == rOther.aQueryParam; }
61 // Wang Xu Ming - DataPilot migration
62 // Buffer&&Performance
63 	ScDPTableDataCache* CreateCache( ScDocument* pDoc, long nID = -1) const;
64 	sal_uLong CheckValidate( ScDocument* pDoc  ) const;
65 	ScDPTableDataCache* GetCache( ScDocument* pDoc, long nID ) const;
66 	ScDPTableDataCache*  GetExistDPObjectCache ( ScDocument* pDoc  ) const;
67 	long	GetCacheId( ScDocument* pDoc, long nID ) const;
68 
69 // End Comments
70 };
71 
72 class SC_DLLPUBLIC ScSheetDPData : public ScDPTableData
73 {
74 private:
75 	ScQueryParam	aQuery;
76 	sal_Bool*          		 pSpecial;
77 	sal_Bool			bIgnoreEmptyRows;
78 	sal_Bool			bRepeatIfEmpty;
79 
80        ScDPCacheTable  aCacheTable;
81 
82 public:
83     // Wang Xu Ming -- 2009-8-17
84     // DataPilot Migration - Cache&&Performance
85     ScSheetDPData( ScDocument* pD, const ScSheetSourceDesc& rDesc, long nCacheId = -1 );
86 	virtual			~ScSheetDPData();
87     // End Comments
88 	virtual long					GetColumnCount();
89 	virtual String					getDimensionName(long nColumn);
90 	virtual sal_Bool					getIsDataLayoutDimension(long nColumn);
91 	virtual sal_Bool					IsDateDimension(long nDim);
92 	virtual sal_uLong					GetNumberFormat(long nDim);
93 	virtual void					DisposeData();
94 	virtual void					SetEmptyFlags( sal_Bool bIgnoreEmptyRows, sal_Bool bRepeatIfEmpty );
95 
96     virtual bool                    IsRepeatIfEmpty();
97 
98     virtual void                    CreateCacheTable();
99     virtual void                    FilterCacheTable(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria, const ::std::hash_set<sal_Int32>& rCatDims);
100     virtual void                    GetDrillDownData(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria,
101                                                      const ::std::hash_set<sal_Int32>& rCatDims,
102                                                      ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData);
103     virtual void                    CalcResults(CalcInfo& rInfo, bool bAutoShow);
104     virtual const ScDPCacheTable&   GetCacheTable() const;
105 };
106 
107 
108 
109 #endif
110 
111