nss: upgrade to release 3.73
[LibreOffice.git] / chart2 / source / tools / RegressionCurveModel.hxx
blobc20e773601a4c5a4663eb2cfba7668c0cb1fe7e6
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 #pragma once
21 #include <MutexContainer.hxx>
22 #include <OPropertySet.hxx>
24 #include <cppuhelper/implbase.hxx>
25 #include <comphelper/uno3.hxx>
27 #include <com/sun/star/chart2/XRegressionCurve.hpp>
29 #include <com/sun/star/lang/XServiceInfo.hpp>
30 #include <com/sun/star/lang/XServiceName.hpp>
31 #include <com/sun/star/util/XCloneable.hpp>
32 #include <com/sun/star/util/XModifyBroadcaster.hpp>
33 #include <com/sun/star/util/XModifyListener.hpp>
35 namespace chart
38 namespace impl
40 typedef ::cppu::WeakImplHelper<
41 css::lang::XServiceInfo,
42 css::lang::XServiceName,
43 css::chart2::XRegressionCurve,
44 css::util::XCloneable,
45 css::util::XModifyBroadcaster,
46 css::util::XModifyListener >
47 RegressionCurveModel_Base;
50 class RegressionCurveModel :
51 public MutexContainer,
52 public impl::RegressionCurveModel_Base,
53 public ::property::OPropertySet
55 public:
56 enum tCurveType
58 CURVE_TYPE_MEAN_VALUE,
59 CURVE_TYPE_LINEAR,
60 CURVE_TYPE_LOGARITHM,
61 CURVE_TYPE_EXPONENTIAL,
62 CURVE_TYPE_POWER,
63 CURVE_TYPE_POLYNOMIAL,
64 CURVE_TYPE_MOVING_AVERAGE
67 RegressionCurveModel( tCurveType eCurveType );
68 RegressionCurveModel( const RegressionCurveModel & rOther );
69 virtual ~RegressionCurveModel() override;
71 /// merge XInterface implementations
72 DECLARE_XINTERFACE()
73 /// merge XTypeProvider implementations
74 DECLARE_XTYPEPROVIDER()
76 protected:
77 // ____ OPropertySet ____
78 virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const override;
80 // ____ OPropertySet ____
81 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
83 // ____ XPropertySet ____
84 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
85 getPropertySetInfo() override;
87 // ____ XRegressionCurve ____
88 virtual css::uno::Reference< css::chart2::XRegressionCurveCalculator > SAL_CALL getCalculator() override;
89 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getEquationProperties() override;
90 virtual void SAL_CALL setEquationProperties(
91 const css::uno::Reference< css::beans::XPropertySet >& xEquationProperties ) override;
93 // ____ XServiceName ____
94 virtual OUString SAL_CALL getServiceName() override;
96 // ____ XModifyBroadcaster ____
97 virtual void SAL_CALL addModifyListener(
98 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
99 virtual void SAL_CALL removeModifyListener(
100 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
102 // ____ XModifyListener ____
103 virtual void SAL_CALL modified(
104 const css::lang::EventObject& aEvent ) override;
106 // ____ XEventListener (base of XModifyListener) ____
107 virtual void SAL_CALL disposing(
108 const css::lang::EventObject& Source ) override;
110 using ::cppu::OPropertySetHelper::disposing;
112 // ____ OPropertySet ____
113 virtual void firePropertyChangeEvent() override;
115 void fireModifyEvent();
117 private:
118 const tCurveType m_eRegressionCurveType;
120 css::uno::Reference< css::util::XModifyListener > m_xModifyEventForwarder;
121 css::uno::Reference< css::beans::XPropertySet > m_xEquationProperties;
124 // implementations for factory instantiation
126 class MeanValueRegressionCurve : public RegressionCurveModel
128 public:
129 explicit MeanValueRegressionCurve();
130 explicit MeanValueRegressionCurve(
131 const MeanValueRegressionCurve & rOther );
132 virtual ~MeanValueRegressionCurve() override;
134 // ____ XCloneable ____
135 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
137 /// XServiceInfo declarations
138 virtual OUString SAL_CALL getImplementationName() override;
139 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
140 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
143 class LinearRegressionCurve : public RegressionCurveModel
145 public:
146 explicit LinearRegressionCurve();
147 explicit LinearRegressionCurve( const LinearRegressionCurve & rOther );
148 virtual ~LinearRegressionCurve() override;
150 // ____ XCloneable ____
151 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
153 /// XServiceInfo declarations
154 virtual OUString SAL_CALL getImplementationName() override;
155 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
156 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
159 class LogarithmicRegressionCurve : public RegressionCurveModel
161 public:
162 explicit LogarithmicRegressionCurve();
163 explicit LogarithmicRegressionCurve( const LogarithmicRegressionCurve & rOther );
164 virtual ~LogarithmicRegressionCurve() override;
166 // ____ XCloneable ____
167 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
169 /// XServiceInfo declarations
170 virtual OUString SAL_CALL getImplementationName() override;
171 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
172 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
175 class ExponentialRegressionCurve : public RegressionCurveModel
177 public:
178 explicit ExponentialRegressionCurve();
179 explicit ExponentialRegressionCurve( const ExponentialRegressionCurve & rOther );
180 virtual ~ExponentialRegressionCurve() override;
182 // ____ XCloneable ____
183 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
185 /// XServiceInfo declarations
186 virtual OUString SAL_CALL getImplementationName() override;
187 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
188 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
191 class PotentialRegressionCurve : public RegressionCurveModel
193 public:
194 explicit PotentialRegressionCurve();
195 explicit PotentialRegressionCurve( const PotentialRegressionCurve & rOther );
196 virtual ~PotentialRegressionCurve() override;
198 // ____ XCloneable ____
199 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
201 /// XServiceInfo declarations
202 virtual OUString SAL_CALL getImplementationName() override;
203 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
204 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
207 class PolynomialRegressionCurve : public RegressionCurveModel
209 public:
210 explicit PolynomialRegressionCurve();
211 explicit PolynomialRegressionCurve( const PolynomialRegressionCurve & rOther );
212 virtual ~PolynomialRegressionCurve() override;
214 // ____ XCloneable ____
215 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
217 /// XServiceInfo declarations
218 virtual OUString SAL_CALL getImplementationName() override;
219 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
220 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
223 class MovingAverageRegressionCurve : public RegressionCurveModel
225 public:
226 explicit MovingAverageRegressionCurve();
227 explicit MovingAverageRegressionCurve( const MovingAverageRegressionCurve & rOther );
228 virtual ~MovingAverageRegressionCurve() override;
230 // ____ XCloneable ____
231 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
233 /// XServiceInfo declarations
234 virtual OUString SAL_CALL getImplementationName() override;
235 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
236 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
239 } // namespace chart
241 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */