chart2/source/inc/Axis.hxx | 165 ++++++++++++++++++ chart2/source/inc/DataPoint.hxx | 134 +++++++++++++++ chart2/source/inc/DataSeries.hxx | 216 ++++++++++++++++++++++++ chart2/source/inc/Diagram.hxx | 248 ++++++++++++++++++++++++++++ chart2/source/inc/GridProperties.hxx | 133 +++++++++++++++ chart2/source/inc/PageBackground.hxx | 134 +++++++++++++++ chart2/source/inc/StockBar.hxx | 125 ++++++++++++++ chart2/source/inc/Title.hxx | 143 ++++++++++++++++ chart2/source/inc/Wall.hxx | 78 +++++--- chart2/source/model/inc/DataSeries.hxx | 172 ------------------- chart2/source/model/inc/Diagram.hxx | 186 --------------------- chart2/source/model/inc/StockBar.hxx | 96 ---------- chart2/source/model/main/Axis.cxx | 148 +++++++--------- chart2/source/model/main/Axis.hxx | 138 --------------- chart2/source/model/main/DataPoint.cxx | 59 ++---- chart2/source/model/main/DataPoint.hxx | 116 ------------- chart2/source/model/main/DataSeries.cxx | 82 +++++---- chart2/source/model/main/Diagram.cxx | 120 +++++-------- chart2/source/model/main/GridProperties.cxx | 97 ++++------ chart2/source/model/main/GridProperties.hxx | 105 ----------- chart2/source/model/main/PageBackground.cxx | 97 ++++------ chart2/source/model/main/PageBackground.hxx | 104 ----------- chart2/source/model/main/StockBar.cxx | 93 ++++------ chart2/source/model/main/Title.cxx | 133 ++++++--------- chart2/source/model/main/Title.hxx | 115 ------------ chart2/source/model/main/Wall.cxx | 95 ++++------ chart2/source/tools/ChartStyle.cxx | 43 ++++ 27 files changed, 1797 insertions(+), 1578 deletions(-)
New commits: commit fea89c0e865c83e048d2221f897d1f6a4046505c Author: Gagandeep Singh <deepgagan231...@gmail.com> AuthorDate: Thu Aug 8 16:17:00 2019 +0530 Commit: Markus Mohrhard <markus.mohrh...@googlemail.com> CommitDate: Sat Aug 10 02:30:54 2019 +0800 This updates the chart model elements to be used with ChartStyles.cxx Based on Markus' patch: d63f1346a6c5767d995c787fe2bb36b023a64788 Change-Id: I712793f7299ca33773b004711400af4e070c6485 diff --git a/chart2/source/inc/Axis.hxx b/chart2/source/inc/Axis.hxx new file mode 100644 index 000000000000..0d93322c1465 --- /dev/null +++ b/chart2/source/inc/Axis.hxx @@ -0,0 +1,165 @@ +/* -*- 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 . + */ +#ifndef INCLUDED_CHART2_SOURCE_MODEL_MAIN_AXIS_HXX +#define INCLUDED_CHART2_SOURCE_MODEL_MAIN_AXIS_HXX + +#include <MutexContainer.hxx> +#include <OPropertySet.hxx> +#include <PropertyHelper.hxx> +#include <cppuhelper/implbase.hxx> +#include <comphelper/uno3.hxx> + +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/chart2/XAxis.hpp> +#include <com/sun/star/chart2/XTitled.hpp> +#include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/util/XModifyBroadcaster.hpp> +#include <com/sun/star/util/XModifyListener.hpp> + +namespace chart +{ +namespace impl +{ +typedef ::cppu::WeakImplHelper<css::chart2::XAxis, css::chart2::XTitled, css::lang::XServiceInfo, + css::util::XCloneable, css::util::XModifyBroadcaster, + css::util::XModifyListener> + Axis_Base; +} + +namespace axis +{ +struct StaticAxisInfo_Initializer +{ + css::uno::Reference<css::beans::XPropertySetInfo>* operator()(); +}; + +struct StaticAxisInfo + : public rtl::StaticAggregate<css::uno::Reference<css::beans::XPropertySetInfo>, + StaticAxisInfo_Initializer> +{ +}; + +struct StaticAxisDefaults_Initializer +{ + ::chart::tPropertyValueMap* operator()(); +}; + +struct StaticAxisDefaults + : public rtl::StaticAggregate<::chart::tPropertyValueMap, StaticAxisDefaults_Initializer> +{ +}; + +struct StaticAxisInfoHelper_Initializer +{ + ::cppu::OPropertyArrayHelper* operator()(); +}; + +struct StaticAxisInfoHelper + : public rtl::StaticAggregate<::cppu::OPropertyArrayHelper, StaticAxisInfoHelper_Initializer> +{ +}; +} + +class Axis final : public MutexContainer, public impl::Axis_Base, public ::property::OPropertySet +{ +public: + explicit Axis(); + virtual ~Axis() override; + + /// XServiceInfo declarations + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +private: + explicit Axis(const Axis& rOther); + + // late initialization to call after copy-constructing + void Init(); + + // ____ OPropertySet ____ + virtual css::uno::Any GetDefaultValue(sal_Int32 nHandle) const override; + + // ____ OPropertySet ____ + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; + + // ____ XPropertySet ____ + virtual css::uno::Reference<css::beans::XPropertySetInfo> + SAL_CALL getPropertySetInfo() override; + + // ____ XAxis ____ + virtual void SAL_CALL setScaleData(const css::chart2::ScaleData& rScaleData) override; + virtual css::chart2::ScaleData SAL_CALL getScaleData() override; + virtual css::uno::Reference<css::beans::XPropertySet> SAL_CALL getGridProperties() override; + virtual css::uno::Sequence<css::uno::Reference<css::beans::XPropertySet>> + SAL_CALL getSubGridProperties() override; + virtual css::uno::Sequence<css::uno::Reference<css::beans::XPropertySet>> + SAL_CALL getSubTickProperties() override; + + // ____ XTitled ____ + virtual css::uno::Reference<css::chart2::XTitle> SAL_CALL getTitleObject() override; + virtual void SAL_CALL + setTitleObject(const css::uno::Reference<css::chart2::XTitle>& Title) override; + + // ____ XCloneable ____ + // Note: the coordinate systems are not cloned! + virtual css::uno::Reference<css::util::XCloneable> SAL_CALL createClone() 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; + + // ____ 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; + + // ____ OPropertySet ____ + virtual void firePropertyChangeEvent() override; + using OPropertySet::disposing; + + void fireModifyEvent(); + + void AllocateSubGrids(); + + css::uno::Reference<css::util::XModifyListener> m_xModifyEventForwarder; + + css::chart2::ScaleData m_aScaleData; + + css::uno::Reference<css::beans::XPropertySet> m_xGrid; + + css::uno::Sequence<css::uno::Reference<css::beans::XPropertySet>> m_aSubGridProperties; + + css::uno::Reference<css::chart2::XTitle> m_xTitle; +}; + +} // namespace chart + +// INCLUDED_CHART2_SOURCE_MODEL_MAIN_AXIS_HXX +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/inc/DataPoint.hxx b/chart2/source/inc/DataPoint.hxx new file mode 100644 index 000000000000..184414217980 --- /dev/null +++ b/chart2/source/inc/DataPoint.hxx @@ -0,0 +1,134 @@ +/* -*- 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 . + */ +#ifndef INCLUDED_CHART2_SOURCE_MODEL_MAIN_DATAPOINT_HXX +#define INCLUDED_CHART2_SOURCE_MODEL_MAIN_DATAPOINT_HXX + +#include <cppuhelper/implbase.hxx> +#include <cppuhelper/weakref.hxx> +#include <comphelper/uno3.hxx> +#include <com/sun/star/container/XChild.hpp> +#include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/util/XModifyBroadcaster.hpp> +#include <com/sun/star/util/XModifyListener.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> + +#include <OPropertySet.hxx> +#include <PropertyHelper.hxx> +#include <MutexContainer.hxx> + +namespace chart +{ +namespace impl +{ +typedef ::cppu::WeakImplHelper<css::container::XChild, css::util::XCloneable, + css::util::XModifyBroadcaster, css::util::XModifyListener, + css::lang::XServiceInfo> + DataPoint_Base; +} + +namespace dataPoint +{ +struct StaticDataPointInfo_Initializer +{ + css::uno::Reference<css::beans::XPropertySetInfo>* operator()(); +}; + +struct StaticDataPointInfo + : public rtl::StaticAggregate<css::uno::Reference<css::beans::XPropertySetInfo>, + StaticDataPointInfo_Initializer> +{ +}; + +struct StaticDataPointInfoHelper_Initializer +{ + ::cppu::OPropertyArrayHelper* operator()(); +}; + +struct StaticDataPointInfoHelper + : public rtl::StaticAggregate<::cppu::OPropertyArrayHelper, + StaticDataPointInfoHelper_Initializer> +{ +}; +} + +class DataPoint final : public MutexContainer, + public impl::DataPoint_Base, + public ::property::OPropertySet +{ +public: + explicit DataPoint(const css::uno::Reference<css::beans::XPropertySet>& rParentProperties); + virtual ~DataPoint() override; + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// XServiceInfo declarations + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; + +private: + explicit DataPoint(const DataPoint& rOther); + + // ____ OPropertySet ____ + virtual css::uno::Any GetDefaultValue(sal_Int32 nHandle) const override; + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, + const css::uno::Any& rValue) override; + + // ____ XPropertySet ____ + virtual css::uno::Reference<css::beans::XPropertySetInfo> + SAL_CALL getPropertySetInfo() override; + + // ____ XCloneable ____ + // Note: m_xParentProperties are not cloned! + virtual css::uno::Reference<css::util::XCloneable> SAL_CALL createClone() override; + + // ____ XChild ____ + virtual css::uno::Reference<css::uno::XInterface> SAL_CALL getParent() override; + virtual void SAL_CALL + setParent(const css::uno::Reference<css::uno::XInterface>& Parent) 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; + + // ____ 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; + + // ____ OPropertySet ____ + virtual void firePropertyChangeEvent() override; + using OPropertySet::disposing; + + css::uno::WeakReference<css::beans::XPropertySet> m_xParentProperties; + + css::uno::Reference<css::util::XModifyListener> m_xModifyEventForwarder; + bool m_bNoParentPropAllowed; +}; + +} // namespace chart + +// INCLUDED_CHART2_SOURCE_MODEL_MAIN_DATAPOINT_HXX +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/inc/DataSeries.hxx b/chart2/source/inc/DataSeries.hxx new file mode 100644 index 000000000000..bbbf78dc7b15 --- /dev/null +++ b/chart2/source/inc/DataSeries.hxx @@ -0,0 +1,216 @@ +/* -*- 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 . + */ +#ifndef INCLUDED_CHART2_SOURCE_MODEL_INC_DATASERIES_HXX +#define INCLUDED_CHART2_SOURCE_MODEL_INC_DATASERIES_HXX + +// UNO types +#include <com/sun/star/chart2/XDataSeries.hpp> +#include <com/sun/star/chart2/data/XDataSink.hpp> +#include <com/sun/star/chart2/data/XDataSource.hpp> +#include <com/sun/star/chart2/XRegressionCurveContainer.hpp> +#include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/util/XModifyBroadcaster.hpp> +#include <com/sun/star/util/XModifyListener.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> + +// helper classes +#include <cppuhelper/implbase.hxx> +#include <comphelper/uno3.hxx> + +// STL +#include <vector> +#include <map> + +#include <MutexContainer.hxx> +#include <OPropertySet.hxx> +#include <PropertyHelper.hxx> + +namespace com +{ +namespace sun +{ +namespace star +{ +namespace beans +{ +class XPropertySet; +} +} +} +} + +namespace chart +{ +namespace impl +{ +typedef ::cppu::WeakImplHelper<css::chart2::XDataSeries, css::chart2::data::XDataSink, + css::chart2::data::XDataSource, css::lang::XServiceInfo, + css::chart2::XRegressionCurveContainer, css::util::XCloneable, + css::util::XModifyBroadcaster, css::util::XModifyListener> + DataSeries_Base; +} + +namespace dataSeries +{ +struct StaticDataSeriesInfo_Initializer +{ + css::uno::Reference<css::beans::XPropertySetInfo>* operator()(); +}; + +struct StaticDataSeriesInfo + : public rtl::StaticAggregate<css::uno::Reference<css::beans::XPropertySetInfo>, + StaticDataSeriesInfo_Initializer> +{ +}; + +struct StaticDataSeriesDefaults_Initializer +{ + ::chart::tPropertyValueMap* operator()(); +}; + +struct StaticDataSeriesDefaults + : public rtl::StaticAggregate<::chart::tPropertyValueMap, StaticDataSeriesDefaults_Initializer> +{ +}; + +struct StaticDataSeriesInfoHelper_Initializer +{ + ::cppu::OPropertyArrayHelper* operator()(); +}; + +struct StaticDataSeriesInfoHelper + : public rtl::StaticAggregate<::cppu::OPropertyArrayHelper, + StaticDataSeriesInfoHelper_Initializer> +{ +}; +} + +class DataSeries final : public MutexContainer, + public impl::DataSeries_Base, + public ::property::OPropertySet +{ +public: + explicit DataSeries(); + virtual ~DataSeries() override; + + /// XServiceInfo declarations + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +private: + explicit DataSeries(const DataSeries& rOther); + + // late initialization to call after copy-constructing + void Init(const DataSeries& rOther); + + // ____ XDataSeries ____ + /// @see css::chart2::XDataSeries + virtual css::uno::Reference<css::beans::XPropertySet> + SAL_CALL getDataPointByIndex(sal_Int32 nIndex) override; + virtual void SAL_CALL resetDataPoint(sal_Int32 nIndex) override; + virtual void SAL_CALL resetAllDataPoints() override; + + // ____ XDataSink ____ + /// @see css::chart2::data::XDataSink + virtual void SAL_CALL setData( + const css::uno::Sequence<css::uno::Reference<css::chart2::data::XLabeledDataSequence>>& + aData) override; + + // ____ XDataSource ____ + /// @see css::chart2::data::XDataSource + virtual css::uno::Sequence<css::uno::Reference<css::chart2::data::XLabeledDataSequence>> + SAL_CALL getDataSequences() override; + + // ____ OPropertySet ____ + virtual css::uno::Any GetDefaultValue(sal_Int32 nHandle) const override; + virtual void SAL_CALL getFastPropertyValue(css::uno::Any& rValue, + sal_Int32 nHandle) const override; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, + const css::uno::Any& rValue) override; + + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; + + // ____ XPropertySet ____ + /// @see css::beans::XPropertySet + virtual css::uno::Reference<css::beans::XPropertySetInfo> + SAL_CALL getPropertySetInfo() override; + + /// make original interface function visible again + using ::com::sun::star::beans::XFastPropertySet::getFastPropertyValue; + + // ____ XRegressionCurveContainer ____ + /// @see css::chart2::XRegressionCurveContainer + virtual void SAL_CALL addRegressionCurve( + const css::uno::Reference<css::chart2::XRegressionCurve>& aRegressionCurve) override; + virtual void SAL_CALL removeRegressionCurve( + const css::uno::Reference<css::chart2::XRegressionCurve>& aRegressionCurve) override; + virtual css::uno::Sequence<css::uno::Reference<css::chart2::XRegressionCurve>> + SAL_CALL getRegressionCurves() override; + virtual void SAL_CALL setRegressionCurves( + const css::uno::Sequence<css::uno::Reference<css::chart2::XRegressionCurve>>& + aRegressionCurves) override; + + // ____ XCloneable ____ + virtual css::uno::Reference<css::util::XCloneable> SAL_CALL createClone() 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; + + // ____ 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; + + // ____ OPropertySet ____ + virtual void firePropertyChangeEvent() override; + using OPropertySet::disposing; + + void fireModifyEvent(); + + typedef std::vector<css::uno::Reference<css::chart2::data::XLabeledDataSequence>> + tDataSequenceContainer; + tDataSequenceContainer m_aDataSequences; + + typedef std::map<sal_Int32, css::uno::Reference<css::beans::XPropertySet>> + tDataPointAttributeContainer; + tDataPointAttributeContainer m_aAttributedDataPoints; + + typedef std::vector<css::uno::Reference<css::chart2::XRegressionCurve>> + tRegressionCurveContainerType; + tRegressionCurveContainerType m_aRegressionCurves; + + css::uno::Reference<css::util::XModifyListener> m_xModifyEventForwarder; +}; + +} // namespace chart + +// INCLUDED_CHART2_SOURCE_MODEL_INC_DATASERIES_HXX +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/inc/Diagram.hxx b/chart2/source/inc/Diagram.hxx new file mode 100644 index 000000000000..838750db38d3 --- /dev/null +++ b/chart2/source/inc/Diagram.hxx @@ -0,0 +1,248 @@ +/* -*- 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 . + */ +#ifndef INCLUDED_CHART2_SOURCE_MODEL_INC_DIAGRAM_HXX +#define INCLUDED_CHART2_SOURCE_MODEL_INC_DIAGRAM_HXX + +#include <OPropertySet.hxx> +#include <MutexContainer.hxx> +#include <PropertyHelper.hxx> +#include <cppuhelper/implbase.hxx> +#include <comphelper/uno3.hxx> +#include <com/sun/star/chart2/XDiagram.hpp> +#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp> +#include <com/sun/star/chart2/XTitled.hpp> +#include <com/sun/star/chart/X3DDefaultSetter.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/util/XModifyBroadcaster.hpp> +#include <com/sun/star/util/XModifyListener.hpp> + +#include <vector> + +namespace com +{ +namespace sun +{ +namespace star +{ +namespace beans +{ +struct PropertyValue; +} +} +} +} +namespace com +{ +namespace sun +{ +namespace star +{ +namespace chart2 +{ +namespace data +{ +class XDataSource; +} +} +} +} +} +namespace com +{ +namespace sun +{ +namespace star +{ +namespace uno +{ +class XComponentContext; +} +} +} +} + +namespace chart +{ +namespace impl +{ +typedef ::cppu::WeakImplHelper<css::chart2::XDiagram, css::lang::XServiceInfo, + css::chart2::XCoordinateSystemContainer, css::chart2::XTitled, + css::chart::X3DDefaultSetter, css::util::XModifyBroadcaster, + css::util::XModifyListener, css::util::XCloneable> + Diagram_Base; +} + +namespace diagram +{ +struct StaticDiagramInfo_Initializer +{ + css::uno::Reference<css::beans::XPropertySetInfo>* operator()(); +}; + +struct StaticDiagramInfo + : public rtl::StaticAggregate<css::uno::Reference<css::beans::XPropertySetInfo>, + StaticDiagramInfo_Initializer> +{ +}; + +struct StaticDiagramDefaults_Initializer +{ + ::chart::tPropertyValueMap* operator()(); +}; + +struct StaticDiagramDefaults + : public rtl::StaticAggregate<::chart::tPropertyValueMap, StaticDiagramDefaults_Initializer> +{ +}; + +struct StaticDiagramInfoHelper_Initializer +{ + ::cppu::OPropertyArrayHelper* operator()(); +}; + +struct StaticDiagramInfoHelper + : public rtl::StaticAggregate<::cppu::OPropertyArrayHelper, StaticDiagramInfoHelper_Initializer> +{ +}; +} + +class Diagram final : public MutexContainer, + public impl::Diagram_Base, + public ::property::OPropertySet +{ +public: + Diagram(css::uno::Reference<css::uno::XComponentContext> const& xContext); + virtual ~Diagram() override; + + /// XServiceInfo declarations + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +private: + explicit Diagram(const Diagram& rOther); + + // ____ OPropertySet ____ + virtual css::uno::Any GetDefaultValue(sal_Int32 nHandle) const override; + + // ____ OPropertySet ____ + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; + + // ____ XPropertySet ____ + virtual css::uno::Reference<css::beans::XPropertySetInfo> + SAL_CALL getPropertySetInfo() override; + + // ____ XFastPropertySet ____ + virtual void SAL_CALL setFastPropertyValue(sal_Int32 nHandle, + const css::uno::Any& rValue) override; + + /// make original interface function visible again + using ::com::sun::star::beans::XFastPropertySet::getFastPropertyValue; + + virtual void SAL_CALL getFastPropertyValue(css::uno::Any& rValue, + sal_Int32 nHandle) const override; + + // ____ XDiagram ____ + virtual css::uno::Reference<css::beans::XPropertySet> SAL_CALL getWall() override; + virtual css::uno::Reference<css::beans::XPropertySet> SAL_CALL getFloor() override; + virtual css::uno::Reference<css::chart2::XLegend> SAL_CALL getLegend() override; + virtual void SAL_CALL + setLegend(const css::uno::Reference<css::chart2::XLegend>& xLegend) override; + virtual css::uno::Reference<css::chart2::XColorScheme> + SAL_CALL getDefaultColorScheme() override; + virtual void SAL_CALL setDefaultColorScheme( + const css::uno::Reference<css::chart2::XColorScheme>& xColorScheme) override; + virtual void SAL_CALL + setDiagramData(const css::uno::Reference<css::chart2::data::XDataSource>& xDataSource, + const css::uno::Sequence<css::beans::PropertyValue>& aArguments) override; + + // ____ XCoordinateSystemContainer ____ + virtual void SAL_CALL addCoordinateSystem( + const css::uno::Reference<css::chart2::XCoordinateSystem>& aCoordSys) override; + virtual void SAL_CALL removeCoordinateSystem( + const css::uno::Reference<css::chart2::XCoordinateSystem>& aCoordSys) override; + virtual css::uno::Sequence<css::uno::Reference<css::chart2::XCoordinateSystem>> + SAL_CALL getCoordinateSystems() override; + virtual void SAL_CALL setCoordinateSystems( + const css::uno::Sequence<css::uno::Reference<css::chart2::XCoordinateSystem>>& + aCoordinateSystems) override; + + // ____ XTitled ____ + virtual css::uno::Reference<css::chart2::XTitle> SAL_CALL getTitleObject() override; + virtual void SAL_CALL + setTitleObject(const css::uno::Reference<css::chart2::XTitle>& Title) override; + + // ____ X3DDefaultSetter ____ + virtual void SAL_CALL set3DSettingsToDefault() override; + virtual void SAL_CALL setDefaultRotation() override; + virtual void SAL_CALL setDefaultIllumination() override; + + // ____ XCloneable ____ + virtual css::uno::Reference<css::util::XCloneable> SAL_CALL createClone() 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; + + // ____ 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; + + // ____ OPropertySet ____ + virtual void firePropertyChangeEvent() override; + using OPropertySet::disposing; + + void fireModifyEvent(); + + css::uno::Reference<css::uno::XComponentContext> m_xContext; + + typedef std::vector<css::uno::Reference<css::chart2::XCoordinateSystem>> + tCoordinateSystemContainerType; + + tCoordinateSystemContainerType m_aCoordSystems; + + css::uno::Reference<css::beans::XPropertySet> m_xWall; + + css::uno::Reference<css::beans::XPropertySet> m_xFloor; + + css::uno::Reference<css::chart2::XTitle> m_xTitle; + + css::uno::Reference<css::chart2::XLegend> m_xLegend; + + css::uno::Reference<css::chart2::XColorScheme> m_xColorScheme; + + css::uno::Reference<css::util::XModifyListener> m_xModifyEventForwarder; +}; + +} // namespace chart + +// INCLUDED_CHART2_SOURCE_MODEL_INC_DIAGRAM_HXX +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/inc/GridProperties.hxx b/chart2/source/inc/GridProperties.hxx new file mode 100644 index 000000000000..33f06520779b --- /dev/null +++ b/chart2/source/inc/GridProperties.hxx @@ -0,0 +1,133 @@ +/* -*- 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 . + */ +#ifndef INCLUDED_CHART2_SOURCE_MODEL_MAIN_GRIDPROPERTIES_HXX +#define INCLUDED_CHART2_SOURCE_MODEL_MAIN_GRIDPROPERTIES_HXX + +#include <cppuhelper/implbase.hxx> +#include <comphelper/uno3.hxx> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/util/XModifyBroadcaster.hpp> +#include <com/sun/star/util/XModifyListener.hpp> + +#include <OPropertySet.hxx> +#include <MutexContainer.hxx> +#include <PropertyHelper.hxx> + +namespace chart +{ +namespace impl +{ +typedef ::cppu::WeakImplHelper<css::lang::XServiceInfo, css::util::XCloneable, + css::util::XModifyBroadcaster, css::util::XModifyListener> + GridProperties_Base; +} + +namespace grid +{ +struct StaticGridInfo_Initializer +{ + css::uno::Reference<css::beans::XPropertySetInfo>* operator()(); +}; + +struct StaticGridInfo + : public rtl::StaticAggregate<css::uno::Reference<css::beans::XPropertySetInfo>, + StaticGridInfo_Initializer> +{ +}; + +struct StaticGridDefaults_Initializer +{ + ::chart::tPropertyValueMap* operator()(); +}; + +struct StaticGridDefaults + : public rtl::StaticAggregate<::chart::tPropertyValueMap, StaticGridDefaults_Initializer> +{ +}; + +struct StaticGridInfoHelper_Initializer +{ + ::cppu::OPropertyArrayHelper* operator()(); +}; + +struct StaticGridInfoHelper + : public rtl::StaticAggregate<::cppu::OPropertyArrayHelper, StaticGridInfoHelper_Initializer> +{ +}; +} + +class GridProperties final : public MutexContainer, + public impl::GridProperties_Base, + public ::property::OPropertySet +{ +public: + explicit GridProperties(); + virtual ~GridProperties() override; + + /// XServiceInfo declarations + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +private: + explicit GridProperties(const GridProperties& rOther); + + // ____ OPropertySet ____ + virtual css::uno::Any GetDefaultValue(sal_Int32 nHandle) const override; + + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; + + // ____ XPropertySet ____ + virtual css::uno::Reference<css::beans::XPropertySetInfo> + SAL_CALL getPropertySetInfo() override; + + // ____ XCloneable ____ + virtual css::uno::Reference<css::util::XCloneable> SAL_CALL createClone() 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; + + // ____ 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; + + // ____ OPropertySet ____ + virtual void firePropertyChangeEvent() override; + using OPropertySet::disposing; + + css::uno::Reference<css::util::XModifyListener> m_xModifyEventForwarder; +}; + +} // namespace chart + +// INCLUDED_CHART2_SOURCE_MODEL_MAIN_GRIDPROPERTIES_HXX +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/inc/PageBackground.hxx b/chart2/source/inc/PageBackground.hxx new file mode 100644 index 000000000000..1d809707ac72 --- /dev/null +++ b/chart2/source/inc/PageBackground.hxx @@ -0,0 +1,134 @@ +/* -*- 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 . + */ +#ifndef INCLUDED_CHART2_SOURCE_MODEL_MAIN_PAGEBACKGROUND_HXX +#define INCLUDED_CHART2_SOURCE_MODEL_MAIN_PAGEBACKGROUND_HXX + +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/util/XModifyBroadcaster.hpp> +#include <com/sun/star/util/XModifyListener.hpp> +#include <MutexContainer.hxx> +#include <OPropertySet.hxx> +#include <PropertyHelper.hxx> +#include <cppuhelper/implbase.hxx> + +#include <comphelper/uno3.hxx> + +namespace chart +{ +namespace impl +{ +typedef ::cppu::WeakImplHelper<css::util::XCloneable, css::util::XModifyBroadcaster, + css::util::XModifyListener, css::lang::XServiceInfo> + PageBackground_Base; +} + +namespace page +{ +struct StaticPageBackgroundInfo_Initializer +{ + css::uno::Reference<css::beans::XPropertySetInfo>* operator()(); +}; + +struct StaticPageBackgroundInfo + : public rtl::StaticAggregate<css::uno::Reference<css::beans::XPropertySetInfo>, + StaticPageBackgroundInfo_Initializer> +{ +}; + +struct StaticPageBackgroundDefaults_Initializer +{ + ::chart::tPropertyValueMap* operator()(); +}; + +struct StaticPageBackgroundDefaults + : public rtl::StaticAggregate<::chart::tPropertyValueMap, + StaticPageBackgroundDefaults_Initializer> +{ +}; + +struct StaticPageBackgroundInfoHelper_Initializer +{ + ::cppu::OPropertyArrayHelper* operator()(); +}; + +struct StaticPageBackgroundInfoHelper + : public rtl::StaticAggregate<::cppu::OPropertyArrayHelper, + StaticPageBackgroundInfoHelper_Initializer> +{ +}; +} + +class PageBackground final : public MutexContainer, + public impl::PageBackground_Base, + public ::property::OPropertySet +{ +public: + explicit PageBackground(); + virtual ~PageBackground() override; + + /// XServiceInfo declarations + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; + + /// merge XInterface implementations + DECLARE_XINTERFACE() + +private: + explicit PageBackground(const PageBackground& rOther); + + // ____ OPropertySet ____ + virtual css::uno::Any GetDefaultValue(sal_Int32 nHandle) const override; + + // ____ OPropertySet ____ + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; + + // ____ XPropertySet ____ + virtual css::uno::Reference<css::beans::XPropertySetInfo> + SAL_CALL getPropertySetInfo() override; + + // ____ XCloneable ____ + virtual css::uno::Reference<css::util::XCloneable> SAL_CALL createClone() 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; + + // ____ 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; + + // ____ OPropertySet ____ + virtual void firePropertyChangeEvent() override; + using OPropertySet::disposing; + + css::uno::Reference<css::util::XModifyListener> m_xModifyEventForwarder; +}; + +} // namespace chart + +// INCLUDED_CHART2_SOURCE_MODEL_MAIN_PAGEBACKGROUND_HXX +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/inc/StockBar.hxx b/chart2/source/inc/StockBar.hxx new file mode 100644 index 000000000000..dc4a4e5ffc63 --- /dev/null +++ b/chart2/source/inc/StockBar.hxx @@ -0,0 +1,125 @@ +/* -*- 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 . + */ +#ifndef INCLUDED_CHART2_SOURCE_MODEL_INC_STOCKBAR_HXX +#define INCLUDED_CHART2_SOURCE_MODEL_INC_STOCKBAR_HXX + +#include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/util/XModifyBroadcaster.hpp> +#include <com/sun/star/util/XModifyListener.hpp> +#include <MutexContainer.hxx> +#include <OPropertySet.hxx> +#include <PropertyHelper.hxx> + +#include <cppuhelper/implbase.hxx> +#include <comphelper/uno3.hxx> + +namespace chart +{ +namespace impl +{ +typedef ::cppu::WeakImplHelper<css::util::XCloneable, css::util::XModifyBroadcaster, + css::util::XModifyListener> + StockBar_Base; +} + +namespace stock +{ +struct StaticStockBarInfo_Initializer +{ + css::uno::Reference<css::beans::XPropertySetInfo>* operator()(); +}; + +struct StaticStockBarInfo + : public rtl::StaticAggregate<css::uno::Reference<css::beans::XPropertySetInfo>, + StaticStockBarInfo_Initializer> +{ +}; + +struct StaticStockBarDefaults_Initializer +{ + ::chart::tPropertyValueMap* operator()(); +}; + +struct StaticStockBarDefaults + : public rtl::StaticAggregate<::chart::tPropertyValueMap, StaticStockBarDefaults_Initializer> +{ +}; + +struct StaticStockBarInfoHelper_Initializer +{ + ::cppu::OPropertyArrayHelper* operator()(); +}; + +struct StaticStockBarInfoHelper : public rtl::StaticAggregate<::cppu::OPropertyArrayHelper, + StaticStockBarInfoHelper_Initializer> +{ +}; +} + +class StockBar final : public MutexContainer, + public impl::StockBar_Base, + public ::property::OPropertySet +{ +public: + explicit StockBar(bool bRisingCourse); + virtual ~StockBar() override; + + /// merge XInterface implementations + DECLARE_XINTERFACE() + +private: + explicit StockBar(const StockBar& rOther); + + // ____ OPropertySet ____ + virtual css::uno::Any GetDefaultValue(sal_Int32 nHandle) const override; + + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; + + // ____ XPropertySet ____ + virtual css::uno::Reference<css::beans::XPropertySetInfo> + SAL_CALL getPropertySetInfo() override; + + // ____ XCloneable ____ + virtual css::uno::Reference<css::util::XCloneable> SAL_CALL createClone() 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; + + // ____ 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; + + // ____ OPropertySet ____ + virtual void firePropertyChangeEvent() override; + using OPropertySet::disposing; + + css::uno::Reference<css::util::XModifyListener> m_xModifyEventForwarder; +}; + +} // namespace chart + +// INCLUDED_CHART2_SOURCE_MODEL_INC_STOCKBAR_HXX +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/inc/Title.hxx b/chart2/source/inc/Title.hxx new file mode 100644 index 000000000000..00f389bc4461 --- /dev/null +++ b/chart2/source/inc/Title.hxx @@ -0,0 +1,143 @@ +/* -*- 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 . + */ +#ifndef INCLUDED_CHART2_SOURCE_MODEL_MAIN_TITLE_HXX +#define INCLUDED_CHART2_SOURCE_MODEL_MAIN_TITLE_HXX + +#include <OPropertySet.hxx> +#include <MutexContainer.hxx> +#include <PropertyHelper.hxx> +#include <cppuhelper/implbase.hxx> +#include <comphelper/uno3.hxx> +#include <com/sun/star/chart2/XTitle.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/util/XModifyBroadcaster.hpp> +#include <com/sun/star/util/XModifyListener.hpp> + +namespace chart +{ +namespace impl +{ +typedef ::cppu::WeakImplHelper<css::chart2::XTitle, css::lang::XServiceInfo, css::util::XCloneable, + css::util::XModifyBroadcaster, css::util::XModifyListener> + Title_Base; +} + +namespace title +{ +struct StaticTitleInfo_Initializer +{ + css::uno::Reference<css::beans::XPropertySetInfo>* operator()(); +}; + +struct StaticTitleInfo + : public rtl::StaticAggregate<css::uno::Reference<css::beans::XPropertySetInfo>, + StaticTitleInfo_Initializer> +{ +}; + +struct StaticTitleDefaults_Initializer +{ + ::chart::tPropertyValueMap* operator()(); +}; + +struct StaticTitleDefaults + : public rtl::StaticAggregate<::chart::tPropertyValueMap, StaticTitleDefaults_Initializer> +{ +}; + +struct StaticTitleInfoHelper_Initializer +{ + ::cppu::OPropertyArrayHelper* operator()(); +}; + +struct StaticTitleInfoHelper + : public rtl::StaticAggregate<::cppu::OPropertyArrayHelper, StaticTitleInfoHelper_Initializer> +{ +}; +} + +class Title final : public MutexContainer, public impl::Title_Base, public ::property::OPropertySet +{ +public: + explicit Title(); + virtual ~Title() override; + + /// XServiceInfo declarations + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +private: + explicit Title(const Title& rOther); + + // ____ OPropertySet ____ + virtual css::uno::Any GetDefaultValue(sal_Int32 nHandle) const override; + + // ____ OPropertySet ____ + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; + + // ____ XPropertySet ____ + virtual css::uno::Reference<css::beans::XPropertySetInfo> + SAL_CALL getPropertySetInfo() override; + + // ____ XTitle ____ + virtual css::uno::Sequence<css::uno::Reference<css::chart2::XFormattedString>> + SAL_CALL getText() override; + virtual void SAL_CALL + setText(const css::uno::Sequence<css::uno::Reference<css::chart2::XFormattedString>>& Strings) + override; + + // ____ XCloneable ____ + virtual css::uno::Reference<css::util::XCloneable> SAL_CALL createClone() 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; + + // ____ 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; + + // ____ OPropertySet ____ + virtual void firePropertyChangeEvent() override; + using OPropertySet::disposing; + + void fireModifyEvent(); + + css::uno::Sequence<css::uno::Reference<css::chart2::XFormattedString>> m_aStrings; + + css::uno::Reference<css::util::XModifyListener> m_xModifyEventForwarder; +}; + +} // namespace chart + +// INCLUDED_CHART2_SOURCE_MODEL_MAIN_TITLE_HXX +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/Wall.hxx b/chart2/source/inc/Wall.hxx similarity index 50% rename from chart2/source/model/main/Wall.hxx rename to chart2/source/inc/Wall.hxx index a3112a614bda..1ab5c334496f 100644 --- a/chart2/source/model/main/Wall.hxx +++ b/chart2/source/inc/Wall.hxx @@ -24,71 +24,97 @@ #include <com/sun/star/util/XModifyListener.hpp> #include <MutexContainer.hxx> #include <OPropertySet.hxx> +#include <PropertyHelper.hxx> #include <cppuhelper/implbase.hxx> #include <comphelper/uno3.hxx> namespace chart { - namespace impl { -typedef ::cppu::WeakImplHelper< - css::util::XCloneable, - css::util::XModifyBroadcaster, - css::util::XModifyListener > +typedef ::cppu::WeakImplHelper<css::util::XCloneable, css::util::XModifyBroadcaster, + css::util::XModifyListener> Wall_Base; } -class Wall final : - public MutexContainer, - public impl::Wall_Base, - public ::property::OPropertySet +namespace wall +{ +struct StaticWallInfo_Initializer +{ + css::uno::Reference<css::beans::XPropertySetInfo>* operator()(); +}; + +struct StaticWallInfo + : public rtl::StaticAggregate<css::uno::Reference<css::beans::XPropertySetInfo>, + StaticWallInfo_Initializer> +{ +}; + +struct StaticWallDefaults_Initializer +{ + ::chart::tPropertyValueMap* operator()(); +}; + +struct StaticWallDefaults + : public rtl::StaticAggregate<::chart::tPropertyValueMap, StaticWallDefaults_Initializer> +{ +}; + +struct StaticWallInfoHelper_Initializer +{ + ::cppu::OPropertyArrayHelper* operator()(); +}; + +struct StaticWallInfoHelper + : public rtl::StaticAggregate<::cppu::OPropertyArrayHelper, StaticWallInfoHelper_Initializer> +{ +}; +} + +class Wall final : public MutexContainer, public impl::Wall_Base, public ::property::OPropertySet { public: Wall(); virtual ~Wall() override; /// merge XInterface implementations - DECLARE_XINTERFACE() + DECLARE_XINTERFACE() private: - explicit Wall( const Wall & rOther ); + explicit Wall(const Wall& rOther); // ____ OPropertySet ____ - virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const override; + virtual css::uno::Any GetDefaultValue(sal_Int32 nHandle) const override; // ____ OPropertySet ____ - virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; // ____ XPropertySet ____ - virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL - getPropertySetInfo() override; + virtual css::uno::Reference<css::beans::XPropertySetInfo> + SAL_CALL getPropertySetInfo() override; // ____ XCloneable ____ - virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override; + virtual css::uno::Reference<css::util::XCloneable> SAL_CALL createClone() 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 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; // ____ XModifyListener ____ - virtual void SAL_CALL modified( - const css::lang::EventObject& aEvent ) override; + 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; + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; // ____ OPropertySet ____ virtual void firePropertyChangeEvent() override; using OPropertySet::disposing; private: - - css::uno::Reference< css::util::XModifyListener > m_xModifyEventForwarder; + css::uno::Reference<css::util::XModifyListener> m_xModifyEventForwarder; }; } // namespace chart diff --git a/chart2/source/model/inc/DataSeries.hxx b/chart2/source/model/inc/DataSeries.hxx deleted file mode 100644 index aefab3406606..000000000000 --- a/chart2/source/model/inc/DataSeries.hxx +++ /dev/null @@ -1,172 +0,0 @@ -/* -*- 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 . - */ -#ifndef INCLUDED_CHART2_SOURCE_MODEL_INC_DATASERIES_HXX -#define INCLUDED_CHART2_SOURCE_MODEL_INC_DATASERIES_HXX - -// UNO types -#include <com/sun/star/chart2/XDataSeries.hpp> -#include <com/sun/star/chart2/data/XDataSink.hpp> -#include <com/sun/star/chart2/data/XDataSource.hpp> -#include <com/sun/star/chart2/XRegressionCurveContainer.hpp> -#include <com/sun/star/util/XCloneable.hpp> -#include <com/sun/star/util/XModifyBroadcaster.hpp> -#include <com/sun/star/util/XModifyListener.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> - -// helper classes -#include <cppuhelper/implbase.hxx> -#include <comphelper/uno3.hxx> - -// STL -#include <vector> -#include <map> - -#include <MutexContainer.hxx> -#include <OPropertySet.hxx> - -namespace com { namespace sun { namespace star { namespace beans { class XPropertySet; } } } } - -namespace chart -{ - -namespace impl -{ -typedef ::cppu::WeakImplHelper< - css::chart2::XDataSeries, - css::chart2::data::XDataSink, - css::chart2::data::XDataSource, - css::lang::XServiceInfo, - css::chart2::XRegressionCurveContainer, - css::util::XCloneable, - css::util::XModifyBroadcaster, - css::util::XModifyListener > - DataSeries_Base; -} - -class DataSeries final : - public MutexContainer, - public impl::DataSeries_Base, - public ::property::OPropertySet -{ -public: - explicit DataSeries(); - virtual ~DataSeries() override; - - /// XServiceInfo declarations - virtual OUString SAL_CALL getImplementationName() override; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - - /// merge XInterface implementations - DECLARE_XINTERFACE() - /// merge XTypeProvider implementations - DECLARE_XTYPEPROVIDER() - -private: - explicit DataSeries( const DataSeries & rOther ); - - // late initialization to call after copy-constructing - void Init( const DataSeries & rOther ); - - // ____ XDataSeries ____ - /// @see css::chart2::XDataSeries - virtual css::uno::Reference< css::beans::XPropertySet > - SAL_CALL getDataPointByIndex( sal_Int32 nIndex ) override; - virtual void SAL_CALL resetDataPoint( sal_Int32 nIndex ) override; - virtual void SAL_CALL resetAllDataPoints() override; - - // ____ XDataSink ____ - /// @see css::chart2::data::XDataSink - virtual void SAL_CALL setData( const css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > >& aData ) override; - - // ____ XDataSource ____ - /// @see css::chart2::data::XDataSource - virtual css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > SAL_CALL getDataSequences() override; - - // ____ OPropertySet ____ - virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const override; - virtual void SAL_CALL getFastPropertyValue( css::uno::Any& rValue, sal_Int32 nHandle ) const override; - virtual void SAL_CALL setFastPropertyValue_NoBroadcast - ( sal_Int32 nHandle, - const css::uno::Any& rValue ) override; - - virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; - - // ____ XPropertySet ____ - /// @see css::beans::XPropertySet - virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL - getPropertySetInfo() override; - - /// make original interface function visible again - using ::com::sun::star::beans::XFastPropertySet::getFastPropertyValue; - - // ____ XRegressionCurveContainer ____ - /// @see css::chart2::XRegressionCurveContainer - virtual void SAL_CALL addRegressionCurve( - const css::uno::Reference< css::chart2::XRegressionCurve >& aRegressionCurve ) override; - virtual void SAL_CALL removeRegressionCurve( - const css::uno::Reference< css::chart2::XRegressionCurve >& aRegressionCurve ) override; - virtual css::uno::Sequence< css::uno::Reference< css::chart2::XRegressionCurve > > SAL_CALL getRegressionCurves() override; - virtual void SAL_CALL setRegressionCurves( - const css::uno::Sequence< css::uno::Reference< css::chart2::XRegressionCurve > >& aRegressionCurves ) override; - - // ____ XCloneable ____ - virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() 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; - - // ____ 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; - - // ____ OPropertySet ____ - virtual void firePropertyChangeEvent() override; - using OPropertySet::disposing; - - void fireModifyEvent(); - - typedef std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > tDataSequenceContainer; - tDataSequenceContainer m_aDataSequences; - - typedef std::map< sal_Int32, - css::uno::Reference< css::beans::XPropertySet > > tDataPointAttributeContainer; - tDataPointAttributeContainer m_aAttributedDataPoints; - - typedef - std::vector< css::uno::Reference< css::chart2::XRegressionCurve > > - tRegressionCurveContainerType; - tRegressionCurveContainerType m_aRegressionCurves; - - css::uno::Reference< css::util::XModifyListener > m_xModifyEventForwarder; -}; - -} // namespace chart - -// INCLUDED_CHART2_SOURCE_MODEL_INC_DATASERIES_HXX -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/inc/Diagram.hxx b/chart2/source/model/inc/Diagram.hxx deleted file mode 100644 index c9690981bfbc..000000000000 --- a/chart2/source/model/inc/Diagram.hxx +++ /dev/null @@ -1,186 +0,0 @@ -/* -*- 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 . - */ -#ifndef INCLUDED_CHART2_SOURCE_MODEL_INC_DIAGRAM_HXX -#define INCLUDED_CHART2_SOURCE_MODEL_INC_DIAGRAM_HXX - -#include <OPropertySet.hxx> -#include <MutexContainer.hxx> -#include <cppuhelper/implbase.hxx> -#include <comphelper/uno3.hxx> -#include <com/sun/star/chart2/XDiagram.hpp> -#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp> -#include <com/sun/star/chart2/XTitled.hpp> -#include <com/sun/star/chart/X3DDefaultSetter.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/util/XCloneable.hpp> -#include <com/sun/star/util/XModifyBroadcaster.hpp> -#include <com/sun/star/util/XModifyListener.hpp> - -#include <vector> - -namespace com { namespace sun { namespace star { namespace beans { struct PropertyValue; } } } } -namespace com { namespace sun { namespace star { namespace chart2 { namespace data { class XDataSource; } } } } } -namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; } } } } - -namespace chart -{ - -namespace impl -{ -typedef ::cppu::WeakImplHelper< - css::chart2::XDiagram, - css::lang::XServiceInfo, - css::chart2::XCoordinateSystemContainer, - css::chart2::XTitled, - css::chart::X3DDefaultSetter, - css::util::XModifyBroadcaster, - css::util::XModifyListener, - css::util::XCloneable > - Diagram_Base; -} - -class Diagram final : - public MutexContainer, - public impl::Diagram_Base, - public ::property::OPropertySet -{ -public: - Diagram( css::uno::Reference< css::uno::XComponentContext > const & xContext ); - virtual ~Diagram() override; - - /// XServiceInfo declarations - virtual OUString SAL_CALL getImplementationName() override; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - - /// merge XInterface implementations - DECLARE_XINTERFACE() - /// merge XTypeProvider implementations - DECLARE_XTYPEPROVIDER() - -private: - explicit Diagram( const Diagram & rOther ); - - // ____ OPropertySet ____ - virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const override; - - // ____ OPropertySet ____ - virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; - - // ____ XPropertySet ____ - virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL - getPropertySetInfo() override; - - // ____ XFastPropertySet ____ - virtual void SAL_CALL setFastPropertyValue( sal_Int32 nHandle, const css::uno::Any& rValue ) override; - - /// make original interface function visible again - using ::com::sun::star::beans::XFastPropertySet::getFastPropertyValue; - - virtual void SAL_CALL getFastPropertyValue( - css::uno::Any& rValue, sal_Int32 nHandle ) const override; - - // ____ XDiagram ____ - virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getWall() override; - virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getFloor() override; - virtual css::uno::Reference< css::chart2::XLegend > SAL_CALL getLegend() override; - virtual void SAL_CALL setLegend( const css::uno::Reference< - css::chart2::XLegend >& xLegend ) override; - virtual css::uno::Reference< css::chart2::XColorScheme > SAL_CALL getDefaultColorScheme() override; - virtual void SAL_CALL setDefaultColorScheme( - const css::uno::Reference< css::chart2::XColorScheme >& xColorScheme ) override; - virtual void SAL_CALL setDiagramData( - const css::uno::Reference< css::chart2::data::XDataSource >& xDataSource, - const css::uno::Sequence< css::beans::PropertyValue >& aArguments ) override; - - // ____ XCoordinateSystemContainer ____ - virtual void SAL_CALL addCoordinateSystem( - const css::uno::Reference< css::chart2::XCoordinateSystem >& aCoordSys ) override; - virtual void SAL_CALL removeCoordinateSystem( - const css::uno::Reference< css::chart2::XCoordinateSystem >& aCoordSys ) override; - virtual css::uno::Sequence< css::uno::Reference< css::chart2::XCoordinateSystem > > SAL_CALL getCoordinateSystems() override; - virtual void SAL_CALL setCoordinateSystems( - const css::uno::Sequence< css::uno::Reference< css::chart2::XCoordinateSystem > >& aCoordinateSystems ) override; - - // ____ XTitled ____ - virtual css::uno::Reference< - css::chart2::XTitle > SAL_CALL getTitleObject() override; - virtual void SAL_CALL setTitleObject( const css::uno::Reference< - css::chart2::XTitle >& Title ) override; - - // ____ X3DDefaultSetter ____ - virtual void SAL_CALL set3DSettingsToDefault() override; - virtual void SAL_CALL setDefaultRotation() override; - virtual void SAL_CALL setDefaultIllumination() override; - - // ____ XCloneable ____ - virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() 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; - - // ____ 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; - - // ____ OPropertySet ____ - virtual void firePropertyChangeEvent() override; - using OPropertySet::disposing; - - void fireModifyEvent(); - - css::uno::Reference< css::uno::XComponentContext > m_xContext; - - typedef - std::vector< css::uno::Reference< css::chart2::XCoordinateSystem > > - tCoordinateSystemContainerType; - - tCoordinateSystemContainerType m_aCoordSystems; - - css::uno::Reference< css::beans::XPropertySet > - m_xWall; - - css::uno::Reference< css::beans::XPropertySet > - m_xFloor; - - css::uno::Reference< css::chart2::XTitle > - m_xTitle; - - css::uno::Reference< css::chart2::XLegend > - m_xLegend; - - css::uno::Reference< css::chart2::XColorScheme > - m_xColorScheme; - - css::uno::Reference< css::util::XModifyListener > m_xModifyEventForwarder; -}; - -} // namespace chart - -// INCLUDED_CHART2_SOURCE_MODEL_INC_DIAGRAM_HXX -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/inc/StockBar.hxx b/chart2/source/model/inc/StockBar.hxx deleted file mode 100644 index b1247e584a63..000000000000 --- a/chart2/source/model/inc/StockBar.hxx +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- 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 . - */ -#ifndef INCLUDED_CHART2_SOURCE_MODEL_INC_STOCKBAR_HXX -#define INCLUDED_CHART2_SOURCE_MODEL_INC_STOCKBAR_HXX - -#include <com/sun/star/util/XCloneable.hpp> -#include <com/sun/star/util/XModifyBroadcaster.hpp> -#include <com/sun/star/util/XModifyListener.hpp> -#include <MutexContainer.hxx> -#include <OPropertySet.hxx> - -#include <cppuhelper/implbase.hxx> -#include <comphelper/uno3.hxx> - -namespace chart -{ - -namespace impl -{ -typedef ::cppu::WeakImplHelper< - css::util::XCloneable, - css::util::XModifyBroadcaster, - css::util::XModifyListener > - StockBar_Base; -} - -class StockBar final : - public MutexContainer, - public impl::StockBar_Base, - public ::property::OPropertySet -{ -public: - explicit StockBar( bool bRisingCourse ); - virtual ~StockBar() override; - - /// merge XInterface implementations - DECLARE_XINTERFACE() - -private: - explicit StockBar( const StockBar & rOther ); - - // ____ OPropertySet ____ - virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const override; - - virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; - - // ____ XPropertySet ____ - virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL - getPropertySetInfo() override; - - // ____ XCloneable ____ - virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() 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; - - // ____ 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; - - // ____ OPropertySet ____ - virtual void firePropertyChangeEvent() override; - using OPropertySet::disposing; - - css::uno::Reference< css::util::XModifyListener > m_xModifyEventForwarder; -}; - -} // namespace chart - -// INCLUDED_CHART2_SOURCE_MODEL_INC_STOCKBAR_HXX -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx index b7e19a49e548..b490ac2e6fd9 100644 --- a/chart2/source/model/main/Axis.cxx +++ b/chart2/source/model/main/Axis.cxx @@ -195,89 +195,47 @@ void lcl_AddPropertiesToVector( } -struct StaticAxisDefaults_Initializer +static Sequence< Property > lcl_GetPropertySequence() { - ::chart::tPropertyValueMap* operator()() - { - static ::chart::tPropertyValueMap aStaticDefaults; - lcl_AddDefaultsToMap( aStaticDefaults ); - return &aStaticDefaults; - } -private: - static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap ) - { - ::chart::CharacterProperties::AddDefaultsToMap( rOutMap ); - ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap ); - - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_SHOW, true ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_CROSSOVER_POSITION, css::chart::ChartAxisPosition_ZERO ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_DISPLAY_LABELS, true ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE, true ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LABEL_POSITION, css::chart::ChartAxisLabelPosition_NEAR_AXIS ); - ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_AXIS_TEXT_ROTATION, 0.0 ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_BREAK, false ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_OVERLAP, false ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_STACKED, false ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_ARRANGE_ORDER, css::chart::ChartAxisArrangeOrderType_AUTO ); - - float fDefaultCharHeight = 10.0; - ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight ); - ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight ); - ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight ); - - ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AXIS_MAJOR_TICKMARKS, 2 /* CHAXIS_MARK_OUTER */ ); - ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AXIS_MINOR_TICKMARKS, 0 /* CHAXIS_MARK_NONE */ ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_MARK_POSITION, css::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_DISPLAY_UNITS, false ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TRY_STAGGERING_FIRST, false ); - } -}; + std::vector< css::beans::Property > aProperties; + lcl_AddPropertiesToVector( aProperties ); + ::chart::CharacterProperties::AddPropertiesToVector( aProperties ); + ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties ); + ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties ); -struct StaticAxisDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticAxisDefaults_Initializer > -{ -}; - -struct StaticAxisInfoHelper_Initializer -{ - ::cppu::OPropertyArrayHelper* operator()() - { - static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() ); - return &aPropHelper; - } + std::sort( aProperties.begin(), aProperties.end(), + ::chart::PropertyNameLess() ); -private: - static Sequence< Property > lcl_GetPropertySequence() - { - std::vector< css::beans::Property > aProperties; - lcl_AddPropertiesToVector( aProperties ); - ::chart::CharacterProperties::AddPropertiesToVector( aProperties ); - ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties ); - ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties ); - - std::sort( aProperties.begin(), aProperties.end(), - ::chart::PropertyNameLess() ); - - return comphelper::containerToSequence( aProperties ); - } -}; - -struct StaticAxisInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticAxisInfoHelper_Initializer > -{ -}; - -struct StaticAxisInfo_Initializer -{ - uno::Reference< beans::XPropertySetInfo >* operator()() - { - static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo( - ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticAxisInfoHelper::get() ) ); - return &xPropertySetInfo; - } -}; + return comphelper::containerToSequence( aProperties ); +} -struct StaticAxisInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticAxisInfo_Initializer > -{ -}; +static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap ) +{ + ::chart::CharacterProperties::AddDefaultsToMap( rOutMap ); + ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap ); + + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_SHOW, true ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_CROSSOVER_POSITION, css::chart::ChartAxisPosition_ZERO ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_DISPLAY_LABELS, true ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE, true ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LABEL_POSITION, css::chart::ChartAxisLabelPosition_NEAR_AXIS ); + ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_AXIS_TEXT_ROTATION, 0.0 ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_BREAK, false ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_OVERLAP, false ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_STACKED, false ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_ARRANGE_ORDER, css::chart::ChartAxisArrangeOrderType_AUTO ); + + float fDefaultCharHeight = 10.0; + ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight ); + ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight ); + ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight ); + + ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AXIS_MAJOR_TICKMARKS, 2 /* CHAXIS_MARK_OUTER */ ); + ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AXIS_MINOR_TICKMARKS, 0 /* CHAXIS_MARK_NONE */ ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_MARK_POSITION, css::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_DISPLAY_UNITS, false ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TRY_STAGGERING_FIRST, false ); +} typedef uno::Reference< beans::XPropertySet > lcl_tSubGridType; @@ -311,6 +269,32 @@ void lcl_CloneSubGrids( namespace chart { +namespace axis +{ + +::cppu::OPropertyArrayHelper* StaticAxisInfoHelper_Initializer::operator()() +{ + static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() ); + return &aPropHelper; +} + + +uno::Reference< beans::XPropertySetInfo >* StaticAxisInfo_Initializer::operator()() +{ + static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo( + ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticAxisInfoHelper::get() ) ); + return &xPropertySetInfo; +} + +::chart::tPropertyValueMap* StaticAxisDefaults_Initializer::operator()() +{ + static ::chart::tPropertyValueMap aStaticDefaults; + lcl_AddDefaultsToMap( aStaticDefaults ); + return &aStaticDefaults; +} + +} + Axis::Axis() : ::property::OPropertySet( m_aMutex ), m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()), @@ -570,7 +554,7 @@ void Axis::fireModifyEvent() // ____ OPropertySet ____ uno::Any Axis::GetDefaultValue( sal_Int32 nHandle ) const { - const tPropertyValueMap& rStaticDefaults = *StaticAxisDefaults::get(); + const tPropertyValueMap& rStaticDefaults = *axis::StaticAxisDefaults::get(); tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) ); if( aFound == rStaticDefaults.end() ) return uno::Any(); @@ -579,13 +563,13 @@ uno::Any Axis::GetDefaultValue( sal_Int32 nHandle ) const ::cppu::IPropertyArrayHelper & SAL_CALL Axis::getInfoHelper() { - return *StaticAxisInfoHelper::get(); + return *axis::StaticAxisInfoHelper::get(); } // ____ XPropertySet ____ Reference< beans::XPropertySetInfo > SAL_CALL Axis::getPropertySetInfo() { - return *StaticAxisInfo::get(); + return *axis::StaticAxisInfo::get(); } using impl::Axis_Base; diff --git a/chart2/source/model/main/Axis.hxx b/chart2/source/model/main/Axis.hxx deleted file mode 100644 index 49f4003bbb4f..000000000000 --- a/chart2/source/model/main/Axis.hxx +++ /dev/null @@ -1,138 +0,0 @@ -/* -*- 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 . - */ -#ifndef INCLUDED_CHART2_SOURCE_MODEL_MAIN_AXIS_HXX -#define INCLUDED_CHART2_SOURCE_MODEL_MAIN_AXIS_HXX - -#include <MutexContainer.hxx> -#include <OPropertySet.hxx> -#include <cppuhelper/implbase.hxx> -#include <comphelper/uno3.hxx> - -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/chart2/XAxis.hpp> -#include <com/sun/star/chart2/XTitled.hpp> -#include <com/sun/star/util/XCloneable.hpp> -#include <com/sun/star/util/XModifyBroadcaster.hpp> -#include <com/sun/star/util/XModifyListener.hpp> - -namespace chart -{ - -namespace impl -{ -typedef ::cppu::WeakImplHelper< - css::chart2::XAxis, - css::chart2::XTitled, - css::lang::XServiceInfo, - css::util::XCloneable, - css::util::XModifyBroadcaster, - css::util::XModifyListener > - Axis_Base; -} - -class Axis final : - public MutexContainer, - public impl::Axis_Base, - public ::property::OPropertySet -{ -public: - explicit Axis(); - virtual ~Axis() override; - - /// XServiceInfo declarations - virtual OUString SAL_CALL getImplementationName() override; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - - /// merge XInterface implementations - DECLARE_XINTERFACE() - /// merge XTypeProvider implementations - DECLARE_XTYPEPROVIDER() - -private: - explicit Axis( const Axis & rOther ); - - // late initialization to call after copy-constructing - void Init(); - - // ____ OPropertySet ____ - virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const override; - - // ____ OPropertySet ____ - virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; - - // ____ XPropertySet ____ - virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL - getPropertySetInfo() override; - - // ____ XAxis ____ - virtual void SAL_CALL setScaleData( const css::chart2::ScaleData& rScaleData ) override; - virtual css::chart2::ScaleData SAL_CALL getScaleData() override; - virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getGridProperties() override; - virtual css::uno::Sequence< css::uno::Reference< css::beans::XPropertySet > > SAL_CALL getSubGridProperties() override; - virtual css::uno::Sequence< css::uno::Reference< css::beans::XPropertySet > > SAL_CALL getSubTickProperties() override; - - // ____ XTitled ____ - virtual css::uno::Reference< css::chart2::XTitle > SAL_CALL getTitleObject() override; - virtual void SAL_CALL setTitleObject( - const css::uno::Reference< css::chart2::XTitle >& Title ) override; - - // ____ XCloneable ____ - // Note: the coordinate systems are not cloned! - virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() 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; - - // ____ 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; - - // ____ OPropertySet ____ - virtual void firePropertyChangeEvent() override; - using OPropertySet::disposing; - - void fireModifyEvent(); - - void AllocateSubGrids(); - - css::uno::Reference< css::util::XModifyListener > m_xModifyEventForwarder; - - css::chart2::ScaleData m_aScaleData; - - css::uno::Reference< css::beans::XPropertySet > m_xGrid; - - css::uno::Sequence< css::uno::Reference< css::beans::XPropertySet > > m_aSubGridProperties; - - css::uno::Reference< css::chart2::XTitle > m_xTitle; -}; - -} // namespace chart - -// INCLUDED_CHART2_SOURCE_MODEL_MAIN_AXIS_HXX -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/DataPoint.cxx b/chart2/source/model/main/DataPoint.cxx index 6e9f6d483ccc..e88ea6bfc03c 100644 --- a/chart2/source/model/main/DataPoint.cxx +++ b/chart2/source/model/main/DataPoint.cxx @@ -39,51 +39,42 @@ using ::com::sun::star::beans::Property; namespace { -struct StaticDataPointInfoHelper_Initializer +static Sequence< Property > lcl_GetPropertySequence() { - ::cppu::OPropertyArrayHelper* operator()() - { - static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() ); - return &aPropHelper; - } + std::vector< css::beans::Property > aProperties; + ::chart::DataPointProperties::AddPropertiesToVector( aProperties ); + ::chart::CharacterProperties::AddPropertiesToVector( aProperties ); + ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties ); -private: - static Sequence< Property > lcl_GetPropertySequence() - { - std::vector< css::beans::Property > aProperties; - ::chart::DataPointProperties::AddPropertiesToVector( aProperties ); - ::chart::CharacterProperties::AddPropertiesToVector( aProperties ); - ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties ); + std::sort( aProperties.begin(), aProperties.end(), + ::chart::PropertyNameLess() ); - std::sort( aProperties.begin(), aProperties.end(), - ::chart::PropertyNameLess() ); + return comphelper::containerToSequence( aProperties ); +} - return comphelper::containerToSequence( aProperties ); - } -}; +} // anonymous namespace -struct StaticDataPointInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticDataPointInfoHelper_Initializer > +namespace chart { -}; -struct StaticDataPointInfo_Initializer +namespace dataPoint { - uno::Reference< beans::XPropertySetInfo >* operator()() - { - static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo( - ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticDataPointInfoHelper::get() ) ); - return &xPropertySetInfo; - } -}; -struct StaticDataPointInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticDataPointInfo_Initializer > +::cppu::OPropertyArrayHelper* StaticDataPointInfoHelper_Initializer::operator()() { -}; + static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() ); + return &aPropHelper; +} -} // anonymous namespace -namespace chart +uno::Reference< beans::XPropertySetInfo >* StaticDataPointInfo_Initializer::operator()() { + static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo( + ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticDataPointInfoHelper::get() ) ); + return &xPropertySetInfo; +} + +} DataPoint::DataPoint( const uno::Reference< beans::XPropertySet > & rParentProperties ) : ::property::OPropertySet( m_aMutex ), @@ -208,13 +199,13 @@ void SAL_CALL DataPoint::setFastPropertyValue_NoBroadcast( ::cppu::IPropertyArrayHelper & SAL_CALL DataPoint::getInfoHelper() { - return *StaticDataPointInfoHelper::get(); + return *dataPoint::StaticDataPointInfoHelper::get(); } // ____ XPropertySet ____ Reference< beans::XPropertySetInfo > SAL_CALL DataPoint::getPropertySetInfo() { - return *StaticDataPointInfo::get(); + return *dataPoint::StaticDataPointInfo::get(); } // ____ XModifyBroadcaster ____ diff --git a/chart2/source/model/main/DataPoint.hxx b/chart2/source/model/main/DataPoint.hxx deleted file mode 100644 index de3e5020387c..000000000000 --- a/chart2/source/model/main/DataPoint.hxx +++ /dev/null @@ -1,116 +0,0 @@ -/* -*- 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 . - */ -#ifndef INCLUDED_CHART2_SOURCE_MODEL_MAIN_DATAPOINT_HXX -#define INCLUDED_CHART2_SOURCE_MODEL_MAIN_DATAPOINT_HXX - -#include <cppuhelper/implbase.hxx> -#include <cppuhelper/weakref.hxx> -#include <comphelper/uno3.hxx> -#include <com/sun/star/container/XChild.hpp> -#include <com/sun/star/util/XCloneable.hpp> -#include <com/sun/star/util/XModifyBroadcaster.hpp> -#include <com/sun/star/util/XModifyListener.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> - -#include <OPropertySet.hxx> -#include <MutexContainer.hxx> - -namespace chart -{ - -namespace impl -{ -typedef ::cppu::WeakImplHelper< - css::container::XChild, - css::util::XCloneable, - css::util::XModifyBroadcaster, - css::util::XModifyListener, - css::lang::XServiceInfo > - DataPoint_Base; -} - -class DataPoint final : - public MutexContainer, - public impl::DataPoint_Base, - public ::property::OPropertySet -{ -public: - explicit DataPoint( const css::uno::Reference< css::beans::XPropertySet > & rParentProperties ); - virtual ~DataPoint() override; - - /// merge XInterface implementations - DECLARE_XINTERFACE() - /// XServiceInfo declarations - virtual OUString SAL_CALL getImplementationName() override; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - -private: - explicit DataPoint( const DataPoint & rOther ); - - // ____ OPropertySet ____ - virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const override; - virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; - virtual void SAL_CALL setFastPropertyValue_NoBroadcast - ( sal_Int32 nHandle, - const css::uno::Any& rValue ) override; - - // ____ XPropertySet ____ - virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL - getPropertySetInfo() override; - - // ____ XCloneable ____ - // Note: m_xParentProperties are not cloned! - virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override; - - // ____ XChild ____ - virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override; - virtual void SAL_CALL setParent( - const css::uno::Reference< css::uno::XInterface >& Parent ) 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; - - // ____ 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; - - // ____ OPropertySet ____ - virtual void firePropertyChangeEvent() override; - using OPropertySet::disposing; - - css::uno::WeakReference< css::beans::XPropertySet > m_xParentProperties; - - css::uno::Reference< css::util::XModifyListener > m_xModifyEventForwarder; - bool m_bNoParentPropAllowed; -}; - -} // namespace chart - -// INCLUDED_CHART2_SOURCE_MODEL_MAIN_DATAPOINT_HXX -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx index 26226172bf43..1ca733dadca0 100644 --- a/chart2/source/model/main/DataSeries.cxx +++ b/chart2/source/model/main/DataSeries.cxx @@ -46,44 +46,28 @@ using ::osl::MutexGuard; namespace { -struct StaticDataSeriesDefaults : public rtl::StaticWithInit< ::chart::tPropertyValueMap, StaticDataSeriesDefaults > +static Sequence< Property > lcl_GetPropertySequence() { - ::chart::tPropertyValueMap operator()() - { - ::chart::tPropertyValueMap aStaticDefaults; - ::chart::DataSeriesProperties::AddDefaultsToMap( aStaticDefaults ); - ::chart::CharacterProperties::AddDefaultsToMap( aStaticDefaults ); - float fDefaultCharHeight = 10.0; - ::chart::PropertyHelper::setPropertyValue( aStaticDefaults, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight ); - ::chart::PropertyHelper::setPropertyValue( aStaticDefaults, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight ); - ::chart::PropertyHelper::setPropertyValue( aStaticDefaults, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight ); - return aStaticDefaults; - } -}; - -struct StaticDataSeriesInfoHelper : public rtl::StaticWithInit< ::cppu::OPropertyArrayHelper, StaticDataSeriesInfoHelper, StaticDataSeriesInfoHelper, uno::Sequence< Property > > -{ - uno::Sequence< Property > operator()() - { - std::vector< css::beans::Property > aProperties; - ::chart::DataSeriesProperties::AddPropertiesToVector( aProperties ); - ::chart::CharacterProperties::AddPropertiesToVector( aProperties ); - ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties ); + std::vector< css::beans::Property > aProperties; + ::chart::DataSeriesProperties::AddPropertiesToVector( aProperties ); + ::chart::CharacterProperties::AddPropertiesToVector( aProperties ); + ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties ); - std::sort( aProperties.begin(), aProperties.end(), - ::chart::PropertyNameLess() ); + std::sort( aProperties.begin(), aProperties.end(), + ::chart::PropertyNameLess() ); - return comphelper::containerToSequence( aProperties ); - } -}; + return comphelper::containerToSequence( aProperties ); +} -struct StaticDataSeriesInfo : public rtl::StaticWithInit< uno::Reference< beans::XPropertySetInfo >, StaticDataSeriesInfo > +void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap ) { - uno::Reference< beans::XPropertySetInfo > operator()() - { - return ::cppu::OPropertySetHelper::createPropertySetInfo(StaticDataSeriesInfoHelper::get() ); - } -}; + ::chart::DataSeriesProperties::AddDefaultsToMap( rOutMap ); + ::chart::CharacterProperties::AddDefaultsToMap( rOutMap ); + float fDefaultCharHeight = 10.0; + ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight ); + ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight ); + ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight ); +} void lcl_SetParent( const uno::Reference< uno::XInterface > & xChildInterface, @@ -125,6 +109,32 @@ void lcl_CloneAttributedDataPoints( namespace chart { +namespace dataSeries +{ + +::cppu::OPropertyArrayHelper* StaticDataSeriesInfoHelper_Initializer::operator()() +{ + static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() ); + return &aPropHelper; +} + + +uno::Reference< beans::XPropertySetInfo >* StaticDataSeriesInfo_Initializer::operator()() +{ + static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo( + ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticDataSeriesInfoHelper::get() ) ); + return &xPropertySetInfo; +} + +::chart::tPropertyValueMap* StaticDataSeriesDefaults_Initializer::operator()() +{ + static ::chart::tPropertyValueMap aStaticDefaults; + lcl_AddDefaultsToMap( aStaticDefaults ); + return &aStaticDefaults; +} + +} + DataSeries::DataSeries() : ::property::OPropertySet( m_aMutex ), m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) @@ -233,7 +243,7 @@ uno::Reference< util::XCloneable > SAL_CALL DataSeries::createClone() // ____ OPropertySet ____ uno::Any DataSeries::GetDefaultValue( sal_Int32 nHandle ) const { - const tPropertyValueMap& rStaticDefaults = StaticDataSeriesDefaults::get(); + const tPropertyValueMap& rStaticDefaults = *dataSeries::StaticDataSeriesDefaults::get(); tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) ); if( aFound == rStaticDefaults.end() ) return uno::Any(); @@ -243,13 +253,13 @@ uno::Any DataSeries::GetDefaultValue( sal_Int32 nHandle ) const // ____ OPropertySet ____ ::cppu::IPropertyArrayHelper & SAL_CALL DataSeries::getInfoHelper() { - return StaticDataSeriesInfoHelper::get(); + return *dataSeries::StaticDataSeriesInfoHelper::get(); } // ____ XPropertySet ____ uno::Reference< beans::XPropertySetInfo > SAL_CALL DataSeries::getPropertySetInfo() { - return StaticDataSeriesInfo::get(); + return *dataSeries::StaticDataSeriesInfo::get(); } void SAL_CALL DataSeries::getFastPropertyValue diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index 0b9efc80f794..9b2d280b6109 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -179,76 +179,34 @@ void lcl_AddPropertiesToVector( beans::PropertyAttribute::MAYBEVOID ); } -struct StaticDiagramDefaults_Initializer +static Sequence< Property > lcl_GetPropertySequence() { - ::chart::tPropertyValueMap* operator()() - { - static ::chart::tPropertyValueMap aStaticDefaults; - lcl_AddDefaultsToMap( aStaticDefaults ); - return &aStaticDefaults; - } -private: - static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap ) - { - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_POSSIZE_EXCLUDE_LABELS, true ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_SORT_BY_X_VALUES, false ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_CONNECT_BARS, false ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_GROUP_BARS_PER_AXIS, true ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS, true ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_RIGHT_ANGLED_AXES, false ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_DATATABLEHBORDER, false ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_DATATABLEVBORDER, false ); ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits