Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / chart2 / source / tools / RegressionCurveModel.hxx
blob05257e2dc950158ec9ebbec094956380a4a6693c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_CHART2_SOURCE_TOOLS_REGRESSIONCURVEMODEL_HXX
20 #define INCLUDED_CHART2_SOURCE_TOOLS_REGRESSIONCURVEMODEL_HXX
22 #include <MutexContainer.hxx>
23 #include <OPropertySet.hxx>
25 #include <cppuhelper/implbase.hxx>
26 #include <comphelper/uno3.hxx>
28 #include <com/sun/star/chart2/XRegressionCurve.hpp>
30 #include <com/sun/star/lang/XServiceInfo.hpp>
31 #include <com/sun/star/lang/XServiceName.hpp>
32 #include <com/sun/star/util/XCloneable.hpp>
33 #include <com/sun/star/util/XModifyBroadcaster.hpp>
34 #include <com/sun/star/util/XModifyListener.hpp>
36 namespace chart
39 namespace impl
41 typedef ::cppu::WeakImplHelper<
42 css::lang::XServiceInfo,
43 css::lang::XServiceName,
44 css::chart2::XRegressionCurve,
45 css::util::XCloneable,
46 css::util::XModifyBroadcaster,
47 css::util::XModifyListener >
48 RegressionCurveModel_Base;
51 class RegressionCurveModel :
52 public MutexContainer,
53 public impl::RegressionCurveModel_Base,
54 public ::property::OPropertySet
56 public:
57 enum tCurveType
59 CURVE_TYPE_MEAN_VALUE,
60 CURVE_TYPE_LINEAR,
61 CURVE_TYPE_LOGARITHM,
62 CURVE_TYPE_EXPONENTIAL,
63 CURVE_TYPE_POWER,
64 CURVE_TYPE_POLYNOMIAL,
65 CURVE_TYPE_MOVING_AVERAGE
68 RegressionCurveModel( tCurveType eCurveType );
69 RegressionCurveModel( const RegressionCurveModel & rOther );
70 virtual ~RegressionCurveModel() override;
72 /// merge XInterface implementations
73 DECLARE_XINTERFACE()
74 /// merge XTypeProvider implementations
75 DECLARE_XTYPEPROVIDER()
77 protected:
78 // ____ OPropertySet ____
79 virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const override;
81 // ____ OPropertySet ____
82 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
84 // ____ XPropertySet ____
85 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
86 getPropertySetInfo() override;
88 // ____ XRegressionCurve ____
89 virtual css::uno::Reference< css::chart2::XRegressionCurveCalculator > SAL_CALL getCalculator() override;
90 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getEquationProperties() override;
91 virtual void SAL_CALL setEquationProperties(
92 const css::uno::Reference< css::beans::XPropertySet >& xEquationProperties ) override;
94 // ____ XServiceName ____
95 virtual OUString SAL_CALL getServiceName() override;
97 // ____ XModifyBroadcaster ____
98 virtual void SAL_CALL addModifyListener(
99 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
100 virtual void SAL_CALL removeModifyListener(
101 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
103 // ____ XModifyListener ____
104 virtual void SAL_CALL modified(
105 const css::lang::EventObject& aEvent ) override;
107 // ____ XEventListener (base of XModifyListener) ____
108 virtual void SAL_CALL disposing(
109 const css::lang::EventObject& Source ) override;
111 using ::cppu::OPropertySetHelper::disposing;
113 // ____ OPropertySet ____
114 virtual void firePropertyChangeEvent() override;
116 void fireModifyEvent();
118 private:
119 const tCurveType m_eRegressionCurveType;
121 css::uno::Reference< css::util::XModifyListener > m_xModifyEventForwarder;
122 css::uno::Reference< css::beans::XPropertySet > m_xEquationProperties;
125 // implementations for factory instantiation
127 class MeanValueRegressionCurve : public RegressionCurveModel
129 public:
130 explicit MeanValueRegressionCurve();
131 explicit MeanValueRegressionCurve(
132 const MeanValueRegressionCurve & rOther );
133 virtual ~MeanValueRegressionCurve() override;
135 // ____ XCloneable ____
136 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
138 /// XServiceInfo declarations
139 virtual OUString SAL_CALL getImplementationName() override;
140 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
141 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
144 class LinearRegressionCurve : public RegressionCurveModel
146 public:
147 explicit LinearRegressionCurve();
148 explicit LinearRegressionCurve( const LinearRegressionCurve & rOther );
149 virtual ~LinearRegressionCurve() override;
151 // ____ XCloneable ____
152 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
154 /// XServiceInfo declarations
155 virtual OUString SAL_CALL getImplementationName() override;
156 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
157 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
160 class LogarithmicRegressionCurve : public RegressionCurveModel
162 public:
163 explicit LogarithmicRegressionCurve();
164 explicit LogarithmicRegressionCurve( const LogarithmicRegressionCurve & rOther );
165 virtual ~LogarithmicRegressionCurve() override;
167 // ____ XCloneable ____
168 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
170 /// XServiceInfo declarations
171 virtual OUString SAL_CALL getImplementationName() override;
172 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
173 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
176 class ExponentialRegressionCurve : public RegressionCurveModel
178 public:
179 explicit ExponentialRegressionCurve();
180 explicit ExponentialRegressionCurve( const ExponentialRegressionCurve & rOther );
181 virtual ~ExponentialRegressionCurve() override;
183 // ____ XCloneable ____
184 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
186 /// XServiceInfo declarations
187 virtual OUString SAL_CALL getImplementationName() override;
188 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
189 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
192 class PotentialRegressionCurve : public RegressionCurveModel
194 public:
195 explicit PotentialRegressionCurve();
196 explicit PotentialRegressionCurve( const PotentialRegressionCurve & rOther );
197 virtual ~PotentialRegressionCurve() override;
199 // ____ XCloneable ____
200 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
202 /// XServiceInfo declarations
203 virtual OUString SAL_CALL getImplementationName() override;
204 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
205 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
208 class PolynomialRegressionCurve : public RegressionCurveModel
210 public:
211 explicit PolynomialRegressionCurve();
212 explicit PolynomialRegressionCurve( const PolynomialRegressionCurve & rOther );
213 virtual ~PolynomialRegressionCurve() override;
215 // ____ XCloneable ____
216 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
218 /// XServiceInfo declarations
219 virtual OUString SAL_CALL getImplementationName() override;
220 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
221 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
224 class MovingAverageRegressionCurve : public RegressionCurveModel
226 public:
227 explicit MovingAverageRegressionCurve();
228 explicit MovingAverageRegressionCurve( const MovingAverageRegressionCurve & rOther );
229 virtual ~MovingAverageRegressionCurve() override;
231 // ____ XCloneable ____
232 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
234 /// XServiceInfo declarations
235 virtual OUString SAL_CALL getImplementationName() override;
236 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
237 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
240 } // namespace chart
242 // INCLUDED_CHART2_SOURCE_TOOLS_REGRESSIONCURVEMODEL_HXX
243 #endif
245 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */