1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_INC_DPOUTPUT_HXX
21 #define INCLUDED_SC_INC_DPOUTPUT_HXX
23 #include <com/sun/star/sheet/DataPilotOutputRangeType.hpp>
24 #include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
25 #include <com/sun/star/uno/Sequence.hxx>
27 #include "address.hxx"
29 #include "dptypes.hxx"
34 namespace com::sun::star::sheet
{
35 struct DataPilotFieldFilter
;
36 struct DataPilotTablePositionData
;
39 class XDimensionsSupplier
;
41 namespace tools
{ class Rectangle
; }
43 struct ScDPOutLevelData
;
49 css::uno::Reference
< css::sheet::XDimensionsSupplier
> xSource
;
51 std::vector
<ScDPOutLevelData
> pColFields
;
52 std::vector
<ScDPOutLevelData
> pRowFields
;
53 std::vector
<ScDPOutLevelData
> pPageFields
;
54 css::uno::Sequence
< css::uno::Sequence
< css::sheet::DataResult
> > aData
;
55 OUString aDataDescription
;
57 // Number format related parameters
58 std::unique_ptr
<sal_uInt32
[]>
60 std::unique_ptr
<sal_uInt32
[]>
62 sal_Int32 nColFmtCount
;
63 sal_Int32 nRowFmtCount
;
64 sal_uInt32 nSingleNumFmt
;
66 // Output geometry related parameters
69 sal_Int32 nHeaderSize
;
72 SCCOL nMemberStartCol
;
73 SCROW nMemberStartRow
;
82 bool mbHeaderLayout
:1; // true : grid, false : standard
84 void DataCell( SCCOL nCol
, SCROW nRow
, SCTAB nTab
,
85 const css::sheet::DataResult
& rData
);
86 void HeaderCell( SCCOL nCol
, SCROW nRow
, SCTAB nTab
,
87 const css::sheet::MemberResult
& rData
,
88 bool bColHeader
, tools::Long nLevel
);
90 void FieldCell(SCCOL nCol
, SCROW nRow
, SCTAB nTab
, const ScDPOutLevelData
& rData
, bool bInTable
);
94 /** Query which sub-area of the table the cell is in. See
95 css.sheet.DataPilotTablePositionType for the interpretation of the
97 sal_Int32
GetPositionType(const ScAddress
& rPos
);
100 ScDPOutput( ScDocument
* pD
,
101 const css::uno::Reference
< css::sheet::XDimensionsSupplier
>& xSrc
,
102 const ScAddress
& rPos
, bool bFilter
);
105 void SetPosition( const ScAddress
& rPos
);
107 void Output(); //! Refresh?
108 ScRange
GetOutputRange( sal_Int32 nRegionType
= css::sheet::DataPilotOutputRangeType::WHOLE
);
109 sal_Int32
GetHeaderRows() const;
110 bool HasError(); // range overflow or exception from source
112 void GetPositionData(const ScAddress
& rPos
, css::sheet::DataPilotTablePositionData
& rPosData
);
114 /** Get filtering criteria based on the position of the cell within data
116 bool GetDataResultPositionData(::std::vector
< css::sheet::DataPilotFieldFilter
>& rFilters
, const ScAddress
& rPos
);
118 tools::Long
GetHeaderDim( const ScAddress
& rPos
, css::sheet::DataPilotFieldOrientation
& rOrient
);
120 const ScAddress
& rPos
, bool bMouseLeft
, bool bMouseTop
, tools::Long nDragDim
,
121 tools::Rectangle
& rPosRect
, css::sheet::DataPilotFieldOrientation
& rOrient
, tools::Long
& rDimPos
);
122 bool IsFilterButton( const ScAddress
& rPos
);
124 void GetMemberResultNames(ScDPUniqueStringSet
& rNames
, tools::Long nDimension
);
126 void SetHeaderLayout(bool bUseGrid
);
127 bool GetHeaderLayout() const { return mbHeaderLayout
;}
129 static void GetDataDimensionNames(
130 OUString
& rSourceName
, OUString
& rGivenName
,
131 const css::uno::Reference
< css::uno::XInterface
>& xDim
);
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */