LibreOffice Module sc (master)  1
dpsdbtab.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SC_INC_DPSDBTAB_HXX
21 #define INCLUDED_SC_INC_DPSDBTAB_HXX
22 
23 #include "dptabdat.hxx"
24 
25 #include <com/sun/star/sheet/DataImportMode.hpp>
26 
27 #include <unordered_set>
28 #include <vector>
29 
30 class ScDocument;
31 class ScDPCache;
33 
35 {
36  OUString aDBName;
37  OUString aObject;
38  css::sheet::DataImportMode nType;
39  bool bNative;
41 
42  ScImportSourceDesc(ScDocument* pDoc) : nType(css::sheet::DataImportMode_NONE), bNative(false), mpDoc(pDoc) {}
43 
44  bool operator== ( const ScImportSourceDesc& rOther ) const
45  { return aDBName == rOther.aDBName &&
46  aObject == rOther.aObject &&
47  nType == rOther.nType &&
48  bNative == rOther.bNative &&
49  mpDoc == rOther.mpDoc; }
50 
51  sal_Int32 GetCommandType() const;
52  const ScDPCache* CreateCache(const ScDPDimensionSaveData* pDimData) const;
53 };
54 
58 class ScDatabaseDPData final : public ScDPTableData
59 {
60 private:
62 public:
63  ScDatabaseDPData(const ScDocument* pDoc, const ScDPCache& rCache);
64  virtual ~ScDatabaseDPData() override;
65 
66  virtual long GetColumnCount() override;
67  virtual OUString getDimensionName(long nColumn) override;
68  virtual bool getIsDataLayoutDimension(long nColumn) override;
69  virtual bool IsDateDimension(long nDim) override;
70  virtual void DisposeData() override;
71  virtual void SetEmptyFlags( bool bIgnoreEmptyRows, bool bRepeatIfEmpty ) override;
72 
73  virtual void CreateCacheTable() override;
74  virtual void FilterCacheTable(const ::std::vector<ScDPFilteredCache::Criterion>& rCriteria, const std::unordered_set<sal_Int32>& rDataDims) override;
75  virtual void GetDrillDownData(const ::std::vector<ScDPFilteredCache::Criterion>& rCriteria,
76  const std::unordered_set<sal_Int32>& rCatDims,
77  css::uno::Sequence< css::uno::Sequence< css::uno::Any > >& rData) override;
78  virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow) override;
79  virtual const ScDPFilteredCache& GetCacheTable() const override;
80  virtual void ReloadCacheTable() override;
81 
82 #if DUMP_PIVOT_TABLE
83  virtual void Dump() const override;
84 #endif
85 };
86 
87 #endif
88 
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class represents source data from database source.
Definition: dpsdbtab.hxx:58
ScDPFilteredCache aCacheTable
Definition: dpsdbtab.hxx:61
This class has to do with handling exclusively grouped dimensions? TODO: Find out what this class doe...
Definition: dpdimsave.hxx:160
virtual void Dump() const override
virtual OUString getDimensionName(long nColumn) override
Definition: dpsdbtab.cxx:86
virtual void ReloadCacheTable() override
Definition: dpsdbtab.cxx:154
virtual void FilterCacheTable(const ::std::vector< ScDPFilteredCache::Criterion > &rCriteria, const std::unordered_set< sal_Int32 > &rDataDims) override
Definition: dpsdbtab.cxx:125
This class represents the cached data part of the datapilot cache table implementation.
Definition: dpcache.hxx:47
virtual bool IsDateDimension(long nDim) override
Definition: dpsdbtab.cxx:104
exports com.sun.star. sheet
const ScDPCache * CreateCache(const ScDPDimensionSaveData *pDimData) const
Definition: dpsdbtab.cxx:50
ScImportSourceDesc(ScDocument *pDoc)
Definition: dpsdbtab.hxx:42
virtual void GetDrillDownData(const ::std::vector< ScDPFilteredCache::Criterion > &rCriteria, const std::unordered_set< sal_Int32 > &rCatDims, css::uno::Sequence< css::uno::Sequence< css::uno::Any > > &rData) override
Definition: dpsdbtab.cxx:132
virtual void CalcResults(CalcInfo &rInfo, bool bAutoShow) override
Definition: dpsdbtab.cxx:143
ScDocument * mpDoc
Definition: dpsdbtab.hxx:40
This structure stores dimension information used when calculating results.
Definition: dptabdat.hxx:69
virtual void CreateCacheTable() override
Definition: dpsdbtab.cxx:116
ScDatabaseDPData(const ScDocument *pDoc, const ScDPCache &rCache)
Definition: dpsdbtab.cxx:63
virtual void SetEmptyFlags(bool bIgnoreEmptyRows, bool bRepeatIfEmpty) override
Definition: dpsdbtab.cxx:110
virtual void DisposeData() override
Definition: dpsdbtab.cxx:74
OUString aDBName
Definition: dpsdbtab.hxx:36
css::sheet::DataImportMode nType
Definition: dpsdbtab.hxx:38
OUString aObject
Definition: dpsdbtab.hxx:37
Base class that abstracts different data source types of a datapilot table.
Definition: dptabdat.hxx:56
virtual ~ScDatabaseDPData() override
Definition: dpsdbtab.cxx:70
virtual long GetColumnCount() override
use (new) typed collection instead of ScStrCollection or separate Str and ValueCollection ...
Definition: dpsdbtab.cxx:80
This class is only a wrapper to the actual cache, to provide filtering on the raw data based on the q...
virtual bool getIsDataLayoutDimension(long nColumn) override
Definition: dpsdbtab.cxx:99
sal_Int32 GetCommandType() const
Definition: dpsdbtab.cxx:35
virtual const ScDPFilteredCache & GetCacheTable() const override
Definition: dpsdbtab.cxx:149
bool operator==(const ScImportSourceDesc &rOther) const
Definition: dpsdbtab.hxx:44