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 ::rtl::OUString maName
; /// Original name of the dimension.
142 ::rtl::OUString maLayoutName
; /// Layout name (display name)
144 USHORT mnFuncMask
; /// Page/Column/Row subtotal function.
145 sal_Int32 mnUsedHier
; /// Used hierarchy.
146 bool mbShowAll
; /// true = Show all (also empty) results.
147 bool mbIsValue
; /// true = Sum or count in data field.
151 ::rtl::OUString maName
;
152 ::rtl::OUString maLayoutName
;
159 * return the name that should be displayed in the dp dialogs i.e.
160 * when the layout name is present, use it, or else use the original
163 ::rtl::OUString SC_DLLPUBLIC
getDisplayName() const;
165 ::std::vector
<Member
> maMembers
;
166 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> maHiers
; /// Hierarchies.
167 ::com::sun::star::sheet::DataPilotFieldSortInfo maSortInfo
; /// Sorting info.
168 ::com::sun::star::sheet::DataPilotFieldLayoutInfo maLayoutInfo
; /// Layout info.
169 ::com::sun::star::sheet::DataPilotFieldAutoShowInfo maShowInfo
; /// AutoShow info.
171 explicit ScDPLabelData( const String
& rName
, short nCol
, bool bIsValue
);
174 * return the name that should be displayed in the dp dialogs i.e. when
175 * the layout name is present, use it, or else use the original name.
177 ::rtl::OUString SC_DLLPUBLIC
getDisplayName() const;
180 // ============================================================================
186 ::com::sun::star::sheet::DataPilotFieldReference maFieldRef
;
188 explicit ScDPFuncData( short nNewCol
, USHORT nNewFuncMask
);
189 explicit ScDPFuncData( short nNewCol
, USHORT nNewFuncMask
,
190 const ::com::sun::star::sheet::DataPilotFieldReference
& rFieldRef
);
193 // ============================================================================
195 typedef std::vector
< ScDPLabelData
> ScDPLabelDataVec
;
196 typedef std::vector
< String
> ScDPNameVec
;
198 // ============================================================================