30#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
51 class XDimensionsSupplier;
52 struct DataPilotTablePositionData;
53 struct DataPilotTableHeaderData;
54 struct DataPilotFieldFilter;
78 OUString aUser, OUString aPass );
97 css::uno::Reference<css::sheet::XDimensionsSupplier>
xSource;
111 SAL_DLLPRIVATE
void CreateObjects();
112 SAL_DLLPRIVATE
void CreateOutput();
113 SAL_DLLPRIVATE
void ClearSource();
114 SAL_DLLPRIVATE
void FillLabelDataForDimension(
115 const css::uno::Reference< css::container::XIndexAccess>& xDims,
125 void EnableGetPivotData(
bool b);
127 void SetAllowMove(
bool bSet);
129 void InvalidateData();
131 void ClearTableData();
132 void ReloadGroupTableData();
135 ScRange GetNewOutputRange(
bool& rOverflow );
143 void SetOutRange(
const ScRange& rRange);
144 const ScRange& GetOutRange()
const;
146 void SetHeaderLayout(
bool bUseGrid);
153 void WriteSourceDataTo(
ScDPObject& rDest )
const;
154 void WriteTempDataTo(
ScDPObject& rDest )
const;
160 css::uno::Reference<css::sheet::XDimensionsSupplier>
const & GetSource();
162 bool IsSheetData()
const;
166 void SetName(
const OUString& rNew);
167 const OUString&
GetName()
const {
return aTableName; }
168 void SetTag(
const OUString& rNew);
169 const OUString&
GetTag()
const {
return aTableTag; }
176 bool IsDataDescriptionCell(
const ScAddress& rPos);
178 bool IsDimNameInUse(std::u16string_view rName)
const;
179 OUString GetDimName(
tools::Long nDim,
bool& rIsDataLayout, sal_Int32* pFlags =
nullptr );
182 void GetHeaderPositionData(
const ScAddress& rPos, css::sheet::DataPilotTableHeaderData& rData);
183 tools::Long GetHeaderDim(
const ScAddress& rPos, css::sheet::DataPilotFieldOrientation& rOrient );
184 bool GetHeaderDrag(
const ScAddress& rPos,
bool bMouseLeft,
bool bMouseTop,
187 bool IsFilterButton(
const ScAddress& rPos );
189 OUString GetFormattedString( std::u16string_view rDimName,
const double fValue );
192 const OUString& rDataFieldName,
193 std::vector<css::sheet::DataPilotFieldFilter>& rFilters);
196 OUString& rDataFieldName,
197 std::vector<css::sheet::DataPilotFieldFilter>& rFilters,
198 std::vector<sal_Int16>& rFilterFuncs,
199 std::u16string_view rFilterList );
203 void ToggleDetails(
const css::sheet::DataPilotTableHeaderData& rElemDesc,
ScDPObject* pDestObj);
209 void GetFieldIdsNames(css::sheet::DataPilotFieldOrientation nOrient, std::vector<tools::Long>& rIndices,
210 std::vector<OUString>& rNames);
212 bool GetHierarchiesNA( sal_Int32 nDim, css::uno::Reference< css::container::XNameAccess >& xHiers );
213 void GetHierarchies( sal_Int32 nDim, css::uno::Sequence< OUString >& rHiers );
215 sal_Int32 GetUsedHierarchy( sal_Int32 nDim );
217 bool GetMembersNA( sal_Int32 nDim, css::uno::Reference< css::sheet::XMembersAccess >& xMembers );
218 bool GetMembersNA( sal_Int32 nDim, sal_Int32 nHier, css::uno::Reference< css::sheet::XMembersAccess >& xMembers );
220 bool GetMemberNames( sal_Int32 nDim, css::uno::Sequence< OUString >& rNames );
221 bool GetMembers( sal_Int32 nDim, sal_Int32 nHier, ::std::vector<ScDPLabelData::Member>& rMembers );
228 void GetPositionData(
const ScAddress& rPos, css::sheet::DataPilotTablePositionData& rPosData);
230 bool GetDataFieldPositionData(
const ScAddress& rPos,
232 css::sheet::DataPilotFieldFilter >& rFilters);
234 void GetDrillDownData(
const ScAddress& rPos,
235 css::uno::Sequence< css::uno::Sequence< css::uno::Any > >& rTableData);
239 void RefreshAfterLoad();
241 void BuildAllDimensionMembers();
247 bool SyncAllDimensionMembers();
249 static bool HasRegisteredSources();
250 static std::vector<OUString> GetRegisteredSources();
251 static css::uno::Reference<css::sheet::XDimensionsSupplier>
254 static void ConvertOrientation(
257 const css::uno::Reference< css::sheet::XDimensionsSupplier>& xSource,
263 static bool IsOrientationAllowed( css::sheet::DataPilotFieldOrientation nOrient, sal_Int32 nDimFlags );
267 maInteropGrabBag = std::move(val);
271 if (
const auto it = maInteropGrabBag.find(
sName); it != maInteropGrabBag.end())
272 return {
true, it->second };
274 return {
false, css::uno::Any() };
294 typedef std::map<size_t, std::unique_ptr<ScDPCache>>
CachesType;
323 typedef ::std::map<OUString, std::unique_ptr<ScDPCache>>
CachesType;
328 bool hasCache(
const OUString& rName)
const;
349 DBType(sal_Int32 nSdbType, OUString aDBName, OUString aCommand);
368 bool hasCache(sal_Int32 nSdbType,
const OUString& rDBName,
const OUString& rCommand)
const;
370 sal_Int32 nSdbType,
const OUString& rDBName,
const OUString& rCommand,
375 sal_Int32 nSdbType,
const OUString& rDBName,
const OUString& rCommand);
377 static css::uno::Reference<css::sdbc::XRowSet>
createRowSet(
378 sal_Int32 nSdbType,
const OUString& rDBName,
const OUString& rCommand);
381 sal_Int32 nSdbType,
const OUString& rDBName,
const OUString& rCommand,
432 void DumpTables()
const;
442 sal_Int32 nSdbType, std::u16string_view rDBName, std::u16string_view rCommand,
446 typedef std::vector< std::unique_ptr<ScDPObject> >
TablesType;
This class represents the cached data part of the datapilot cache table implementation.
Data caches for external database sources.
static css::uno::Reference< css::sdbc::XRowSet > createRowSet(sal_Int32 nSdbType, const OUString &rDBName, const OUString &rCommand)
const ScDPCache * getCache(sal_Int32 nSdbType, const OUString &rDBName, const OUString &rCommand, const ScDPDimensionSaveData *pDimData)
::std::map< DBType, std::unique_ptr< ScDPCache >, DBType::less > CachesType
bool remove(const ScDPCache *p)
void updateCache(sal_Int32 nSdbType, const OUString &rDBName, const OUString &rCommand, o3tl::sorted_vector< ScDPObject * > &rRefs)
ScDPCache * getExistingCache(sal_Int32 nSdbType, const OUString &rDBName, const OUString &rCommand)
bool hasCache(sal_Int32 nSdbType, const OUString &rDBName, const OUString &rCommand) const
DBCaches(ScDocument &rDoc)
Data caches for range name based source data.
::std::map< OUString, std::unique_ptr< ScDPCache > > CachesType
bool hasCache(const OUString &rName) const
ScDPCache * getExistingCache(const OUString &rName)
const ScDPCache * getCache(const OUString &rName, const ScRange &rRange, const ScDPDimensionSaveData *pDimData)
void updateCache(const OUString &rName, const ScRange &rRange, o3tl::sorted_vector< ScDPObject * > &rRefs)
bool remove(const ScDPCache *p)
NameCaches(ScDocument &rDoc)
Stores and manages all caches from internal sheets.
std::vector< ScRange > RangeIndexType
SC_DLLPUBLIC const std::vector< ScRange > & getAllRanges() const
SC_DLLPUBLIC size_t size() const
bool hasCache(const ScRange &rRange) const
bool remove(const ScDPCache *p)
const ScDPCache * getCache(const ScRange &rRange, const ScDPDimensionSaveData *pDimData)
std::map< size_t, std::unique_ptr< ScDPCache > > CachesType
SC_DLLPUBLIC ScDPCache * getExistingCache(const ScRange &rRange)
SheetCaches(ScDocument &rDoc)
void updateReference(UpdateRefMode eMode, const ScRange &r, SCCOL nDx, SCROW nDy, SCTAB nDz)
void updateCache(const ScRange &rRange, o3tl::sorted_vector< ScDPObject * > &rRefs)
bool RefsEqual(const ScDPCollection &r) const
void WriteRefsTo(ScDPCollection &r) const
SC_DLLPUBLIC ScDPObject * InsertNewTable(std::unique_ptr< ScDPObject > pDPObj)
bool IntersectsTableByColumns(SCCOL nCol1, SCCOL nCol2, SCROW nRow, SCTAB nTab) const
SheetCaches maSheetCaches
SC_DLLPUBLIC SheetCaches & GetSheetCaches()
void FreeTable(const ScDPObject *pDPObj)
void GetAllTables(const ScRange &rSrcRange, o3tl::sorted_vector< ScDPObject * > &rRefs) const
SC_DLLPUBLIC size_t GetCount() const
void RemoveCache(const ScDPCache *pCache)
Only to be called from ScDPCache::RemoveReference().
void CopyToTab(SCTAB nOld, SCTAB nNew)
ScDPObject * GetByName(std::u16string_view rName) const
SC_DLLPUBLIC ScDPObject & operator[](size_t nIndex)
TranslateId ReloadCache(const ScDPObject *pDPObj, o3tl::sorted_vector< ScDPObject * > &rRefs)
bool IntersectsTableByRows(SCCOL nCol, SCROW nRow1, SCROW nRow2, SCTAB nTab) const
ScDPCollection(ScDocument &rDocument)
ScRangeList GetAllTableRanges(SCTAB nTab) const
void DeleteOnTab(SCTAB nTab)
void UpdateReference(UpdateRefMode eUpdateRefMode, const ScRange &r, SCCOL nDx, SCROW nDy, SCTAB nDz)
OUString CreateNewName() const
Create a new name that's not yet used by any existing data pilot objects.
SC_DLLPUBLIC bool GetReferenceGroups(const ScDPObject &rDPObj, const ScDPDimensionSaveData **pGroups) const
std::vector< std::unique_ptr< ScDPObject > > TablesType
NameCaches & GetNameCaches()
bool ReloadGroupsInCache(const ScDPObject *pDPObj, o3tl::sorted_vector< ScDPObject * > &rRefs)
SC_DLLPUBLIC bool HasTable(const ScDPObject *pDPObj) const
This class has to do with handling exclusively grouped dimensions? TODO: Find out what this class doe...
const ScDPServiceDesc * GetDPServiceDesc() const
bool GetMembersNA(sal_Int32 nDim, sal_Int32 nHier, css::uno::Reference< css::sheet::XMembersAccess > &xMembers)
std::unique_ptr< ScDPServiceDesc > pServDesc
bool IsServiceData() const
std::unique_ptr< ScImportSourceDesc > pImpDesc
std::unique_ptr< ScDPOutput > pOutput
bool GetHeaderLayout() const
bool mbEnableGetPivotData
std::shared_ptr< ScDPTableData > mpTableData
std::pair< bool, css::uno::Any > GetInteropGrabBagValue(const OUString &sName) const
css::uno::Reference< css::sheet::XDimensionsSupplier > xSource
const ScSheetSourceDesc * GetSheetDesc() const
std::unique_ptr< ScSheetSourceDesc > pSheetDesc
bool GetMembersNA(sal_Int32 nDim, css::uno::Reference< css::sheet::XMembersAccess > &xMembers)
std::unique_ptr< ScDPSaveData > pSaveData
ScDPSaveData * GetSaveData() const
bool IsImportData() const
void PutInteropGrabBag(std::map< OUString, css::uno::Any > &&val)
const OUString & GetName() const
const OUString & GetTag() const
std::map< OUString, css::uno::Any > maInteropGrabBag
const ScImportSourceDesc * GetImportSourceDesc() const
Base class that abstracts different data source types of a datapilot table.
This class contains authoritative information on the internal reference used as the data source for d...
bool operator<(const ScDPCollection::DBType &left, const ScDPCollection::DBType &right)
std::unordered_set< OUString > ScDPUniqueStringSet
void Clear(EHistoryType eHistory)
std::vector< std::unique_ptr< ScDPLabelData > > ScDPLabelDataVector
std::vector< ScPivotField > ScPivotFieldVector
bool operator()(const DBType &left, const DBType &right) const
Defines connection type to external data source.
DBType(sal_Int32 nSdbType, OUString aDBName, OUString aCommand)
bool operator==(const ScDPServiceDesc &rOther) const
ScDPServiceDesc(OUString aServ, OUString aSrc, OUString aNam, OUString aUser, OUString aPass)