1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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 ************************************************************************/
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())
43 ausserdem ist sicherzustellen, dass entweder das ColArr oder das RowArr
44 einen PivotDataField Eintrag enthalten
53 #include "address.hxx"
56 #include <boost/shared_ptr.hpp>
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>
75 typedef ::boost::shared_ptr
<ScDPLabelData
> ScDPLabelDataRef
;
77 // -----------------------------------------------------------------------
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
96 SCCOL nCol
; // Cursor Position /
97 SCROW nRow
; // bzw. Anfang des Zielbereiches
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
];
108 BOOL bIgnoreEmptyRows
;
109 BOOL bDetectCategories
;
114 ScPivotParam( const ScPivotParam
& r
);
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
,
132 // -----------------------------------------------------------------------
134 typedef PivotField PivotFieldArr
[PIVOT_MAXFIELD
];
135 typedef PivotField PivotPageFieldArr
[PIVOT_MAXPAGEFIELD
];
137 //------------------------------------------------------------------------
141 String maName
; /// Visible name of the dimension.
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 // ============================================================================
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 // ============================================================================