diff options
-rw-r--r-- | chart2/Library_chartcore.mk | 5 | ||||
-rw-r--r-- | chart2/inc/DataSeriesState.hxx | 71 | ||||
-rw-r--r-- | chart2/source/view/inc/AbstractShapeFactory.hxx | 12 | ||||
-rw-r--r-- | chart2/source/view/inc/DummyShapeFactory.hxx | 9 | ||||
-rw-r--r-- | chart2/source/view/inc/ShapeFactory.hxx | 9 | ||||
-rw-r--r-- | chart2/source/view/main/DummyShapeFactory.cxx | 13 | ||||
-rw-r--r-- | chart2/source/view/main/ShapeFactory.cxx | 18 |
7 files changed, 136 insertions, 1 deletions
diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk index 53fbd2ac5d89..1923261764c9 100644 --- a/chart2/Library_chartcore.mk +++ b/chart2/Library_chartcore.mk @@ -25,7 +25,10 @@ $(eval $(call gb_Library_add_defs,chartcore,\ $(eval $(call gb_Library_set_precompiled_header,chartcore,$(SRCDIR)/chart2/inc/pch/precompiled_chartcore)) -$(eval $(call gb_Library_use_external,chartcore,boost_headers)) +$(eval $(call gb_Library_use_externals,chartcore,\ + boost_headers \ + mdds_headers \ +)) $(eval $(call gb_Library_use_custom_headers,chartcore,\ officecfg/registry \ diff --git a/chart2/inc/DataSeriesState.hxx b/chart2/inc/DataSeriesState.hxx new file mode 100644 index 000000000000..bfe14c98f809 --- /dev/null +++ b/chart2/inc/DataSeriesState.hxx @@ -0,0 +1,71 @@ +/* -*- 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 DATASERIES_HXX +#define DATASERIES_HXX + +#include <rtl/ustring.hxx> +#include <mdds/multi_type_vector.hpp> +#include <mdds/multi_type_vector_trait.hpp> +#include <vector> +#include <map> + +#include <com/sun/star/uno/Any.h> + +namespace chart { + +class DataSeries +{ +public: + typedef mdds::multi_type_vector<mdds::mtv::element_block_func> DataSeriesType; + + DataSeriesType getDataSeries(); + + size_t size(); + double getValue(size_t nIndex); + +private: + OUString maLabel; + DataSeriesType maDataSeries; + +}; + +/** + * point properties overwrite series properties + */ +struct DataSeriesProperties +{ + typedef std::map< OUString, com::sun::star::uno::Any > PropertyMap; + PropertyMap aSeriesProps; + std::vector< PropertyMap > aPointProps; +}; + +struct Axis +{ + double nMin; + double nMax; + bool bLog; + bool bInverseDirection; +}; + +struct DataSeriesState +{ + DataSeries aXValue; + DataSeries aYValue; + DataSeriesProperties aProperties; + std::map<OUString, DataSeries> aMapProperties; + Axis aXAxis; + Axis aYAxis; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/inc/AbstractShapeFactory.hxx b/chart2/source/view/inc/AbstractShapeFactory.hxx index 5f915f032151..6a25e9ec6573 100644 --- a/chart2/source/view/inc/AbstractShapeFactory.hxx +++ b/chart2/source/view/inc/AbstractShapeFactory.hxx @@ -29,6 +29,8 @@ #include <rtl/ustring.hxx> +#include "DataSeriesState.hxx" + namespace chart { @@ -225,6 +227,16 @@ public: getOrCreateChartRootShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage>& xPage ) = 0; + + virtual void createSeries( const com::sun::star::uno::Reference< + com::sun::star::drawing::XShapes> & xTarget, + const DataSeriesState& rSeriesState ) = 0; + + virtual void pushNextSeriesState( const com::sun::star::uno::Reference< + com::sun::star::drawing::XShapes> & xTarget, + const DataSeriesState& rOldSeriesState, + const DataSeriesState& rNewSeriesState ) = 0; + static ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > getChartRootShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage>& xPage ); diff --git a/chart2/source/view/inc/DummyShapeFactory.hxx b/chart2/source/view/inc/DummyShapeFactory.hxx index e3731f8a2c96..aa8b38cea8f6 100644 --- a/chart2/source/view/inc/DummyShapeFactory.hxx +++ b/chart2/source/view/inc/DummyShapeFactory.hxx @@ -174,6 +174,15 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget ); + virtual void createSeries( const com::sun::star::uno::Reference< + com::sun::star::drawing::XShapes> & xTarget, + const DataSeriesState& rSeriesState ); + + virtual void pushNextSeriesState( const com::sun::star::uno::Reference< + com::sun::star::drawing::XShapes> & xTarget, + const DataSeriesState& rOldSeriesState, + const DataSeriesState& rNewSeriesState ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > getOrCreateChartRootShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage>& xPage ); diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx index 1cf87b417c5a..a88893c57063 100644 --- a/chart2/source/view/inc/ShapeFactory.hxx +++ b/chart2/source/view/inc/ShapeFactory.hxx @@ -189,6 +189,15 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget ); + virtual void createSeries( const com::sun::star::uno::Reference< + com::sun::star::drawing::XShapes> & xTarget, + const DataSeriesState& rSeriesState ); + + virtual void pushNextSeriesState( const com::sun::star::uno::Reference< + com::sun::star::drawing::XShapes> & xTarget, + const DataSeriesState& rOldSeriesState, + const DataSeriesState& rNewSeriesState ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > getOrCreateChartRootShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage>& xPage ); diff --git a/chart2/source/view/main/DummyShapeFactory.cxx b/chart2/source/view/main/DummyShapeFactory.cxx index 4eb6283e774b..f0c8bdd7a025 100644 --- a/chart2/source/view/main/DummyShapeFactory.cxx +++ b/chart2/source/view/main/DummyShapeFactory.cxx @@ -280,6 +280,19 @@ uno::Reference< drawing::XShape > return new DummyXShape(); } +void DummyShapeFactory::createSeries( const uno::Reference< + drawing::XShapes> & , + const DataSeriesState& ) +{ +} + +void DummyShapeFactory::pushNextSeriesState( const uno::Reference< + drawing::XShapes> & , + const DataSeriesState& , + const DataSeriesState& ) +{ +} + } //namespace dummy } //namespace chart diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index a0abdafeb46f..9a7f59e2e7d2 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -2119,6 +2119,24 @@ uno::Reference< drawing::XShape > return xShape; } +void ShapeFactory::createSeries( const uno::Reference< + drawing::XShapes> & , + const DataSeriesState& ) +{ + // unsupported for now + throw uno::RuntimeException(); +} + +void ShapeFactory::pushNextSeriesState( const uno::Reference< + drawing::XShapes> & , + const DataSeriesState& , + const DataSeriesState& ) +{ + // unsupported for now + // do we actually want to support this in the normal + // rendering code? + throw uno::RuntimeException(); +} uno::Reference< drawing::XShape > ShapeFactory::createText( const uno::Reference< drawing::XShapes >& xTarget, |