1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: RegressionCurveModel.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef CHART2_REGRESSIONCURVEMODEL_HXX
31 #define CHART2_REGRESSIONCURVEMODEL_HXX
33 #include "MutexContainer.hxx"
34 #include "OPropertySet.hxx"
35 #include "ServiceMacros.hxx"
36 #include "ModifyListenerHelper.hxx"
38 #include <cppuhelper/implbase6.hxx>
39 #include <comphelper/uno3.hxx>
41 #include <com/sun/star/chart2/XRegressionCurve.hpp>
43 #include <com/sun/star/uno/XComponentContext.hpp>
44 #include <com/sun/star/lang/XServiceInfo.hpp>
45 #include <com/sun/star/lang/XServiceName.hpp>
46 #include <com/sun/star/util/XCloneable.hpp>
53 typedef ::cppu::WeakImplHelper6
<
54 ::com::sun::star::lang::XServiceInfo
,
55 ::com::sun::star::lang::XServiceName
,
56 ::com::sun::star::chart2::XRegressionCurve
,
57 ::com::sun::star::util::XCloneable
,
58 ::com::sun::star::util::XModifyBroadcaster
,
59 ::com::sun::star::util::XModifyListener
>
60 RegressionCurveModel_Base
;
63 class RegressionCurveModel
:
64 public MutexContainer
,
65 public impl::RegressionCurveModel_Base
,
66 public ::property::OPropertySet
71 CURVE_TYPE_MEAN_VALUE
,
74 CURVE_TYPE_EXPONENTIAL
,
78 RegressionCurveModel( ::com::sun::star::uno::Reference
<
79 ::com::sun::star::uno::XComponentContext
> const & xContext
,
80 tCurveType eCurveType
);
81 RegressionCurveModel( const RegressionCurveModel
& rOther
);
82 virtual ~RegressionCurveModel();
84 /// merge XInterface implementations
86 /// merge XTypeProvider implementations
87 DECLARE_XTYPEPROVIDER()
90 // ____ OPropertySet ____
91 virtual ::com::sun::star::uno::Any
GetDefaultValue( sal_Int32 nHandle
) const
92 throw(::com::sun::star::beans::UnknownPropertyException
);
94 // ____ OPropertySet ____
95 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
97 // ____ XPropertySet ____
98 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
100 throw (::com::sun::star::uno::RuntimeException
);
102 // ____ XRegressionCurve ____
103 virtual ::com::sun::star::uno::Reference
<
104 ::com::sun::star::chart2::XRegressionCurveCalculator
> SAL_CALL
getCalculator()
105 throw (::com::sun::star::uno::RuntimeException
);
106 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getEquationProperties()
107 throw (::com::sun::star::uno::RuntimeException
);
108 virtual void SAL_CALL
setEquationProperties(
109 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xEquationProperties
)
110 throw (::com::sun::star::uno::RuntimeException
);
112 // ____ XServiceName ____
113 virtual ::rtl::OUString SAL_CALL
getServiceName()
114 throw (::com::sun::star::uno::RuntimeException
);
116 // ____ XCloneable ____
117 // not implemented here
118 // virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
119 // throw (::com::sun::star::uno::RuntimeException);
121 // ____ XModifyBroadcaster ____
122 virtual void SAL_CALL
addModifyListener(
123 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
124 throw (::com::sun::star::uno::RuntimeException
);
125 virtual void SAL_CALL
removeModifyListener(
126 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
127 throw (::com::sun::star::uno::RuntimeException
);
129 // ____ XModifyListener ____
130 virtual void SAL_CALL
modified(
131 const ::com::sun::star::lang::EventObject
& aEvent
)
132 throw (::com::sun::star::uno::RuntimeException
);
134 // ____ XEventListener (base of XModifyListener) ____
135 virtual void SAL_CALL
disposing(
136 const ::com::sun::star::lang::EventObject
& Source
)
137 throw (::com::sun::star::uno::RuntimeException
);
139 using ::cppu::OPropertySetHelper::disposing
;
141 // ____ OPropertySet ____
142 virtual void firePropertyChangeEvent();
144 void fireModifyEvent();
147 ::com::sun::star::uno::Reference
<
148 ::com::sun::star::uno::XComponentContext
>
151 const tCurveType m_eRegressionCurveType
;
153 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
> m_xModifyEventForwarder
;
154 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> m_xEquationProperties
;
157 // implementations for factory instantiation
159 class MeanValueRegressionCurve
: public RegressionCurveModel
162 explicit MeanValueRegressionCurve(
163 const ::com::sun::star::uno::Reference
<
164 ::com::sun::star::uno::XComponentContext
> & xContext
);
165 explicit MeanValueRegressionCurve(
166 const MeanValueRegressionCurve
& rOther
);
167 virtual ~MeanValueRegressionCurve();
169 // ____ XCloneable ____
170 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
171 throw (::com::sun::star::uno::RuntimeException
);
173 /// XServiceInfo declarations
174 APPHELPER_XSERVICEINFO_DECL()
175 /// establish methods for factory instatiation
176 APPHELPER_SERVICE_FACTORY_HELPER( MeanValueRegressionCurve
)
179 class LinearRegressionCurve
: public RegressionCurveModel
182 explicit LinearRegressionCurve(
183 const ::com::sun::star::uno::Reference
<
184 ::com::sun::star::uno::XComponentContext
> & xContext
);
185 explicit LinearRegressionCurve(
186 const LinearRegressionCurve
& rOther
);
187 virtual ~LinearRegressionCurve();
189 // ____ XCloneable ____
190 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
191 throw (::com::sun::star::uno::RuntimeException
);
193 /// XServiceInfo declarations
194 APPHELPER_XSERVICEINFO_DECL()
195 /// establish methods for factory instatiation
196 APPHELPER_SERVICE_FACTORY_HELPER( LinearRegressionCurve
)
199 class LogarithmicRegressionCurve
: public RegressionCurveModel
202 explicit LogarithmicRegressionCurve(
203 const ::com::sun::star::uno::Reference
<
204 ::com::sun::star::uno::XComponentContext
> & xContext
);
205 explicit LogarithmicRegressionCurve(
206 const LogarithmicRegressionCurve
& rOther
);
207 virtual ~LogarithmicRegressionCurve();
209 // ____ XCloneable ____
210 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
211 throw (::com::sun::star::uno::RuntimeException
);
213 /// XServiceInfo declarations
214 APPHELPER_XSERVICEINFO_DECL()
215 /// establish methods for factory instatiation
216 APPHELPER_SERVICE_FACTORY_HELPER( LogarithmicRegressionCurve
)
219 class ExponentialRegressionCurve
: public RegressionCurveModel
222 explicit ExponentialRegressionCurve(
223 const ::com::sun::star::uno::Reference
<
224 ::com::sun::star::uno::XComponentContext
> & xContext
);
225 explicit ExponentialRegressionCurve(
226 const ExponentialRegressionCurve
& rOther
);
227 virtual ~ExponentialRegressionCurve();
229 // ____ XCloneable ____
230 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
231 throw (::com::sun::star::uno::RuntimeException
);
233 /// XServiceInfo declarations
234 APPHELPER_XSERVICEINFO_DECL()
235 /// establish methods for factory instatiation
236 APPHELPER_SERVICE_FACTORY_HELPER( ExponentialRegressionCurve
)
239 class PotentialRegressionCurve
: public RegressionCurveModel
242 explicit PotentialRegressionCurve(
243 const ::com::sun::star::uno::Reference
<
244 ::com::sun::star::uno::XComponentContext
> & xContext
);
245 explicit PotentialRegressionCurve(
246 const PotentialRegressionCurve
& rOther
);
247 virtual ~PotentialRegressionCurve();
249 // ____ XCloneable ____
250 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
251 throw (::com::sun::star::uno::RuntimeException
);
253 /// XServiceInfo declarations
254 APPHELPER_XSERVICEINFO_DECL()
255 /// establish methods for factory instatiation
256 APPHELPER_SERVICE_FACTORY_HELPER( PotentialRegressionCurve
)
261 // CHART2_REGRESSIONCURVEMODEL_HXX