/src/libreoffice/sc/inc/pivot/PivotTableResultTraverser.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 | | |
10 | | #pragma once |
11 | | |
12 | | #include <dpobject.hxx> |
13 | | #include <scdllapi.h> |
14 | | #include <rtl/ustring.hxx> |
15 | | |
16 | | #include <com/sun/star/sheet/MemberResult.hpp> |
17 | | #include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> |
18 | | |
19 | | namespace sc |
20 | | { |
21 | | namespace pivot |
22 | | { |
23 | | SC_DLLPUBLIC css::uno::Any |
24 | | getMemberForLevel(css::uno::Reference<css::uno::XInterface> const& xLevel, OUString const& rName); |
25 | | } |
26 | | |
27 | | /** Visitor interface for traversing the pivot table result tree structure. |
28 | | * |
29 | | * Defines the functions that are triggered with data, when the tree is traversed. |
30 | | **/ |
31 | | class SC_DLLPUBLIC PivotTableResultVisitor |
32 | | { |
33 | | public: |
34 | | virtual bool filterOrientation(css::sheet::DataPilotFieldOrientation eOrientation) |
35 | 0 | { |
36 | 0 | return eOrientation == css::sheet::DataPilotFieldOrientation_HIDDEN; |
37 | 0 | } |
38 | | |
39 | | virtual void startDimension(sal_Int32 /*nDimensionIndex*/, |
40 | | css::uno::Reference<css::uno::XInterface> const& /*xDimension*/, |
41 | | css::sheet::DataPilotFieldOrientation /*eOrientation*/) |
42 | 0 | { |
43 | 0 | } |
44 | | |
45 | 0 | virtual void endDimension() {} |
46 | | |
47 | | virtual void startLevel(sal_Int32 /*nLevelIndex*/, |
48 | | css::uno::Reference<css::uno::XInterface> const& /*xLevel*/, |
49 | | OUString const& /*rLevelName*/) |
50 | 0 | { |
51 | 0 | } |
52 | | |
53 | 0 | virtual void endLevel() {} |
54 | | |
55 | | virtual void memberResult(css::sheet::MemberResult const& rResult, sal_Int32 nIndex, |
56 | | sal_Int32 nSize) |
57 | | = 0; |
58 | | }; |
59 | | |
60 | | /// Traverses the pivot table result tree and triggers visitors functions with data |
61 | | class SC_DLLPUBLIC PivotTableResultTraverser |
62 | | { |
63 | | private: |
64 | | ScDPObject& mrDPObject; |
65 | | PivotTableResultVisitor& mrVisitor; |
66 | | |
67 | | public: |
68 | | PivotTableResultTraverser(ScDPObject& rDPObject, PivotTableResultVisitor& rVisitor) |
69 | 0 | : mrDPObject(rDPObject) |
70 | 0 | , mrVisitor(rVisitor) |
71 | 0 | { |
72 | 0 | } |
73 | | |
74 | | void traverse(); |
75 | | }; |
76 | | } |
77 | | |
78 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |