summaryrefslogtreecommitdiff
path: root/sc/inc/PivotChartDataSource.hxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-02-26 22:48:06 +0100
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-03-30 23:52:42 +0200
commit2f73e9dad81780c8dcb4ac9b42fe682677fbadf5 (patch)
tree78b08e8f60882f84beea3442d231bd600304fa95 /sc/inc/PivotChartDataSource.hxx
parentc382c998ffdaf80c10a3f078fb4f0a37224d1158 (diff)
sc: Pivot chart specific data provider
Adds a pivot chart specific data provider which uses provides the data from a pivot table to the associated chart. Change-Id: Ifbc5511645ef7ca8f6ff39095f74f76892a0d7bd
Diffstat (limited to 'sc/inc/PivotChartDataSource.hxx')
-rw-r--r--sc/inc/PivotChartDataSource.hxx60
1 files changed, 60 insertions, 0 deletions
diff --git a/sc/inc/PivotChartDataSource.hxx b/sc/inc/PivotChartDataSource.hxx
new file mode 100644
index 000000000000..256abaa6bb29
--- /dev/null
+++ b/sc/inc/PivotChartDataSource.hxx
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#ifndef INCLUDED_SC_INC_PIVOTCHARTDATASOURCE_HXX
+#define INCLUDED_SC_INC_PIVOTCHARTDATASOURCE_HXX
+
+#include <com/sun/star/chart2/data/XDataSource.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+#include <svl/lstner.hxx>
+#include <cppuhelper/implbase.hxx>
+
+#include "document.hxx"
+
+#include <com/sun/star/chart2/data/LabeledDataSequence.hpp>
+
+namespace sc
+{
+
+typedef cppu::WeakImplHelper<css::chart2::data::XDataSource,
+ css::lang::XServiceInfo>
+ PivotChartDataSource_Base;
+
+class PivotChartDataSource : public PivotChartDataSource_Base, public SfxListener
+{
+public:
+ explicit PivotChartDataSource(OUString const & aRangeRepresentation, std::vector<css::uno::Reference<css::chart2::data::XLabeledDataSequence>>& xLabeledSequence);
+ virtual ~PivotChartDataSource() override;
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
+
+ // XDataSource
+ virtual css::uno::Sequence<css::uno::Reference<css::chart2::data::XLabeledDataSequence>> SAL_CALL
+ getDataSequences() override;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() override;
+
+ virtual sal_Bool SAL_CALL supportsService( const OUString&
+ rServiceName) override;
+
+ virtual css::uno::Sequence< OUString> SAL_CALL
+ getSupportedServiceNames() override;
+
+private:
+ std::vector<css::uno::Reference<css::chart2::data::XLabeledDataSequence>> m_xLabeledSequence;
+ OUString m_aRangeRepresentation;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */