Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sc / inc / dpsdbtab.hxx
blob8c11160cf1416dae05a79af129331f27a25db9d0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SC_INC_DPSDBTAB_HXX
21 #define INCLUDED_SC_INC_DPSDBTAB_HXX
23 #include "dptabdat.hxx"
25 #include <com/sun/star/sheet/DataImportMode.hpp>
27 #include <unordered_set>
28 #include <vector>
30 class ScDocument;
31 class ScDPCache;
32 class ScDPDimensionSaveData;
34 struct ScImportSourceDesc
36 OUString aDBName;
37 OUString aObject;
38 css::sheet::DataImportMode nType;
39 bool bNative;
40 ScDocument* mpDoc;
42 ScImportSourceDesc(ScDocument* pDoc) : nType(css::sheet::DataImportMode_NONE), bNative(false), mpDoc(pDoc) {}
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; }
51 sal_Int32 GetCommandType() const;
52 const ScDPCache* CreateCache(const ScDPDimensionSaveData* pDimData) const;
55 /**
56 * This class represents source data from database source.
58 class ScDatabaseDPData : public ScDPTableData
60 private:
61 ScDPFilteredCache aCacheTable;
62 public:
63 ScDatabaseDPData(const ScDocument* pDoc, const ScDPCache& rCache);
64 virtual ~ScDatabaseDPData() override;
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;
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;
82 #if DUMP_PIVOT_TABLE
83 virtual void Dump() const override;
84 #endif
87 #endif
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */