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 SC_DPSDBTAB_HXX
21 : #define SC_DPSDBTAB_HXX
22 :
23 : #include <com/sun/star/uno/Reference.hxx>
24 :
25 : #include "dptabdat.hxx"
26 :
27 : #include <vector>
28 : #include <boost/unordered_set.hpp>
29 :
30 : class ScDPFilteredCache;
31 : class ScDocument;
32 : class ScDPCache;
33 : class ScDPDimensionSaveData;
34 :
35 0 : struct ScImportSourceDesc
36 : {
37 : ::rtl::OUString aDBName;
38 : ::rtl::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 : nType == rOther.nType &&
49 : 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();
68 : virtual rtl::OUString getDimensionName(long nColumn);
69 : virtual sal_Bool getIsDataLayoutDimension(long nColumn);
70 : virtual sal_Bool IsDateDimension(long nDim);
71 : virtual void DisposeData();
72 : virtual void SetEmptyFlags( sal_Bool bIgnoreEmptyRows, sal_Bool bRepeatIfEmpty );
73 :
74 : virtual void CreateCacheTable();
75 : virtual void FilterCacheTable(const ::std::vector<ScDPFilteredCache::Criterion>& rCriteria, const ::boost::unordered_set<sal_Int32>& rDataDims);
76 : virtual void GetDrillDownData(const ::std::vector<ScDPFilteredCache::Criterion>& rCriteria,
77 : const ::boost::unordered_set<sal_Int32>& rCatDims,
78 : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData);
79 : virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow);
80 : virtual const ScDPFilteredCache& GetCacheTable() const;
81 : virtual void ReloadCacheTable();
82 : };
83 :
84 :
85 :
86 : #endif
87 :
88 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|