tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / chart2 / source / inc / RegressionCurveModel.hxx
blobddd75a8391a124f980bd600d96a0b5a72da5b503
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 "OPropertySet.hxx"
23 #include <cppuhelper/implbase.hxx>
24 #include <comphelper/uno3.hxx>
25 #include <sal/types.h>
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 "ModifyListenerHelper.hxx"
34 namespace chart
37 namespace impl
39 typedef ::cppu::WeakImplHelper<
40 css::lang::XServiceInfo,
41 css::lang::XServiceName,
42 css::chart2::XRegressionCurve,
43 css::util::XCloneable,
44 css::util::XModifyBroadcaster,
45 css::util::XModifyListener >
46 RegressionCurveModel_Base;
49 class SAL_DLLPUBLIC_RTTI RegressionCurveModel :
50 public impl::RegressionCurveModel_Base,
51 public ::property::OPropertySet
53 public:
54 enum tCurveType
56 CURVE_TYPE_MEAN_VALUE,
57 CURVE_TYPE_LINEAR,
58 CURVE_TYPE_LOGARITHM,
59 CURVE_TYPE_EXPONENTIAL,
60 CURVE_TYPE_POWER,
61 CURVE_TYPE_POLYNOMIAL,
62 CURVE_TYPE_MOVING_AVERAGE
65 RegressionCurveModel( tCurveType eCurveType );
66 RegressionCurveModel( const RegressionCurveModel & rOther );
67 virtual ~RegressionCurveModel() override;
69 /// merge XInterface implementations
70 DECLARE_XINTERFACE()
71 /// merge XTypeProvider implementations
72 DECLARE_XTYPEPROVIDER()
74 protected:
75 // ____ OPropertySet ____
76 virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) const override;
78 // ____ OPropertySet ____
79 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
81 // ____ XPropertySet ____
82 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
83 getPropertySetInfo() override;
85 public:
86 // ____ XRegressionCurve ____
87 virtual css::uno::Reference< css::chart2::XRegressionCurveCalculator > SAL_CALL getCalculator() override;
88 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getEquationProperties() override;
89 virtual void SAL_CALL setEquationProperties(
90 const css::uno::Reference< css::beans::XPropertySet >& xEquationProperties ) override;
92 // ____ XServiceName ____
93 virtual OUString SAL_CALL getServiceName() override;
95 // ____ XModifyBroadcaster ____
96 virtual void SAL_CALL addModifyListener(
97 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
98 virtual void SAL_CALL removeModifyListener(
99 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
101 protected:
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 rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder;
121 css::uno::Reference< css::beans::XPropertySet > m_xEquationProperties;
122 void setPropertyMayHaveR2();
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 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */