20 #ifndef INCLUDED_SC_INC_DPSAVE_HXX
21 #define INCLUDED_SC_INC_DPSAVE_HXX
26 #include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
27 #include <rtl/ustring.hxx>
34 #include <unordered_map>
35 #include <unordered_set>
39 class XDimensionsSupplier;
40 struct DataPilotFieldReference;
41 struct DataPilotFieldSortInfo;
42 struct DataPilotFieldAutoShowInfo;
43 struct DataPilotFieldLayoutInfo;
73 {
return bool(nVisibleMode); }
78 {
return bool(nShowDetailsMode); }
80 void SetName(
const OUString& rNew );
86 void WriteToSource(
const css::uno::Reference<css::uno::XInterface>& xMember,
87 sal_Int32 nPosition );
90 void Dump(
int nIndent = 0)
const;
110 std::unique_ptr<css::sheet::DataPilotFieldSortInfo>
pSortInfo;
112 std::unique_ptr<css::sheet::DataPilotFieldLayoutInfo>
pLayoutInfo;
119 std::unordered_map<OUString, std::unique_ptr<ScDPSaveMember>>
maMemberHash;
130 {
return maMemberList; }
132 void AddMember(std::unique_ptr<ScDPSaveMember> pMember);
144 {
return bIsDataLayout; }
146 void SetName(
const OUString& rNew );
149 void SetSubTotals(std::vector<ScGeneralFunction>
const & rFuncs);
151 {
return maSubTotalFuncs.size(); }
154 {
return maSubTotalFuncs[nIndex]; }
156 bool HasShowEmpty()
const;
157 void SetShowEmpty(
bool bSet);
159 {
return bool(nShowEmptyMode); }
161 void SetRepeatItemLabels(
bool bSet);
163 {
return bRepeatItemLabels; }
167 {
return nFunction; }
171 {
return nUsedHierarchy; }
173 void SetLayoutName(
const OUString& rName);
174 const std::optional<OUString> & GetLayoutName()
const;
175 void RemoveLayoutName();
176 void SetSubtotalName(
const OUString& rName);
177 const std::optional<OUString> & GetSubtotalName()
const;
178 void RemoveSubtotalName();
180 bool IsMemberNameInUse(
const OUString& rName)
const;
183 {
return pReferenceValue.get(); }
185 void SetReferenceValue(
const css::sheet::DataPilotFieldReference* pNew);
188 {
return pSortInfo.get(); }
190 void SetSortInfo(
const css::sheet::DataPilotFieldSortInfo* pNew);
192 {
return pAutoShowInfo.get(); }
194 void SetAutoShowInfo(
const css::sheet::DataPilotFieldAutoShowInfo* pNew);
196 {
return pLayoutInfo.get(); }
198 void SetLayoutInfo(
const css::sheet::DataPilotFieldLayoutInfo* pNew);
200 void SetCurrentPage(
const OUString* pPage );
201 OUString GetCurrentPage()
const;
204 {
return nOrientation; }
219 void SetMemberPosition(
const OUString& rName, sal_Int32 nNewPos );
221 void WriteToSource(
const css::uno::Reference<css::uno::XInterface>& xDim );
223 void UpdateMemberVisibility(
const std::unordered_map< OUString, bool>& rData);
225 bool HasInvisibleMember()
const;
227 void RemoveObsoleteMembers(
const MemberSetType& rMembers);
230 void Dump(
int nIndent = 0)
const;
239 typedef std::vector<std::unique_ptr<ScDPSaveDimension>>
DimsType;
290 css::sheet::DataPilotFieldOrientation eOrientation,
291 std::vector<const ScDPSaveDimension*>& rDims)
const;
324 {
return bool(nColumnGrandMode); }
328 {
return bool(nRowGrandMode); }
332 {
return bool(nIgnoreEmptyMode); }
336 {
return bool(nRepeatEmptyMode); }
346 void WriteToSource(
const css::uno::Reference<css::sheet::XDimensionsSupplier>& xSource );
350 {
return pDimensionData.get(); }
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)
SC_DLLPUBLIC bool HasInvisibleMember(std::u16string_view rDimName) const
Check whether a dimension has one or more invisible members.
SC_DLLPUBLIC void SetRepeatIfEmpty(bool bSet)
const ScDPDimensionSaveData * GetExistingDimensionData() const
void WriteToSource(const css::uno::Reference< css::uno::XInterface > &xMember, sal_Int32 nPosition)
void BuildAllDimensionMembers(ScDPTableData *pData)
css::sheet::DataPilotFieldOrientation nOrientation
This class has to do with handling exclusively grouped dimensions? TODO: Find out what this class doe...
bool operator==(const ScDPSaveMember &r) const
SC_DLLPUBLIC const std::optional< OUString > & GetGrandTotalName() const
std::unique_ptr< DimOrderType > mpDimOrder
const MemberList & GetMembers() const
std::optional< OUString > mpLayoutName
css::sheet::DataPilotFieldOrientation GetOrientation() const
void CheckDuplicateName(ScDPSaveDimension &rDim)
std::unique_ptr< css::sheet::DataPilotFieldSortInfo > pSortInfo
sal_uInt16 nShowDetailsMode
bool GetIsVisible() const
ScGeneralFunction GetSubTotalFunc(tools::Long nIndex) const
const css::sheet::DataPilotFieldLayoutInfo * GetLayoutInfo() const
std::unordered_map< OUString, std::unique_ptr< ScDPSaveMember > > maMemberHash
SC_DLLPUBLIC ScDPDimensionSaveData * GetDimensionData()
bool IsDataLayout() const
void AddDimension(ScDPSaveDimension *pDim)
SC_DLLPUBLIC void SetIsVisible(bool bSet)
std::unordered_set< OUString > MemberSetType
ScDPSaveData & operator=(const ScDPSaveData &r)
std::optional< OUString > mpGrandTotalName
SC_DLLPUBLIC void GetAllDimensionsByOrientation(css::sheet::DataPilotFieldOrientation eOrientation, std::vector< const ScDPSaveDimension * > &rDims) const
Get all dimensions in a given orientation.
tools::Long GetUsedHierarchy() const
ScGeneralFunction nFunction
void RemoveDimensionByName(const OUString &rName)
bool operator==(const ScDPSaveData &r) const
const DimOrderType & GetDimensionSortOrder() const
Get sort order map to sort row and column dimensions in order of appearance.
const OUString & GetName() const
ScGeneralFunction GetFunction() const
bool GetIgnoreEmptyRows() const
std::unordered_map< OUString, size_t > DimOrderType
std::vector< ScDPSaveMember * > MemberList
bool GetRepeatItemLabels() const
ScDPSaveDimension * GetInnermostDimension(css::sheet::DataPilotFieldOrientation nOrientation)
std::unique_ptr< ScDPDimensionSaveData > pDimensionData
keep track of number of duplicates in each name.
bool GetDrillDown() const
void SyncAllDimensionMembers(ScDPTableData *pData)
ScDPSaveDimension * GetFirstDimension(css::sheet::DataPilotFieldOrientation eOrientation)
SC_DLLPUBLIC tools::Long GetDataDimensionCount() const
void RemoveDuplicateNameCount(const OUString &rName)
SC_DLLPUBLIC ScDPSaveDimension * GetNewDimensionByName(const OUString &rName)
const css::sheet::DataPilotFieldSortInfo * GetSortInfo() const
DupNameCountType maDupNameCounts
tools::Long GetSubTotalsCount() const
SC_DLLPUBLIC void SetDimensionData(const ScDPDimensionSaveData *pNew)
ScDPSaveDimension * AppendNewDimension(const OUString &rName, bool bDataLayout)
Append a new original dimension.
SC_DLLPUBLIC ScDPSaveDimension * GetExistingDataLayoutDimension() const
SC_DLLPUBLIC void SetLayoutName(const OUString &rName)
void SetName(const OUString &rNew)
bool GetRepeatIfEmpty() const
SC_DLLPUBLIC ~ScDPSaveData()
SC_DLLPUBLIC void SetIgnoreEmptyRows(bool bSet)
sal_uInt16 nIgnoreEmptyMode
SC_DLLPUBLIC ScDPSaveDimension * GetExistingDimensionByName(std::u16string_view rName) const
void SetDupFlag(bool bSet)
SC_DLLPUBLIC void SetFilterButton(bool bSet)
ScDPSaveDimension * DuplicateDimension(std::u16string_view rName)
sal_uInt16 nColumnGrandMode
bool GetFilterButton() const
void SetPosition(ScDPSaveDimension *pDim, tools::Long nNew)
bool mbDimensionMembersBuilt
if true, all dimensions already have all of their member instances created.
SC_DLLPUBLIC void SetShowDetails(bool bSet)
std::optional< OUString > mpSubtotalName
bool GetColumnGrand() const
SC_DLLPUBLIC void SetGrandTotalName(const OUString &rName)
SC_DLLPUBLIC void SetDrillDown(bool bSet)
Base class that abstracts different data source types of a datapilot table.
SC_DLLPUBLIC bool HasIsVisible() const
tools::Long nUsedHierarchy
bool GetShowDetails() const
const DimsType & GetDimensions() const
std::unordered_map< OUString, size_t > DupNameCountType
sal_uInt16 nShowEmptyMode
sal_uInt16 nRepeatEmptyMode
std::unique_ptr< css::sheet::DataPilotFieldReference > pReferenceValue
bool GetShowEmpty() const
std::unique_ptr< css::sheet::DataPilotFieldLayoutInfo > pLayoutInfo
ScGeneralFunction
the css::sheet::GeneralFunction enum is extended by constants in GeneralFunction2, which causes some type-safety issues.
const OUString & GetName() const
std::vector< std::unique_ptr< ScDPSaveDimension > > DimsType
std::unique_ptr< css::sheet::DataPilotFieldAutoShowInfo > pAutoShowInfo
bool bSubTotalDefault
at level
const css::sheet::DataPilotFieldAutoShowInfo * GetAutoShowInfo() const
SC_DLLPUBLIC void SetColumnGrand(bool bSet)
SC_DLLPUBLIC void SetRowGrand(bool bSet)
void WriteToSource(const css::uno::Reference< css::sheet::XDimensionsSupplier > &xSource)
void Dump(int nIndent=0) const
bool bRepeatItemLabels
at level
SC_DLLPUBLIC const std::optional< OUString > & GetLayoutName() const
void RemoveAllGroupDimensions(const OUString &rSrcDimName, std::vector< OUString > *pDeletedNames=nullptr)
std::optional< OUString > mpLayoutName
SC_DLLPUBLIC ScDPSaveDimension * GetDimensionByName(const OUString &rName)
Get a dimension object by its name.
const css::sheet::DataPilotFieldReference * GetReferenceValue() const
SC_DLLPUBLIC ScDPSaveDimension * GetDataLayoutDimension()
ScDPSaveMember(const OUString &rName)
std::vector< ScGeneralFunction > maSubTotalFuncs
at level
SC_DLLPUBLIC ScDPSaveData()
SC_DLLPUBLIC bool HasShowDetails() const