Line data Source code
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 <com/sun/star/uno/Reference.hxx>
24 :
25 : #include "dptabdat.hxx"
26 :
27 : #include <unordered_set>
28 : #include <vector>
29 :
30 : class ScDPFilteredCache;
31 : class ScDocument;
32 : class ScDPCache;
33 : class ScDPDimensionSaveData;
34 :
35 0 : struct ScImportSourceDesc
36 : {
37 : OUString aDBName;
38 : OUString aObject;
39 : sal_uInt16 nType; // enum DataImportMode
40 : bool bNative;
41 : ScDocument* mpDoc;
42 :
43 0 : ScImportSourceDesc(ScDocument* pDoc) : nType(0), bNative(false), mpDoc(pDoc) {}
44 :
45 0 : bool operator== ( const ScImportSourceDesc& rOther ) const
46 0 : { return aDBName == rOther.aDBName &&
47 0 : aObject == rOther.aObject &&
48 0 : nType == rOther.nType &&
49 0 : bNative == rOther.bNative &&
50 0 : mpDoc == rOther.mpDoc; }
51 :
52 : sal_Int32 GetCommandType() const;
53 : const ScDPCache* CreateCache(const ScDPDimensionSaveData* pDimData) const;
54 : };
55 :
56 : /**
57 : * This class represents source data from database source.
58 : */
59 : class ScDatabaseDPData : public ScDPTableData
60 : {
61 : private:
62 : ScDPFilteredCache aCacheTable;
63 : public:
64 : ScDatabaseDPData(ScDocument* pDoc, const ScDPCache& rCache);
65 : virtual ~ScDatabaseDPData();
66 :
67 : virtual long GetColumnCount() SAL_OVERRIDE;
68 : virtual OUString getDimensionName(long nColumn) SAL_OVERRIDE;
69 : virtual bool getIsDataLayoutDimension(long nColumn) SAL_OVERRIDE;
70 : virtual bool IsDateDimension(long nDim) SAL_OVERRIDE;
71 : virtual void DisposeData() SAL_OVERRIDE;
72 : virtual void SetEmptyFlags( bool bIgnoreEmptyRows, bool bRepeatIfEmpty ) SAL_OVERRIDE;
73 :
74 : virtual void CreateCacheTable() SAL_OVERRIDE;
75 : virtual void FilterCacheTable(const ::std::vector<ScDPFilteredCache::Criterion>& rCriteria, const std::unordered_set<sal_Int32>& rDataDims) SAL_OVERRIDE;
76 : virtual void GetDrillDownData(const ::std::vector<ScDPFilteredCache::Criterion>& rCriteria,
77 : const std::unordered_set<sal_Int32>& rCatDims,
78 : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData) SAL_OVERRIDE;
79 : virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow) SAL_OVERRIDE;
80 : virtual const ScDPFilteredCache& GetCacheTable() const SAL_OVERRIDE;
81 : virtual void ReloadCacheTable() SAL_OVERRIDE;
82 : };
83 :
84 : #endif
85 :
86 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|