tdf#125181 maxY is 50000 in prstGeom for star24 and star32
[LibreOffice.git] / sc / inc / dpoutput.hxx
blob18aa7aaa855bf3eb5fc2485f09956b400fc4da3a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 <comphelper/sequence.hxx>
27 #include "address.hxx"
29 #include "dptypes.hxx"
31 #include <memory>
32 #include <vector>
34 namespace com { namespace sun { namespace star { namespace sheet {
35 struct DataPilotFieldFilter;
36 struct DataPilotTablePositionData;
37 }}}}
39 namespace com { namespace sun { namespace star { namespace sheet { class XDimensionsSupplier; } } } }
40 namespace com { namespace sun { namespace star { namespace sheet { struct DataResult; } } } }
41 namespace com { namespace sun { namespace star { namespace sheet { struct MemberResult; } } } }
43 namespace tools { class Rectangle; }
44 class ScDocument;
45 struct ScDPOutLevelData;
47 class ScDPOutput
49 private:
50 ScDocument* pDoc;
51 css::uno::Reference< css::sheet::XDimensionsSupplier> xSource;
52 ScAddress aStartPos;
53 std::vector<ScDPOutLevelData> pColFields;
54 std::vector<ScDPOutLevelData> pRowFields;
55 std::vector<ScDPOutLevelData> pPageFields;
56 css::uno::Sequence< css::uno::Sequence< css::sheet::DataResult> > aData;
57 OUString aDataDescription;
59 // Number format related parameters
60 std::unique_ptr<sal_uInt32[]>
61 pColNumFmt;
62 std::unique_ptr<sal_uInt32[]>
63 pRowNumFmt;
64 long nColFmtCount;
65 long nRowFmtCount;
66 sal_uInt32 nSingleNumFmt;
68 // Output geometry related parameters
69 long nColCount;
70 long nRowCount;
71 long nHeaderSize;
72 SCCOL nTabStartCol;
73 SCROW nTabStartRow;
74 SCCOL nMemberStartCol;
75 SCROW nMemberStartRow;
76 SCCOL nDataStartCol;
77 SCROW nDataStartRow;
78 SCCOL nTabEndCol;
79 SCROW nTabEndRow;
80 bool const bDoFilter:1;
81 bool bResultsError:1;
82 bool bSizesValid:1;
83 bool bSizeOverflow:1;
84 bool mbHeaderLayout:1; // true : grid, false : standard
86 void DataCell( SCCOL nCol, SCROW nRow, SCTAB nTab,
87 const css::sheet::DataResult& rData );
88 void HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab,
89 const css::sheet::MemberResult& rData,
90 bool bColHeader, long nLevel );
92 void FieldCell(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScDPOutLevelData& rData, bool bInTable);
94 void CalcSizes();
96 /** Query which sub-area of the table the cell is in. See
97 css.sheet.DataPilotTablePositionType for the interpretation of the
98 return value. */
99 sal_Int32 GetPositionType(const ScAddress& rPos);
101 public:
102 ScDPOutput( ScDocument* pD,
103 const css::uno::Reference< css::sheet::XDimensionsSupplier>& xSrc,
104 const ScAddress& rPos, bool bFilter );
105 ~ScDPOutput();
107 void SetPosition( const ScAddress& rPos );
109 void Output(); //! Refresh?
110 ScRange GetOutputRange( sal_Int32 nRegionType = css::sheet::DataPilotOutputRangeType::WHOLE );
111 long GetHeaderRows();
112 bool HasError(); // range overflow or exception from source
114 void GetPositionData(const ScAddress& rPos, css::sheet::DataPilotTablePositionData& rPosData);
116 /** Get filtering criteria based on the position of the cell within data
117 field region. */
118 bool GetDataResultPositionData(::std::vector< css::sheet::DataPilotFieldFilter >& rFilters, const ScAddress& rPos);
120 long GetHeaderDim( const ScAddress& rPos, css::sheet::DataPilotFieldOrientation& rOrient );
121 bool GetHeaderDrag(
122 const ScAddress& rPos, bool bMouseLeft, bool bMouseTop, long nDragDim,
123 tools::Rectangle& rPosRect, css::sheet::DataPilotFieldOrientation& rOrient, long& rDimPos );
124 bool IsFilterButton( const ScAddress& rPos );
126 void GetMemberResultNames(ScDPUniqueStringSet& rNames, long nDimension);
128 void SetHeaderLayout(bool bUseGrid);
129 bool GetHeaderLayout() const { return mbHeaderLayout;}
131 static void GetDataDimensionNames(
132 OUString& rSourceName, OUString& rGivenName,
133 const css::uno::Reference< css::uno::XInterface>& xDim );
136 #endif
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */