diff options
Diffstat (limited to 'chart2/source/inc')
-rw-r--r-- | chart2/source/inc/AxisHelper.hxx | 5 | ||||
-rw-r--r-- | chart2/source/inc/BaseCoordinateSystem.hxx | 5 | ||||
-rw-r--r-- | chart2/source/inc/ChartModelHelper.hxx | 4 | ||||
-rw-r--r-- | chart2/source/inc/ChartType.hxx | 142 | ||||
-rw-r--r-- | chart2/source/inc/ChartTypeHelper.hxx | 3 | ||||
-rw-r--r-- | chart2/source/inc/ChartTypeTemplate.hxx | 17 | ||||
-rw-r--r-- | chart2/source/inc/DiagramHelper.hxx | 8 |
7 files changed, 170 insertions, 14 deletions
diff --git a/chart2/source/inc/AxisHelper.hxx b/chart2/source/inc/AxisHelper.hxx index abe9ee1e257e..788ba4cf5f79 100644 --- a/chart2/source/inc/AxisHelper.hxx +++ b/chart2/source/inc/AxisHelper.hxx @@ -39,6 +39,7 @@ namespace com::sun::star::uno { class XComponentContext; } namespace chart { class BaseCoordinateSystem; +class ChartType; class OOO_DLLPUBLIC_CHARTTOOLS AxisHelper { @@ -191,13 +192,13 @@ public: static bool isSecondaryYAxisNeeded( const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSys ); - static css::uno::Reference< css::chart2::XChartType > + static rtl::Reference< ::chart::ChartType > getChartTypeByIndex( const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSys, sal_Int32 nIndex ); static void setRTLAxisLayout( const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSys ); - static css::uno::Reference< css::chart2::XChartType > + static rtl::Reference< ::chart::ChartType > getFirstChartTypeWithSeriesAttachedToAxisIndex( const css::uno::Reference< css::chart2::XDiagram >& xDiagram, const sal_Int32 nAttachedAxisIndex ); static bool isAxisPositioningEnabled(); diff --git a/chart2/source/inc/BaseCoordinateSystem.hxx b/chart2/source/inc/BaseCoordinateSystem.hxx index 4cfa7ab42c80..922d4047b02e 100644 --- a/chart2/source/inc/BaseCoordinateSystem.hxx +++ b/chart2/source/inc/BaseCoordinateSystem.hxx @@ -33,6 +33,7 @@ namespace chart { +class ChartType; namespace impl { @@ -95,6 +96,8 @@ public: virtual void SAL_CALL removeModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override; + const std::vector< rtl::Reference<::chart::ChartType > > & getChartTypes2() const { return m_aChartTypes; } + protected: // ____ XModifyListener ____ @@ -118,7 +121,7 @@ private: sal_Int32 m_nDimensionCount; typedef std::vector< std::vector< css::uno::Reference< css::chart2::XAxis > > > tAxisVecVecType; tAxisVecVecType m_aAllAxis; //outer sequence is the dimension; inner sequence is the axis index that indicates main or secondary axis - std::vector< css::uno::Reference< css::chart2::XChartType > > m_aChartTypes; + std::vector< rtl::Reference<::chart::ChartType > > m_aChartTypes; }; } // namespace chart diff --git a/chart2/source/inc/ChartModelHelper.hxx b/chart2/source/inc/ChartModelHelper.hxx index dfe864eeb0d4..a3ca9532d865 100644 --- a/chart2/source/inc/ChartModelHelper.hxx +++ b/chart2/source/inc/ChartModelHelper.hxx @@ -38,6 +38,7 @@ namespace com::sun::star::view { class XSelectionSupplier; } namespace chart { class BaseCoordinateSystem; +class ChartType; class Diagram; class InternalDataProvider; @@ -75,7 +76,7 @@ public: static std::vector< css::uno::Reference< css::chart2::XDataSeries > > getDataSeries( const rtl::Reference< ::chart::ChartModel > & xModel ); - static css::uno::Reference< css::chart2::XChartType > + static rtl::Reference< ChartType > getChartTypeOfSeries( const css::uno::Reference< css::frame::XModel >& xModel , const css::uno::Reference< css::chart2::XDataSeries >& xGivenDataSeries ); @@ -89,6 +90,7 @@ public: static bool isIncludeHiddenCells( const css::uno::Reference< css::frame::XModel >& xChartModel ); static bool setIncludeHiddenCells( bool bIncludeHiddenCells, ChartModel& rModel); + }; } //namespace chart diff --git a/chart2/source/inc/ChartType.hxx b/chart2/source/inc/ChartType.hxx new file mode 100644 index 000000000000..729e58109de5 --- /dev/null +++ b/chart2/source/inc/ChartType.hxx @@ -0,0 +1,142 @@ +/* -*- 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#pragma once + +#include "OPropertySet.hxx" +#include <cppuhelper/basemutex.hxx> +#include <cppuhelper/implbase.hxx> +#include <comphelper/uno3.hxx> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/chart2/XChartType.hpp> +#include <com/sun/star/chart2/XDataSeriesContainer.hpp> +#include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/util/XModifyBroadcaster.hpp> +#include <com/sun/star/util/XModifyListener.hpp> +#include <rtl/ref.hxx> + +#include <vector> +#include "charttoolsdllapi.hxx" + +namespace chart +{ + +namespace impl +{ +typedef ::cppu::WeakImplHelper< + css::lang::XServiceInfo, + css::chart2::XChartType, + css::chart2::XDataSeriesContainer, + css::util::XCloneable, + css::util::XModifyBroadcaster, + css::util::XModifyListener > + ChartType_Base; +} + +class OOO_DLLPUBLIC_CHARTTOOLS ChartType : + public cppu::BaseMutex, + public impl::ChartType_Base, + public ::property::OPropertySet +{ +public: + explicit ChartType(); + virtual ~ChartType() override; + + /// merge XInterface implementations + DECLARE_XINTERFACE() + + explicit ChartType( const ChartType & rOther ); + + // ____ XChartType ____ + // still abstract ! implement ! + virtual OUString SAL_CALL getChartType() override = 0; + virtual css::uno::Reference< css::chart2::XCoordinateSystem > SAL_CALL + createCoordinateSystem( ::sal_Int32 DimensionCount ) override; + virtual css::uno::Sequence< OUString > SAL_CALL + getSupportedMandatoryRoles() override; + virtual css::uno::Sequence< OUString > SAL_CALL + getSupportedOptionalRoles() override; + virtual OUString SAL_CALL getRoleOfSequenceForSeriesLabel() override; + virtual css::uno::Sequence< OUString > SAL_CALL + getSupportedPropertyRoles() override; + + // ____ XDataSeriesContainer ____ + virtual void SAL_CALL addDataSeries( + const css::uno::Reference< css::chart2::XDataSeries >& aDataSeries ) override; + virtual void SAL_CALL removeDataSeries( + const css::uno::Reference< css::chart2::XDataSeries >& aDataSeries ) override; + virtual css::uno::Sequence< css::uno::Reference< css::chart2::XDataSeries > > SAL_CALL getDataSeries() override; + virtual void SAL_CALL setDataSeries( + const css::uno::Sequence< css::uno::Reference< css::chart2::XDataSeries > >& aDataSeries ) override; + + // ____ XModifyBroadcaster ____ + virtual void SAL_CALL addModifyListener( + const css::uno::Reference< css::util::XModifyListener >& aListener ) override; + virtual void SAL_CALL removeModifyListener( + const css::uno::Reference< css::util::XModifyListener >& aListener ) override; + + virtual rtl::Reference<ChartType> cloneChartType() const = 0; + +protected: + + // ____ XModifyListener ____ + virtual void SAL_CALL modified( + const css::lang::EventObject& aEvent ) override; + + // ____ XEventListener (base of XModifyListener) ____ + virtual void SAL_CALL disposing( + const css::lang::EventObject& Source ) override; + + void fireModifyEvent(); + + // ____ OPropertySet ____ + virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) const override; + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; + + virtual void firePropertyChangeEvent() override; + using OPropertySet::disposing; + + // ____ XPropertySet ____ + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() override; + + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +protected: + css::uno::Reference< css::util::XModifyListener > + const m_xModifyEventForwarder; + +private: + void impl_addDataSeriesWithoutNotification( + const css::uno::Reference< css::chart2::XDataSeries >& aDataSeries ); + +private: + typedef + std::vector< css::uno::Reference< css::chart2::XDataSeries > > tDataSeriesContainerType; + + // --- mutable members: the following members need mutex guard --- + + tDataSeriesContainerType m_aDataSeries; + + bool m_bNotifyChanges; +}; + +} // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/inc/ChartTypeHelper.hxx b/chart2/source/inc/ChartTypeHelper.hxx index d4917be283fb..151df377f800 100644 --- a/chart2/source/inc/ChartTypeHelper.hxx +++ b/chart2/source/inc/ChartTypeHelper.hxx @@ -21,12 +21,14 @@ #include <com/sun/star/drawing/Direction3D.hpp> #include "charttoolsdllapi.hxx" +#include <rtl/ref.hxx> namespace com::sun::star::chart2 { class XChartType; } namespace com::sun::star::chart2 { class XDataSeries; } namespace chart { +class ChartType; class OOO_DLLPUBLIC_CHARTTOOLS ChartTypeHelper { @@ -47,6 +49,7 @@ public: static bool isSupportingBaseValue( const css::uno::Reference< css::chart2::XChartType >& xChartType ); static bool isSupportingAxisPositioning( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex ); static bool isSupportingDateAxis( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionIndex ); + static bool isSupportingDateAxis( const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nDimensionIndex ); static bool isSupportingComplexCategory( const css::uno::Reference< css::chart2::XChartType >& xChartType ); static bool isSupportingCategoryPositioning( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount ); static bool shiftCategoryPosAtXAxisPerDefault( const css::uno::Reference< css::chart2::XChartType >& xChartType ); diff --git a/chart2/source/inc/ChartTypeTemplate.hxx b/chart2/source/inc/ChartTypeTemplate.hxx index 560fc32fd167..69cec8d1b1d3 100644 --- a/chart2/source/inc/ChartTypeTemplate.hxx +++ b/chart2/source/inc/ChartTypeTemplate.hxx @@ -23,6 +23,8 @@ #include <com/sun/star/chart2/XChartTypeTemplate.hpp> #include <com/sun/star/lang/XServiceName.hpp> #include "charttoolsdllapi.hxx" +#include <rtl/ref.hxx> +#include <vector> namespace com::sun::star::chart2 { class XChartType; } namespace com::sun::star::chart2 { class XCoordinateSystemContainer; } @@ -31,6 +33,7 @@ namespace com::sun::star::uno { class XComponentContext; } namespace chart { +class ChartType; /** For creating diagrams and modifying existing diagrams. A base class that implements XChartTypeTemplate and offers some tooling for classes that @@ -191,9 +194,7 @@ public: const css::uno::Sequence< css::uno::Reference< css::chart2::XCoordinateSystem > > & rCoordSys, - const css::uno::Sequence< - css::uno::Reference< - css::chart2::XChartType > > & aOldChartTypesSeq + const std::vector< rtl::Reference< ChartType > > & aOldChartTypesSeq ); /** create axes and add them to the given container. If there are already @@ -223,6 +224,9 @@ public: static void copyPropertiesFromOldToNewCoordinateSystem( const css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > > & rOldChartTypesSeq, const css::uno::Reference< css::chart2::XChartType > & xNewChartType ); + static void copyPropertiesFromOldToNewCoordinateSystem( + const std::vector< rtl::Reference< ChartType > > & rOldChartTypesSeq, + const css::uno::Reference< css::chart2::XChartType > & xNewChartType ); protected: css::uno::Reference< css::uno::XComponentContext > m_xContext; @@ -242,9 +246,10 @@ private: css::chart2::XDataSeries > > > & aSeriesSeq, const css::uno::Reference< css::chart2::data::XLabeledDataSequence >& xCategories, - const css::uno::Sequence< - css::uno::Reference< - css::chart2::XChartType > > & aOldChartTypesSeq); + const std::vector< rtl::Reference< ChartType > > & aOldChartTypesSeq); + + using XChartTypeTemplate::getChartTypeForNewSeries; + rtl::Reference< ChartType > getChartTypeForNewSeries( const std::vector< rtl::Reference< ChartType > >& aFormerlyUsedChartTypes ); }; } // namespace chart diff --git a/chart2/source/inc/DiagramHelper.hxx b/chart2/source/inc/DiagramHelper.hxx index 57372a1c072e..f80d9c61ea96 100644 --- a/chart2/source/inc/DiagramHelper.hxx +++ b/chart2/source/inc/DiagramHelper.hxx @@ -40,6 +40,7 @@ namespace com::sun::star::util { class XNumberFormatsSupplier; } namespace chart { +class ChartType; class ChartTypeManager; class ChartTypeTemplate; @@ -156,7 +157,7 @@ public: const css::uno::Reference< css::chart2::XDataSeries >& xSeries, const css::uno::Reference< css::chart2::XDiagram >& xDiagram ); - static css::uno::Reference< css::chart2::XChartType > + static rtl::Reference< ChartType > getChartTypeOfSeries( const css::uno::Reference< css::chart2::XDiagram >& xDiagram, const css::uno::Reference< css::chart2::XDataSeries >& xSeries ); @@ -207,11 +208,10 @@ public: static sal_Int32 getPercentNumberFormat( const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier ); - static css::uno::Reference< css::chart2::XChartType > + static rtl::Reference< ChartType > getChartTypeByIndex( const css::uno::Reference< css::chart2::XDiagram >& xDiagram, sal_Int32 nIndex ); - static css::uno::Sequence< - css::uno::Reference< css::chart2::XChartType > > + static std::vector< rtl::Reference< ChartType > > getChartTypesFromDiagram( const css::uno::Reference< css::chart2::XDiagram > & xDiagram ); |