xref: /trunk/main/sc/inc/dpshttab.hxx (revision 38d50f7b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_DPSHTTAB_HXX
25 #define SC_DPSHTTAB_HXX
26 
27 #include "dptabdat.hxx"
28 #include "global.hxx"
29 #include "address.hxx"
30 #include "scdllapi.h"
31 #include "queryparam.hxx"
32 
33 #include <vector>
34 
35 namespace com { namespace sun { namespace star { namespace sheet {
36     struct DataPilotFieldFilter;
37 }}}}
38 
39 class ScDPDimension;
40 // Wang Xu Ming -- 2009-8-17
41 // DataPilot Migration - Cache&&Performance
42 class ScDPItemData;
43 // End Comments
44 // --------------------------------------------------------------------
45 //
46 //	implementation of ScDPTableData with sheet data
47 //
48 
49 struct ScSheetSourceDesc
50 {
51 	ScRange			aSourceRange;
52 	ScQueryParam	aQueryParam;
53 
operator ==ScSheetSourceDesc54 	sal_Bool operator==	( const ScSheetSourceDesc& rOther ) const
55 		{ return aSourceRange == rOther.aSourceRange &&
56 				 aQueryParam  == rOther.aQueryParam; }
57 // Wang Xu Ming - DataPilot migration
58 // Buffer&&Performance
59 	ScDPTableDataCache* CreateCache( ScDocument* pDoc, long nID = -1) const;
60 	sal_uLong CheckValidate( ScDocument* pDoc  ) const;
61 	ScDPTableDataCache* GetCache( ScDocument* pDoc, long nID ) const;
62 	ScDPTableDataCache*  GetExistDPObjectCache ( ScDocument* pDoc  ) const;
63 	long	GetCacheId( ScDocument* pDoc, long nID ) const;
64 
65 // End Comments
66 };
67 
68 class SC_DLLPUBLIC ScSheetDPData : public ScDPTableData
69 {
70 private:
71 	ScQueryParam	aQuery;
72 	sal_Bool*          		 pSpecial;
73 	sal_Bool			bIgnoreEmptyRows;
74 	sal_Bool			bRepeatIfEmpty;
75 
76        ScDPCacheTable  aCacheTable;
77 
78 public:
79     // Wang Xu Ming -- 2009-8-17
80     // DataPilot Migration - Cache&&Performance
81     ScSheetDPData( ScDocument* pD, const ScSheetSourceDesc& rDesc, long nCacheId = -1 );
82 	virtual			~ScSheetDPData();
83     // End Comments
84 	virtual long					GetColumnCount();
85 	virtual String					getDimensionName(long nColumn);
86 	virtual sal_Bool					getIsDataLayoutDimension(long nColumn);
87 	virtual sal_Bool					IsDateDimension(long nDim);
88 	virtual sal_uLong					GetNumberFormat(long nDim);
89 	virtual void					DisposeData();
90 	virtual void					SetEmptyFlags( sal_Bool bIgnoreEmptyRows, sal_Bool bRepeatIfEmpty );
91 
92     virtual bool                    IsRepeatIfEmpty();
93 
94     virtual void                    CreateCacheTable();
95     virtual void                    FilterCacheTable(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria, const ::std::hash_set<sal_Int32>& rCatDims);
96     virtual void                    GetDrillDownData(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria,
97                                                      const ::std::hash_set<sal_Int32>& rCatDims,
98                                                      ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData);
99     virtual void                    CalcResults(CalcInfo& rInfo, bool bAutoShow);
100     virtual const ScDPCacheTable&   GetCacheTable() const;
101 };
102 
103 
104 
105 #endif
106 
107