Coverage Report

Created: 2025-12-31 10:39

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