25 #include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
26 #include <rtl/ustring.hxx>
33 #include <unordered_map>
34 #include <unordered_set>
38 class XDimensionsSupplier;
39 struct DataPilotFieldReference;
40 struct DataPilotFieldSortInfo;
41 struct DataPilotFieldAutoShowInfo;
42 struct DataPilotFieldLayoutInfo;
72 {
return bool(nVisibleMode); }
77 {
return bool(nShowDetailsMode); }
79 void SetName(
const OUString& rNew );
85 void WriteToSource(
const css::uno::Reference<css::uno::XInterface>& xMember,
86 sal_Int32 nPosition );
89 void Dump(
int nIndent = 0)
const;
109 std::unique_ptr<css::sheet::DataPilotFieldSortInfo>
pSortInfo;
111 std::unique_ptr<css::sheet::DataPilotFieldLayoutInfo>
pLayoutInfo;
118 std::unordered_map<OUString, std::unique_ptr<ScDPSaveMember>>
maMemberHash;
129 {
return maMemberList; }
131 void AddMember(std::unique_ptr<ScDPSaveMember> pMember);
143 {
return bIsDataLayout; }
145 void SetName(
const OUString& rNew );
148 void SetSubTotals(std::vector<ScGeneralFunction>
const & rFuncs);
150 {
return maSubTotalFuncs.size(); }
153 {
return maSubTotalFuncs[nIndex]; }
155 bool HasShowEmpty()
const;
156 void SetShowEmpty(
bool bSet);
158 {
return bool(nShowEmptyMode); }
160 void SetRepeatItemLabels(
bool bSet);
162 {
return bRepeatItemLabels; }
166 {
return nFunction; }
170 {
return nUsedHierarchy; }
172 void SetLayoutName(
const OUString& rName);
173 const std::optional<OUString> & GetLayoutName()
const;
174 void RemoveLayoutName();
175 void SetSubtotalName(
const OUString& rName);
176 const std::optional<OUString> & GetSubtotalName()
const;
177 void RemoveSubtotalName();
179 bool IsMemberNameInUse(
const OUString& rName)
const;
182 {
return pReferenceValue.get(); }
184 void SetReferenceValue(
const css::sheet::DataPilotFieldReference* pNew);
187 {
return pSortInfo.get(); }
189 void SetSortInfo(
const css::sheet::DataPilotFieldSortInfo* pNew);
191 {
return pAutoShowInfo.get(); }
193 void SetAutoShowInfo(
const css::sheet::DataPilotFieldAutoShowInfo* pNew);
195 {
return pLayoutInfo.get(); }
197 void SetLayoutInfo(
const css::sheet::DataPilotFieldLayoutInfo* pNew);
199 void SetCurrentPage(
const OUString* pPage );
200 OUString GetCurrentPage()
const;
203 {
return nOrientation; }
218 void SetMemberPosition(
const OUString& rName, sal_Int32 nNewPos );
220 void WriteToSource(
const css::uno::Reference<css::uno::XInterface>& xDim );
222 void UpdateMemberVisibility(
const std::unordered_map< OUString, bool>& rData);
224 bool HasInvisibleMember()
const;
226 void RemoveObsoleteMembers(
const MemberSetType& rMembers);
229 void Dump(
int nIndent = 0)
const;
238 typedef std::vector<std::unique_ptr<ScDPSaveDimension>>
DimsType;
289 css::sheet::DataPilotFieldOrientation eOrientation,
290 std::vector<const ScDPSaveDimension*>& rDims)
const;
323 {
return bool(nColumnGrandMode); }
327 {
return bool(nRowGrandMode); }
331 {
return bool(nIgnoreEmptyMode); }
335 {
return bool(nRepeatEmptyMode); }
345 void WriteToSource(
const css::uno::Reference<css::sheet::XDimensionsSupplier>& xSource );
349 {
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