merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / tools / RegressionCurveModel.hxx
blob82098a76e45a7ee3c534d12f028df33ef5ff0586
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef CHART2_REGRESSIONCURVEMODEL_HXX
28 #define CHART2_REGRESSIONCURVEMODEL_HXX
30 #include "MutexContainer.hxx"
31 #include "OPropertySet.hxx"
32 #include "ServiceMacros.hxx"
33 #include "ModifyListenerHelper.hxx"
35 #include <cppuhelper/implbase6.hxx>
36 #include <comphelper/uno3.hxx>
38 #include <com/sun/star/chart2/XRegressionCurve.hpp>
40 #include <com/sun/star/uno/XComponentContext.hpp>
41 #include <com/sun/star/lang/XServiceInfo.hpp>
42 #include <com/sun/star/lang/XServiceName.hpp>
43 #include <com/sun/star/util/XCloneable.hpp>
45 namespace chart
48 namespace impl
50 typedef ::cppu::WeakImplHelper6<
51 ::com::sun::star::lang::XServiceInfo,
52 ::com::sun::star::lang::XServiceName,
53 ::com::sun::star::chart2::XRegressionCurve,
54 ::com::sun::star::util::XCloneable,
55 ::com::sun::star::util::XModifyBroadcaster,
56 ::com::sun::star::util::XModifyListener >
57 RegressionCurveModel_Base;
60 class RegressionCurveModel :
61 public MutexContainer,
62 public impl::RegressionCurveModel_Base,
63 public ::property::OPropertySet
65 public:
66 enum tCurveType
68 CURVE_TYPE_MEAN_VALUE,
69 CURVE_TYPE_LINEAR,
70 CURVE_TYPE_LOGARITHM,
71 CURVE_TYPE_EXPONENTIAL,
72 CURVE_TYPE_POWER
75 RegressionCurveModel( ::com::sun::star::uno::Reference<
76 ::com::sun::star::uno::XComponentContext > const & xContext,
77 tCurveType eCurveType );
78 RegressionCurveModel( const RegressionCurveModel & rOther );
79 virtual ~RegressionCurveModel();
81 /// merge XInterface implementations
82 DECLARE_XINTERFACE()
83 /// merge XTypeProvider implementations
84 DECLARE_XTYPEPROVIDER()
86 protected:
87 // ____ OPropertySet ____
88 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
89 throw(::com::sun::star::beans::UnknownPropertyException);
91 // ____ OPropertySet ____
92 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
94 // ____ XPropertySet ____
95 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
96 getPropertySetInfo()
97 throw (::com::sun::star::uno::RuntimeException);
99 // ____ XRegressionCurve ____
100 virtual ::com::sun::star::uno::Reference<
101 ::com::sun::star::chart2::XRegressionCurveCalculator > SAL_CALL getCalculator()
102 throw (::com::sun::star::uno::RuntimeException);
103 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getEquationProperties()
104 throw (::com::sun::star::uno::RuntimeException);
105 virtual void SAL_CALL setEquationProperties(
106 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xEquationProperties )
107 throw (::com::sun::star::uno::RuntimeException);
109 // ____ XServiceName ____
110 virtual ::rtl::OUString SAL_CALL getServiceName()
111 throw (::com::sun::star::uno::RuntimeException);
113 // ____ XCloneable ____
114 // not implemented here
115 // virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
116 // throw (::com::sun::star::uno::RuntimeException);
118 // ____ XModifyBroadcaster ____
119 virtual void SAL_CALL addModifyListener(
120 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
121 throw (::com::sun::star::uno::RuntimeException);
122 virtual void SAL_CALL removeModifyListener(
123 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
124 throw (::com::sun::star::uno::RuntimeException);
126 // ____ XModifyListener ____
127 virtual void SAL_CALL modified(
128 const ::com::sun::star::lang::EventObject& aEvent )
129 throw (::com::sun::star::uno::RuntimeException);
131 // ____ XEventListener (base of XModifyListener) ____
132 virtual void SAL_CALL disposing(
133 const ::com::sun::star::lang::EventObject& Source )
134 throw (::com::sun::star::uno::RuntimeException);
136 using ::cppu::OPropertySetHelper::disposing;
138 // ____ OPropertySet ____
139 virtual void firePropertyChangeEvent();
141 void fireModifyEvent();
143 private:
144 ::com::sun::star::uno::Reference<
145 ::com::sun::star::uno::XComponentContext >
146 m_xContext;
148 const tCurveType m_eRegressionCurveType;
150 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
151 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xEquationProperties;
154 // implementations for factory instantiation
156 class MeanValueRegressionCurve : public RegressionCurveModel
158 public:
159 explicit MeanValueRegressionCurve(
160 const ::com::sun::star::uno::Reference<
161 ::com::sun::star::uno::XComponentContext > & xContext );
162 explicit MeanValueRegressionCurve(
163 const MeanValueRegressionCurve & rOther );
164 virtual ~MeanValueRegressionCurve();
166 // ____ XCloneable ____
167 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
168 throw (::com::sun::star::uno::RuntimeException);
170 /// XServiceInfo declarations
171 APPHELPER_XSERVICEINFO_DECL()
172 /// establish methods for factory instatiation
173 APPHELPER_SERVICE_FACTORY_HELPER( MeanValueRegressionCurve )
176 class LinearRegressionCurve : public RegressionCurveModel
178 public:
179 explicit LinearRegressionCurve(
180 const ::com::sun::star::uno::Reference<
181 ::com::sun::star::uno::XComponentContext > & xContext );
182 explicit LinearRegressionCurve(
183 const LinearRegressionCurve & rOther );
184 virtual ~LinearRegressionCurve();
186 // ____ XCloneable ____
187 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
188 throw (::com::sun::star::uno::RuntimeException);
190 /// XServiceInfo declarations
191 APPHELPER_XSERVICEINFO_DECL()
192 /// establish methods for factory instatiation
193 APPHELPER_SERVICE_FACTORY_HELPER( LinearRegressionCurve )
196 class LogarithmicRegressionCurve : public RegressionCurveModel
198 public:
199 explicit LogarithmicRegressionCurve(
200 const ::com::sun::star::uno::Reference<
201 ::com::sun::star::uno::XComponentContext > & xContext );
202 explicit LogarithmicRegressionCurve(
203 const LogarithmicRegressionCurve & rOther );
204 virtual ~LogarithmicRegressionCurve();
206 // ____ XCloneable ____
207 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
208 throw (::com::sun::star::uno::RuntimeException);
210 /// XServiceInfo declarations
211 APPHELPER_XSERVICEINFO_DECL()
212 /// establish methods for factory instatiation
213 APPHELPER_SERVICE_FACTORY_HELPER( LogarithmicRegressionCurve )
216 class ExponentialRegressionCurve : public RegressionCurveModel
218 public:
219 explicit ExponentialRegressionCurve(
220 const ::com::sun::star::uno::Reference<
221 ::com::sun::star::uno::XComponentContext > & xContext );
222 explicit ExponentialRegressionCurve(
223 const ExponentialRegressionCurve & rOther );
224 virtual ~ExponentialRegressionCurve();
226 // ____ XCloneable ____
227 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
228 throw (::com::sun::star::uno::RuntimeException);
230 /// XServiceInfo declarations
231 APPHELPER_XSERVICEINFO_DECL()
232 /// establish methods for factory instatiation
233 APPHELPER_SERVICE_FACTORY_HELPER( ExponentialRegressionCurve )
236 class PotentialRegressionCurve : public RegressionCurveModel
238 public:
239 explicit PotentialRegressionCurve(
240 const ::com::sun::star::uno::Reference<
241 ::com::sun::star::uno::XComponentContext > & xContext );
242 explicit PotentialRegressionCurve(
243 const PotentialRegressionCurve & rOther );
244 virtual ~PotentialRegressionCurve();
246 // ____ XCloneable ____
247 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
248 throw (::com::sun::star::uno::RuntimeException);
250 /// XServiceInfo declarations
251 APPHELPER_XSERVICEINFO_DECL()
252 /// establish methods for factory instatiation
253 APPHELPER_SERVICE_FACTORY_HELPER( PotentialRegressionCurve )
256 } // namespace chart
258 // CHART2_REGRESSIONCURVEMODEL_HXX
259 #endif