/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 | | /** Visitor interface for traversing the pivot table result tree structure. |
22 | | * |
23 | | * Defines the functions that are triggered with data, when the tree is traversed. |
24 | | **/ |
25 | | class SC_DLLPUBLIC PivotTableResultVisitor |
26 | | { |
27 | | public: |
28 | | virtual bool filterOrientation(css::sheet::DataPilotFieldOrientation eOrientation) |
29 | 0 | { |
30 | 0 | return eOrientation == css::sheet::DataPilotFieldOrientation_HIDDEN; |
31 | 0 | } |
32 | | |
33 | | virtual void startDimension(sal_Int32 /*nDimensionIndex*/, |
34 | | css::uno::Reference<css::uno::XInterface> const& /*xDimension*/, |
35 | | css::sheet::DataPilotFieldOrientation /*eOrientation*/) |
36 | 0 | { |
37 | 0 | } |
38 | | |
39 | 0 | virtual void endDimension() {} |
40 | | |
41 | | virtual void startLevel(sal_Int32 /*nLevelIndex*/, |
42 | | css::uno::Reference<css::uno::XInterface> const& /*xLevel*/, |
43 | | OUString const& /*rLevelName*/) |
44 | 0 | { |
45 | 0 | } |
46 | | |
47 | 0 | virtual void endLevel() {} |
48 | | |
49 | | virtual void memberResult(css::sheet::MemberResult const& rResult, sal_Int32 nIndex, |
50 | | sal_Int32 nSize) |
51 | | = 0; |
52 | | }; |
53 | | |
54 | | /// Traverses the pivot table result tree and triggers visitors functions with data |
55 | | class SC_DLLPUBLIC PivotTableResultTraverser |
56 | | { |
57 | | private: |
58 | | ScDPObject& mrDPObject; |
59 | | PivotTableResultVisitor& mrVisitor; |
60 | | |
61 | | public: |
62 | | PivotTableResultTraverser(ScDPObject& rDPObject, PivotTableResultVisitor& rVisitor) |
63 | 0 | : mrDPObject(rDPObject) |
64 | 0 | , mrVisitor(rVisitor) |
65 | 0 | { |
66 | 0 | } |
67 | | |
68 | | void traverse(); |
69 | | }; |
70 | | } |
71 | | |
72 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |