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: dpoutput.hxx,v $
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 #ifndef SC_DPOUTPUT_HXX
32 #define SC_DPOUTPUT_HXX
34 #include <com/sun/star/sheet/XDimensionsSupplier.hpp>
35 #include <com/sun/star/sheet/DataResult.hpp>
36 #include <com/sun/star/sheet/MemberResult.hpp>
37 #include <com/sun/star/sheet/GeneralFunction.hpp>
38 #include <com/sun/star/sheet/DataPilotOutputRangeType.hpp>
41 #include "address.hxx"
43 #include "dpcachetable.hxx"
46 namespace com
{ namespace sun
{ namespace star
{ namespace sheet
{
47 struct DataPilotFieldFilter
;
48 struct DataPilotTablePositionData
;
54 class ScStrCollection
;
56 struct ScDPOutLevelData
;
59 struct ScDPGetPivotDataField
62 com::sun::star::sheet::GeneralFunction meFunction
;
68 ScDPGetPivotDataField() :
69 meFunction( com::sun::star::sheet::GeneralFunction_NONE
),
78 class ScDPOutput
//! name???
83 com::sun::star::uno::Reference
<
84 com::sun::star::sheet::XDimensionsSupplier
> xSource
;
87 ScDPOutLevelData
* pColFields
;
88 ScDPOutLevelData
* pRowFields
;
89 ScDPOutLevelData
* pPageFields
;
93 com::sun::star::uno::Sequence
<
94 com::sun::star::uno::Sequence
<
95 com::sun::star::sheet::DataResult
> > aData
;
98 String aDataDescription
;
100 // Number format related parameters
105 UINT32 nSingleNumFmt
;
107 // Output geometry related parameters
113 bool mbHeaderLayout
; // TRUE : grid, FALSE : standard
116 SCCOL nMemberStartCol
;
117 SCROW nMemberStartRow
;
123 void DataCell( SCCOL nCol
, SCROW nRow
, SCTAB nTab
,
124 const com::sun::star::sheet::DataResult
& rData
);
125 void HeaderCell( SCCOL nCol
, SCROW nRow
, SCTAB nTab
,
126 const com::sun::star::sheet::MemberResult
& rData
,
127 BOOL bColHeader
, long nLevel
);
128 void FieldCell( SCCOL nCol
, SCROW nRow
, SCTAB nTab
, const String
& rCaption
,
129 bool bInTable
, bool bPopup
, bool bHasHiddenMember
);
132 /** Query which sub-area of the table the cell is in. See
133 css.sheet.DataPilotTablePositionType for the interpretation of the
135 sal_Int32
GetPositionType(const ScAddress
& rPos
);
138 ScDPOutput( ScDocument
* pD
,
139 const com::sun::star::uno::Reference
<
140 com::sun::star::sheet::XDimensionsSupplier
>& xSrc
,
141 const ScAddress
& rPos
, BOOL bFilter
);
144 void SetPosition( const ScAddress
& rPos
);
146 void Output(); //! Refresh?
147 ScRange
GetOutputRange( sal_Int32 nRegionType
= ::com::sun::star::sheet::DataPilotOutputRangeType::WHOLE
);
148 long GetHeaderRows();
149 BOOL
HasError(); // range overflow or exception from source
151 void GetPositionData(const ScAddress
& rPos
, ::com::sun::star::sheet::DataPilotTablePositionData
& rPosData
);
153 /** Get filtering criteria based on the position of the cell within data
155 bool GetDataResultPositionData(::std::vector
< ::com::sun::star::sheet::DataPilotFieldFilter
>& rFilters
, const ScAddress
& rPos
);
157 BOOL
GetPivotData( ScDPGetPivotDataField
& rTarget
, /* returns result */
158 const std::vector
< ScDPGetPivotDataField
>& rFilters
);
159 long GetHeaderDim( const ScAddress
& rPos
, USHORT
& rOrient
);
160 BOOL
GetHeaderDrag( const ScAddress
& rPos
, BOOL bMouseLeft
, BOOL bMouseTop
,
162 Rectangle
& rPosRect
, USHORT
& rOrient
, long& rDimPos
);
163 BOOL
IsFilterButton( const ScAddress
& rPos
);
165 void GetMemberResultNames( ScStrCollection
& rNames
, long nDimension
);
167 void SetHeaderLayout(bool bUseGrid
);
168 bool GetHeaderLayout() const;
170 static void GetDataDimensionNames( String
& rSourceName
, String
& rGivenName
,
171 const com::sun::star::uno::Reference
<
172 com::sun::star::uno::XInterface
>& xDim
);