update dev300-m57
[ooovba.git] / sc / inc / pivot.hxx
blob195509bec5c91602ef08f9146f3bea94bea55438
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pivot.hxx,v $
10 * $Revision: 1.8.32.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 WICHTIG:
32 Folgende Reihenfolge beim Aufbau der Pivot-Tabelle unbedingt einzuhalten:
34 pPivot->SetColFields(aColArr, aColCount)
35 pPivot->SetRowFields(aRowArr, aRowCount)
36 pPivot->SetDataFields(aDataArr, aDataCount)
37 if (pPivot->CreateData())
39 pPivotDrawData();
40 pPivotReleaseData();
43 ausserdem ist sicherzustellen, dass entweder das ColArr oder das RowArr
44 einen PivotDataField Eintrag enthalten
49 #ifndef SC_PIVOT_HXX
50 #define SC_PIVOT_HXX
52 #include "global.hxx"
53 #include "address.hxx"
55 #include <vector>
56 #include <boost/shared_ptr.hpp>
58 class SubTotal;
59 #include "collect.hxx"
61 #define PIVOT_DATA_FIELD (MAXCOLCOUNT)
62 #define PIVOT_FUNC_REF (MAXCOLCOUNT)
63 #include <com/sun/star/uno/Sequence.hxx>
64 #include <com/sun/star/sheet/DataPilotFieldReference.hpp>
65 #include <com/sun/star/sheet/DataPilotFieldSortInfo.hpp>
66 #include <com/sun/star/sheet/DataPilotFieldLayoutInfo.hpp>
67 #include <com/sun/star/sheet/DataPilotFieldAutoShowInfo.hpp>
69 class SvStream;
70 class ScDocument;
71 class ScUserListData;
72 class ScProgress;
73 struct ScDPLabelData;
75 typedef ::boost::shared_ptr<ScDPLabelData> ScDPLabelDataRef;
77 // -----------------------------------------------------------------------
79 struct PivotField
81 SCsCOL nCol;
82 USHORT nFuncMask;
83 USHORT nFuncCount;
84 ::com::sun::star::sheet::DataPilotFieldReference maFieldRef;
86 explicit PivotField( SCsCOL nNewCol = 0, USHORT nNewFuncMask = PIVOT_FUNC_NONE );
88 bool operator==( const PivotField& r ) const;
91 // -----------------------------------------------------------------------
93 // implementation still in global2.cxx
94 struct ScPivotParam
96 SCCOL nCol; // Cursor Position /
97 SCROW nRow; // bzw. Anfang des Zielbereiches
98 SCTAB nTab;
99 ::std::vector<ScDPLabelDataRef> maLabelArray;
100 PivotField aPageArr[PIVOT_MAXPAGEFIELD];
101 PivotField aColArr[PIVOT_MAXFIELD];
102 PivotField aRowArr[PIVOT_MAXFIELD];
103 PivotField aDataArr[PIVOT_MAXFIELD];
104 SCSIZE nPageCount;
105 SCSIZE nColCount;
106 SCSIZE nRowCount;
107 SCSIZE nDataCount;
108 BOOL bIgnoreEmptyRows;
109 BOOL bDetectCategories;
110 BOOL bMakeTotalCol;
111 BOOL bMakeTotalRow;
113 ScPivotParam();
114 ScPivotParam( const ScPivotParam& r );
115 ~ScPivotParam();
117 ScPivotParam& operator= ( const ScPivotParam& r );
118 BOOL operator== ( const ScPivotParam& r ) const;
119 //UNUSED2009-05 void Clear ();
120 void ClearPivotArrays();
121 void SetLabelData (const ::std::vector<ScDPLabelDataRef>& r);
122 void SetPivotArrays ( const PivotField* pPageArr,
123 const PivotField* pColArr,
124 const PivotField* pRowArr,
125 const PivotField* pDataArr,
126 SCSIZE nPageCnt,
127 SCSIZE nColCnt,
128 SCSIZE nRowCnt,
129 SCSIZE nDataCnt );
132 // -----------------------------------------------------------------------
134 typedef PivotField PivotFieldArr[PIVOT_MAXFIELD];
135 typedef PivotField PivotPageFieldArr[PIVOT_MAXPAGEFIELD];
137 //------------------------------------------------------------------------
139 struct ScDPLabelData
141 String maName; /// Visible name of the dimension.
142 SCsCOL mnCol;
143 USHORT mnFuncMask; /// Page/Column/Row subtotal function.
144 sal_Int32 mnUsedHier; /// Used hierarchy.
145 bool mbShowAll; /// true = Show all (also empty) results.
146 bool mbIsValue; /// true = Sum or count in data field.
148 ::com::sun::star::uno::Sequence< ::rtl::OUString > maHiers; /// Hierarchies.
149 ::com::sun::star::uno::Sequence< ::rtl::OUString > maMembers; /// Members.
150 ::com::sun::star::uno::Sequence< sal_Bool > maVisible; /// Visibility of members.
151 ::com::sun::star::uno::Sequence< sal_Bool > maShowDet; /// Show details of members.
152 ::com::sun::star::sheet::DataPilotFieldSortInfo maSortInfo; /// Sorting info.
153 ::com::sun::star::sheet::DataPilotFieldLayoutInfo maLayoutInfo; /// Layout info.
154 ::com::sun::star::sheet::DataPilotFieldAutoShowInfo maShowInfo; /// AutoShow info.
156 explicit ScDPLabelData( const String& rName, short nCol, bool bIsValue );
159 // ============================================================================
161 struct ScDPFuncData
163 short mnCol;
164 USHORT mnFuncMask;
165 ::com::sun::star::sheet::DataPilotFieldReference maFieldRef;
167 explicit ScDPFuncData( short nNewCol, USHORT nNewFuncMask );
168 explicit ScDPFuncData( short nNewCol, USHORT nNewFuncMask,
169 const ::com::sun::star::sheet::DataPilotFieldReference& rFieldRef );
172 // ============================================================================
174 typedef std::vector< ScDPLabelData > ScDPLabelDataVec;
175 typedef std::vector< String > ScDPNameVec;
177 // ============================================================================
179 #endif