Get the style color and number just once
[LibreOffice.git] / sc / source / filter / inc / SparklineFragment.hxx
blob0d4e76e6b9a93e4c285e5ef73bb31b8715d950e1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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 */
10 #pragma once
12 #include "excelhandlers.hxx"
13 #include <oox/core/contexthandler.hxx>
14 #include <SparklineGroup.hxx>
16 #include <vector>
17 #include <memory>
19 namespace oox
21 class AttributeList;
24 namespace oox::xls
26 /** Transitional sparkline data */
27 class Sparkline
29 public:
30 ScRangeList m_aInputRange;
31 ScRangeList m_aTargetRange;
32 Sparkline() {}
35 /** Transitional sparkline group data */
36 class SparklineGroup
38 private:
39 std::vector<Sparkline> m_aSparklines;
41 std::shared_ptr<sc::SparklineGroup> m_pSparklineGroup;
43 public:
44 SparklineGroup()
45 : m_pSparklineGroup(new sc::SparklineGroup)
49 const std::shared_ptr<sc::SparklineGroup>& getSparklineGroup() { return m_pSparklineGroup; }
51 std::vector<Sparkline>& getSparklines() { return m_aSparklines; }
54 /** Handle import of the sparkline, sparkline group and attributes */
55 class SparklineGroupsContext : public WorksheetContextBase
57 private:
58 std::vector<SparklineGroup> m_aSparklineGroups;
60 public:
61 explicit SparklineGroupsContext(WorksheetContextBase& rFragment);
63 oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement,
64 const AttributeList& rAttribs) override;
65 void onStartElement(const AttributeList& rAttribs) override;
66 void onCharacters(const OUString& rCharacters) override;
67 void onEndElement() override;
69 void insertSparkline(SparklineGroup& rSparklineGroup, Sparkline& rSparkline);
72 } //namespace oox::xls
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */