diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2017-02-26 22:48:06 +0100 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2017-03-30 23:52:42 +0200 |
commit | 2f73e9dad81780c8dcb4ac9b42fe682677fbadf5 (patch) | |
tree | 78b08e8f60882f84beea3442d231bd600304fa95 /sc/inc/PivotChartDataSource.hxx | |
parent | c382c998ffdaf80c10a3f078fb4f0a37224d1158 (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.hxx | 60 |
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: */ |