30 #include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
50 class XDimensionsSupplier;
51 struct DataPilotTablePositionData;
52 struct DataPilotTableHeaderData;
53 struct DataPilotFieldFilter;
76 ScDPServiceDesc(
const OUString& rServ,
const OUString& rSrc,
const OUString& rNam,
77 const OUString& rUser,
const OUString& rPass );
96 css::uno::Reference<css::sheet::XDimensionsSupplier>
xSource;
104 bool mbHeaderLayout:1;
106 bool bSettingsChanged:1;
107 bool mbEnableGetPivotData:1;
110 SAL_DLLPRIVATE
void CreateObjects();
111 SAL_DLLPRIVATE
void CreateOutput();
112 SAL_DLLPRIVATE
void ClearSource();
113 SAL_DLLPRIVATE
void FillLabelDataForDimension(
114 const css::uno::Reference< css::container::XIndexAccess>& xDims,
124 void EnableGetPivotData(
bool b);
126 void SetAllowMove(
bool bSet);
128 void InvalidateData();
130 void ClearTableData();
131 void ReloadGroupTableData();
134 ScRange GetNewOutputRange(
bool& rOverflow );
142 void SetOutRange(
const ScRange& rRange);
143 const ScRange& GetOutRange()
const;
145 void SetHeaderLayout(
bool bUseGrid);
152 void WriteSourceDataTo(
ScDPObject& rDest )
const;
153 void WriteTempDataTo(
ScDPObject& rDest )
const;
159 css::uno::Reference<css::sheet::XDimensionsSupplier>
const & GetSource();
161 bool IsSheetData()
const;
165 void SetName(
const OUString& rNew);
166 const OUString&
GetName()
const {
return aTableName; }
167 void SetTag(
const OUString& rNew);
168 const OUString&
GetTag()
const {
return aTableTag; }
175 bool IsDataDescriptionCell(
const ScAddress& rPos);
177 bool IsDimNameInUse(std::u16string_view rName)
const;
178 OUString GetDimName(
tools::Long nDim,
bool& rIsDataLayout, sal_Int32* pFlags =
nullptr );
181 void GetHeaderPositionData(
const ScAddress& rPos, css::sheet::DataPilotTableHeaderData& rData);
182 tools::Long GetHeaderDim(
const ScAddress& rPos, css::sheet::DataPilotFieldOrientation& rOrient );
183 bool GetHeaderDrag(
const ScAddress& rPos,
bool bMouseLeft,
bool bMouseTop,
186 bool IsFilterButton(
const ScAddress& rPos );
188 OUString GetFormattedString( std::u16string_view rDimName,
const double fValue );
191 const OUString& rDataFieldName,
192 std::vector<css::sheet::DataPilotFieldFilter>& rFilters);
195 OUString& rDataFieldName,
196 std::vector<css::sheet::DataPilotFieldFilter>& rFilters,
197 std::vector<sal_Int16>& rFilterFuncs,
198 const OUString& rFilterList );
202 void ToggleDetails(
const css::sheet::DataPilotTableHeaderData& rElemDesc,
ScDPObject* pDestObj);
208 bool GetHierarchiesNA( sal_Int32 nDim, css::uno::Reference< css::container::XNameAccess >& xHiers );
209 void GetHierarchies( sal_Int32 nDim, css::uno::Sequence< OUString >& rHiers );
211 sal_Int32 GetUsedHierarchy( sal_Int32 nDim );
213 bool GetMembersNA( sal_Int32 nDim, css::uno::Reference< css::sheet::XMembersAccess >& xMembers );
214 bool GetMembersNA( sal_Int32 nDim, sal_Int32 nHier, css::uno::Reference< css::sheet::XMembersAccess >& xMembers );
216 bool GetMemberNames( sal_Int32 nDim, css::uno::Sequence< OUString >& rNames );
217 bool GetMembers( sal_Int32 nDim, sal_Int32 nHier, ::std::vector<ScDPLabelData::Member>& rMembers );
224 void GetPositionData(
const ScAddress& rPos, css::sheet::DataPilotTablePositionData& rPosData);
226 bool GetDataFieldPositionData(
const ScAddress& rPos,
228 css::sheet::DataPilotFieldFilter >& rFilters);
230 void GetDrillDownData(
const ScAddress& rPos,
231 css::uno::Sequence< css::uno::Sequence< css::uno::Any > >& rTableData);
235 void RefreshAfterLoad();
237 void BuildAllDimensionMembers();
243 bool SyncAllDimensionMembers();
245 static bool HasRegisteredSources();
246 static std::vector<OUString> GetRegisteredSources();
247 static css::uno::Reference<css::sheet::XDimensionsSupplier>
250 static void ConvertOrientation(
253 const css::uno::Reference< css::sheet::XDimensionsSupplier>& xSource,
259 static bool IsOrientationAllowed( css::sheet::DataPilotFieldOrientation nOrient, sal_Int32 nDimFlags );
263 maInteropGrabBag = std::move(val);
267 if (
const auto it = maInteropGrabBag.find(sName); it != maInteropGrabBag.end())
268 return {
true, it->second };
270 return {
false, css::uno::Any() };
275 void DumpCache()
const;
290 typedef std::map<size_t, std::unique_ptr<ScDPCache>>
CachesType;
319 typedef ::std::map<OUString, std::unique_ptr<ScDPCache>>
CachesType;
324 bool hasCache(
const OUString& rName)
const;
345 DBType(sal_Int32 nSdbType,
const OUString& rDBName,
const OUString& rCommand);
364 bool hasCache(sal_Int32 nSdbType,
const OUString& rDBName,
const OUString& rCommand)
const;
366 sal_Int32 nSdbType,
const OUString& rDBName,
const OUString& rCommand,
371 sal_Int32 nSdbType,
const OUString& rDBName,
const OUString& rCommand);
373 static css::uno::Reference<css::sdbc::XRowSet>
createRowSet(
374 sal_Int32 nSdbType,
const OUString& rDBName,
const OUString& rCommand);
377 sal_Int32 nSdbType,
const OUString& rDBName,
const OUString& rCommand,
427 #if DEBUG_PIVOT_TABLE
428 void DumpTables()
const;
438 sal_Int32 nSdbType, std::u16string_view rDBName, std::u16string_view rCommand,
442 typedef std::vector< std::unique_ptr<ScDPObject> >
TablesType;
SheetCaches(ScDocument &rDoc)
bool operator()(const DBType &left, const DBType &right) const
This class has to do with handling exclusively grouped dimensions? TODO: Find out what this class doe...
void CopyToTab(SCTAB nOld, SCTAB nNew)
SC_DLLPUBLIC size_t GetCount() const
exports com.sun.star. sdbc
SC_DLLPUBLIC SheetCaches & GetSheetCaches()
DBType(sal_Int32 nSdbType, const OUString &rDBName, const OUString &rCommand)
bool RefsEqual(const ScDPCollection &r) const
::std::map< DBType, std::unique_ptr< ScDPCache >, DBType::less > CachesType
SC_DLLPUBLIC bool GetReferenceGroups(const ScDPObject &rDPObj, const ScDPDimensionSaveData **pGroups) const
std::map< size_t, std::unique_ptr< ScDPCache > > CachesType
void PutInteropGrabBag(std::map< OUString, css::uno::Any > &&val)
void updateReference(UpdateRefMode eMode, const ScRange &r, SCCOL nDx, SCROW nDy, SCTAB nDz)
std::vector< std::unique_ptr< ScDPObject > > TablesType
Data caches for range name based source data.
This class represents the cached data part of the datapilot cache table implementation.
ScDPObject * GetByName(std::u16string_view rName) const
bool IsImportData() const
ScDPServiceDesc(const OUString &rServ, const OUString &rSrc, const OUString &rNam, const OUString &rUser, const OUString &rPass)
exports com.sun.star. sheet
ScDPCollection(ScDocument &rDocument)
exports com.sun.star. container
OUString CreateNewName() const
Create a new name that's not yet used by any existing data pilot objects.
std::shared_ptr< ScDPTableData > mpTableData
const OUString & GetTag() const
css::uno::Reference< css::sheet::XDimensionsSupplier > xSource
Data caches for external database sources.
std::unique_ptr< ScDPServiceDesc > pServDesc
Defines connection type to external data source.
bool ReloadGroupsInCache(const ScDPObject *pDPObj, o3tl::sorted_vector< ScDPObject * > &rRefs)
bool IsServiceData() const
void GetAllTables(const ScRange &rSrcRange, o3tl::sorted_vector< ScDPObject * > &rRefs) const
bool GetHeaderLayout() const
bool IntersectsTableByColumns(SCCOL nCol1, SCCOL nCol2, SCROW nRow, SCTAB nTab) const
const ScDPCache * getCache(const OUString &rName, const ScRange &rRange, const ScDPDimensionSaveData *pDimData)
bool IntersectsTableByRows(SCCOL nCol, SCROW nRow1, SCROW nRow2, SCTAB nTab) const
ScDPCache * getExistingCache(sal_Int32 nSdbType, const OUString &rDBName, const OUString &rCommand)
SC_DLLPUBLIC ScDPObject & operator[](size_t nIndex)
bool operator<(const ScDPCollection::DBType &left, const ScDPCollection::DBType &right)
SC_DLLPUBLIC const std::vector< ScRange > & getAllRanges() const
std::vector< std::unique_ptr< ScDPLabelData > > ScDPLabelDataVector
Stores and manages all caches from internal sheets.
std::vector< ScPivotField > ScPivotFieldVector
const ScDPCache * getCache(const ScRange &rRange, const ScDPDimensionSaveData *pDimData)
::std::map< OUString, std::unique_ptr< ScDPCache > > CachesType
const OUString & GetName() const
std::unique_ptr< ScDPSaveData > pSaveData
NameCaches(ScDocument &rDoc)
bool hasCache(const ScRange &rRange) const
ScDPSaveData * GetSaveData() const
SC_DLLPUBLIC ScDPObject * InsertNewTable(std::unique_ptr< ScDPObject > pDPObj)
const ScImportSourceDesc * GetImportSourceDesc() const
const ScDPServiceDesc * GetDPServiceDesc() const
bool hasCache(sal_Int32 nSdbType, const OUString &rDBName, const OUString &rCommand) const
bool hasCache(const OUString &rName) const
DBCaches(ScDocument &rDoc)
const char * ReloadCache(const ScDPObject *pDPObj, o3tl::sorted_vector< ScDPObject * > &rRefs)
void RemoveCache(const ScDPCache *pCache)
Only to be called from ScDPCache::RemoveReference().
SC_DLLPUBLIC size_t size() const
Base class that abstracts different data source types of a datapilot table.
std::vector< ScRange > RangeIndexType
SC_DLLPUBLIC bool HasTable(const ScDPObject *pDPObj) const
void updateCache(const OUString &rName, const ScRange &rRange, o3tl::sorted_vector< ScDPObject * > &rRefs)
ScRangeList GetAllTableRanges(SCTAB nTab) const
SheetCaches maSheetCaches
std::unordered_set< OUString > ScDPUniqueStringSet
std::unique_ptr< ScImportSourceDesc > pImpDesc
const ScSheetSourceDesc * GetSheetDesc() const
bool operator==(const ScDPServiceDesc &rOther) const
void UpdateReference(UpdateRefMode eUpdateRefMode, const ScRange &r, SCCOL nDx, SCROW nDy, SCTAB nDz)
std::map< OUString, css::uno::Any > maInteropGrabBag
void WriteRefsTo(ScDPCollection &r) const
std::unique_ptr< ScSheetSourceDesc > pSheetDesc
void DeleteOnTab(SCTAB nTab)
static css::uno::Reference< css::sdbc::XRowSet > createRowSet(sal_Int32 nSdbType, const OUString &rDBName, const OUString &rCommand)
std::unique_ptr< ScDPOutput > pOutput
NameCaches & GetNameCaches()
SC_DLLPUBLIC ScDPCache * getExistingCache(const ScRange &rRange)
This class contains authoritative information on the internal reference used as the data source for d...
void updateCache(sal_Int32 nSdbType, const OUString &rDBName, const OUString &rCommand, o3tl::sorted_vector< ScDPObject * > &rRefs)
const ScDPCache * getCache(sal_Int32 nSdbType, const OUString &rDBName, const OUString &rCommand, const ScDPDimensionSaveData *pDimData)
std::pair< bool, css::uno::Any > GetInteropGrabBagValue(const OUString &sName) const
ScDPCache * getExistingCache(const OUString &rName)
void updateCache(const ScRange &rRange, o3tl::sorted_vector< ScDPObject * > &rRefs)
void FreeTable(const ScDPObject *pDPObj)