1*b1cdbd2cSJim Jagielski /**************************************************************
2*b1cdbd2cSJim Jagielski *
3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file
5*b1cdbd2cSJim Jagielski * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file
7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski *
11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski *
13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the
17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski * under the License.
19*b1cdbd2cSJim Jagielski *
20*b1cdbd2cSJim Jagielski *************************************************************/
21*b1cdbd2cSJim Jagielski
22*b1cdbd2cSJim Jagielski
23*b1cdbd2cSJim Jagielski
24*b1cdbd2cSJim Jagielski // MARKER(update_precomp.py): autogen include statement, do not remove
25*b1cdbd2cSJim Jagielski #include "precompiled_chart2.hxx"
26*b1cdbd2cSJim Jagielski #include "RegressionCurveModel.hxx"
27*b1cdbd2cSJim Jagielski #include "macros.hxx"
28*b1cdbd2cSJim Jagielski #include "LineProperties.hxx"
29*b1cdbd2cSJim Jagielski #include "RegressionCurveHelper.hxx"
30*b1cdbd2cSJim Jagielski #include "RegressionCalculationHelper.hxx"
31*b1cdbd2cSJim Jagielski #include "RegressionEquation.hxx"
32*b1cdbd2cSJim Jagielski #include "ContainerHelper.hxx"
33*b1cdbd2cSJim Jagielski #include "CloneHelper.hxx"
34*b1cdbd2cSJim Jagielski #include "PropertyHelper.hxx"
35*b1cdbd2cSJim Jagielski #include <com/sun/star/beans/PropertyAttribute.hpp>
36*b1cdbd2cSJim Jagielski #include <rtl/math.hxx>
37*b1cdbd2cSJim Jagielski #include <rtl/ustrbuf.hxx>
38*b1cdbd2cSJim Jagielski
39*b1cdbd2cSJim Jagielski using namespace ::com::sun::star;
40*b1cdbd2cSJim Jagielski
41*b1cdbd2cSJim Jagielski using ::rtl::OUString;
42*b1cdbd2cSJim Jagielski using ::rtl::OUStringBuffer;
43*b1cdbd2cSJim Jagielski using ::com::sun::star::beans::Property;
44*b1cdbd2cSJim Jagielski using ::osl::MutexGuard;
45*b1cdbd2cSJim Jagielski
46*b1cdbd2cSJim Jagielski namespace
47*b1cdbd2cSJim Jagielski {
48*b1cdbd2cSJim Jagielski static const OUString lcl_aImplementationName_MeanValue(
49*b1cdbd2cSJim Jagielski RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.MeanValueRegressionCurve" ));
50*b1cdbd2cSJim Jagielski static const OUString lcl_aImplementationName_Linear(
51*b1cdbd2cSJim Jagielski RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.LinearRegressionCurve" ));
52*b1cdbd2cSJim Jagielski static const OUString lcl_aImplementationName_Logarithmic(
53*b1cdbd2cSJim Jagielski RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.LogarithmicRegressionCurve" ));
54*b1cdbd2cSJim Jagielski static const OUString lcl_aImplementationName_Exponential(
55*b1cdbd2cSJim Jagielski RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.ExponentialRegressionCurve" ));
56*b1cdbd2cSJim Jagielski static const OUString lcl_aImplementationName_Potential(
57*b1cdbd2cSJim Jagielski RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.PotentialRegressionCurve" ));
58*b1cdbd2cSJim Jagielski
59*b1cdbd2cSJim Jagielski static const OUString lcl_aServiceName(
60*b1cdbd2cSJim Jagielski RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.RegressionCurve" ));
61*b1cdbd2cSJim Jagielski
62*b1cdbd2cSJim Jagielski struct StaticXXXDefaults_Initializer
63*b1cdbd2cSJim Jagielski {
operator ()__anonef90daea0111::StaticXXXDefaults_Initializer64*b1cdbd2cSJim Jagielski ::chart::tPropertyValueMap* operator()()
65*b1cdbd2cSJim Jagielski {
66*b1cdbd2cSJim Jagielski static ::chart::tPropertyValueMap aStaticDefaults;
67*b1cdbd2cSJim Jagielski lcl_AddDefaultsToMap( aStaticDefaults );
68*b1cdbd2cSJim Jagielski return &aStaticDefaults;
69*b1cdbd2cSJim Jagielski }
70*b1cdbd2cSJim Jagielski private:
lcl_AddDefaultsToMap__anonef90daea0111::StaticXXXDefaults_Initializer71*b1cdbd2cSJim Jagielski void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
72*b1cdbd2cSJim Jagielski {
73*b1cdbd2cSJim Jagielski ::chart::LineProperties::AddDefaultsToMap( rOutMap );
74*b1cdbd2cSJim Jagielski }
75*b1cdbd2cSJim Jagielski };
76*b1cdbd2cSJim Jagielski
77*b1cdbd2cSJim Jagielski struct StaticXXXDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticXXXDefaults_Initializer >
78*b1cdbd2cSJim Jagielski {
79*b1cdbd2cSJim Jagielski };
80*b1cdbd2cSJim Jagielski
81*b1cdbd2cSJim Jagielski struct StaticRegressionCurveInfoHelper_Initializer
82*b1cdbd2cSJim Jagielski {
operator ()__anonef90daea0111::StaticRegressionCurveInfoHelper_Initializer83*b1cdbd2cSJim Jagielski ::cppu::OPropertyArrayHelper* operator()()
84*b1cdbd2cSJim Jagielski {
85*b1cdbd2cSJim Jagielski static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
86*b1cdbd2cSJim Jagielski return &aPropHelper;
87*b1cdbd2cSJim Jagielski }
88*b1cdbd2cSJim Jagielski
89*b1cdbd2cSJim Jagielski private:
lcl_GetPropertySequence__anonef90daea0111::StaticRegressionCurveInfoHelper_Initializer90*b1cdbd2cSJim Jagielski uno::Sequence< Property > lcl_GetPropertySequence()
91*b1cdbd2cSJim Jagielski {
92*b1cdbd2cSJim Jagielski ::std::vector< ::com::sun::star::beans::Property > aProperties;
93*b1cdbd2cSJim Jagielski ::chart::LineProperties::AddPropertiesToVector( aProperties );
94*b1cdbd2cSJim Jagielski
95*b1cdbd2cSJim Jagielski ::std::sort( aProperties.begin(), aProperties.end(),
96*b1cdbd2cSJim Jagielski ::chart::PropertyNameLess() );
97*b1cdbd2cSJim Jagielski
98*b1cdbd2cSJim Jagielski return ::chart::ContainerHelper::ContainerToSequence( aProperties );
99*b1cdbd2cSJim Jagielski }
100*b1cdbd2cSJim Jagielski };
101*b1cdbd2cSJim Jagielski
102*b1cdbd2cSJim Jagielski struct StaticRegressionCurveInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticRegressionCurveInfoHelper_Initializer >
103*b1cdbd2cSJim Jagielski {
104*b1cdbd2cSJim Jagielski };
105*b1cdbd2cSJim Jagielski
106*b1cdbd2cSJim Jagielski struct StaticRegressionCurveInfo_Initializer
107*b1cdbd2cSJim Jagielski {
operator ()__anonef90daea0111::StaticRegressionCurveInfo_Initializer108*b1cdbd2cSJim Jagielski uno::Reference< beans::XPropertySetInfo >* operator()()
109*b1cdbd2cSJim Jagielski {
110*b1cdbd2cSJim Jagielski static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
111*b1cdbd2cSJim Jagielski ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticRegressionCurveInfoHelper::get() ) );
112*b1cdbd2cSJim Jagielski return &xPropertySetInfo;
113*b1cdbd2cSJim Jagielski }
114*b1cdbd2cSJim Jagielski };
115*b1cdbd2cSJim Jagielski
116*b1cdbd2cSJim Jagielski struct StaticRegressionCurveInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticRegressionCurveInfo_Initializer >
117*b1cdbd2cSJim Jagielski {
118*b1cdbd2cSJim Jagielski };
119*b1cdbd2cSJim Jagielski
120*b1cdbd2cSJim Jagielski } // anonymous namespace
121*b1cdbd2cSJim Jagielski
122*b1cdbd2cSJim Jagielski namespace chart
123*b1cdbd2cSJim Jagielski {
124*b1cdbd2cSJim Jagielski
RegressionCurveModel(uno::Reference<uno::XComponentContext> const & xContext,tCurveType eCurveType)125*b1cdbd2cSJim Jagielski RegressionCurveModel::RegressionCurveModel(
126*b1cdbd2cSJim Jagielski uno::Reference< uno::XComponentContext > const & xContext,
127*b1cdbd2cSJim Jagielski tCurveType eCurveType ) :
128*b1cdbd2cSJim Jagielski ::property::OPropertySet( m_aMutex ),
129*b1cdbd2cSJim Jagielski m_xContext( xContext ),
130*b1cdbd2cSJim Jagielski m_eRegressionCurveType( eCurveType ),
131*b1cdbd2cSJim Jagielski m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()),
132*b1cdbd2cSJim Jagielski m_xEquationProperties( new RegressionEquation( xContext ))
133*b1cdbd2cSJim Jagielski {
134*b1cdbd2cSJim Jagielski // set 0 line width (default) hard, so that it is always written to XML,
135*b1cdbd2cSJim Jagielski // because the old implementation uses different defaults
136*b1cdbd2cSJim Jagielski setFastPropertyValue_NoBroadcast(
137*b1cdbd2cSJim Jagielski LineProperties::PROP_LINE_WIDTH, uno::makeAny( sal_Int32( 0 )));
138*b1cdbd2cSJim Jagielski ModifyListenerHelper::addListener( m_xEquationProperties, m_xModifyEventForwarder );
139*b1cdbd2cSJim Jagielski }
140*b1cdbd2cSJim Jagielski
RegressionCurveModel(const RegressionCurveModel & rOther)141*b1cdbd2cSJim Jagielski RegressionCurveModel::RegressionCurveModel( const RegressionCurveModel & rOther ) :
142*b1cdbd2cSJim Jagielski MutexContainer(),
143*b1cdbd2cSJim Jagielski impl::RegressionCurveModel_Base(),
144*b1cdbd2cSJim Jagielski ::property::OPropertySet( rOther, m_aMutex ),
145*b1cdbd2cSJim Jagielski m_xContext( rOther.m_xContext ),
146*b1cdbd2cSJim Jagielski m_eRegressionCurveType( rOther.m_eRegressionCurveType ),
147*b1cdbd2cSJim Jagielski m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
148*b1cdbd2cSJim Jagielski {
149*b1cdbd2cSJim Jagielski m_xEquationProperties.set( CloneHelper::CreateRefClone< uno::Reference< beans::XPropertySet > >()( rOther.m_xEquationProperties ));
150*b1cdbd2cSJim Jagielski ModifyListenerHelper::addListener( m_xEquationProperties, m_xModifyEventForwarder );
151*b1cdbd2cSJim Jagielski }
152*b1cdbd2cSJim Jagielski
~RegressionCurveModel()153*b1cdbd2cSJim Jagielski RegressionCurveModel::~RegressionCurveModel()
154*b1cdbd2cSJim Jagielski {}
155*b1cdbd2cSJim Jagielski
156*b1cdbd2cSJim Jagielski // ____ XRegressionCurve ____
157*b1cdbd2cSJim Jagielski uno::Reference< chart2::XRegressionCurveCalculator > SAL_CALL
getCalculator()158*b1cdbd2cSJim Jagielski RegressionCurveModel::getCalculator()
159*b1cdbd2cSJim Jagielski throw (uno::RuntimeException)
160*b1cdbd2cSJim Jagielski {
161*b1cdbd2cSJim Jagielski return RegressionCurveHelper::createRegressionCurveCalculatorByServiceName( getServiceName());
162*b1cdbd2cSJim Jagielski }
163*b1cdbd2cSJim Jagielski
getEquationProperties()164*b1cdbd2cSJim Jagielski uno::Reference< beans::XPropertySet > SAL_CALL RegressionCurveModel::getEquationProperties()
165*b1cdbd2cSJim Jagielski throw (uno::RuntimeException)
166*b1cdbd2cSJim Jagielski {
167*b1cdbd2cSJim Jagielski return m_xEquationProperties;
168*b1cdbd2cSJim Jagielski }
169*b1cdbd2cSJim Jagielski
setEquationProperties(const uno::Reference<beans::XPropertySet> & xEquationProperties)170*b1cdbd2cSJim Jagielski void SAL_CALL RegressionCurveModel::setEquationProperties( const uno::Reference< beans::XPropertySet >& xEquationProperties )
171*b1cdbd2cSJim Jagielski throw (uno::RuntimeException)
172*b1cdbd2cSJim Jagielski {
173*b1cdbd2cSJim Jagielski if( xEquationProperties.is())
174*b1cdbd2cSJim Jagielski {
175*b1cdbd2cSJim Jagielski if( m_xEquationProperties.is())
176*b1cdbd2cSJim Jagielski ModifyListenerHelper::removeListener( m_xEquationProperties, m_xModifyEventForwarder );
177*b1cdbd2cSJim Jagielski
178*b1cdbd2cSJim Jagielski m_xEquationProperties.set( xEquationProperties );
179*b1cdbd2cSJim Jagielski ModifyListenerHelper::addListener( m_xEquationProperties, m_xModifyEventForwarder );
180*b1cdbd2cSJim Jagielski fireModifyEvent();
181*b1cdbd2cSJim Jagielski }
182*b1cdbd2cSJim Jagielski }
183*b1cdbd2cSJim Jagielski
184*b1cdbd2cSJim Jagielski // ____ XServiceName ____
getServiceName()185*b1cdbd2cSJim Jagielski ::rtl::OUString SAL_CALL RegressionCurveModel::getServiceName()
186*b1cdbd2cSJim Jagielski throw (uno::RuntimeException)
187*b1cdbd2cSJim Jagielski {
188*b1cdbd2cSJim Jagielski switch( m_eRegressionCurveType )
189*b1cdbd2cSJim Jagielski {
190*b1cdbd2cSJim Jagielski case CURVE_TYPE_MEAN_VALUE:
191*b1cdbd2cSJim Jagielski return C2U( "com.sun.star.chart2.MeanValueRegressionCurve" );
192*b1cdbd2cSJim Jagielski case CURVE_TYPE_LINEAR:
193*b1cdbd2cSJim Jagielski return C2U( "com.sun.star.chart2.LinearRegressionCurve" );
194*b1cdbd2cSJim Jagielski case CURVE_TYPE_LOGARITHM:
195*b1cdbd2cSJim Jagielski return C2U( "com.sun.star.chart2.LogarithmicRegressionCurve" );
196*b1cdbd2cSJim Jagielski case CURVE_TYPE_EXPONENTIAL:
197*b1cdbd2cSJim Jagielski return C2U( "com.sun.star.chart2.ExponentialRegressionCurve" );
198*b1cdbd2cSJim Jagielski case CURVE_TYPE_POWER:
199*b1cdbd2cSJim Jagielski return C2U( "com.sun.star.chart2.PotentialRegressionCurve" );
200*b1cdbd2cSJim Jagielski }
201*b1cdbd2cSJim Jagielski
202*b1cdbd2cSJim Jagielski return ::rtl::OUString();
203*b1cdbd2cSJim Jagielski }
204*b1cdbd2cSJim Jagielski
205*b1cdbd2cSJim Jagielski // ____ XModifyBroadcaster ____
addModifyListener(const uno::Reference<util::XModifyListener> & aListener)206*b1cdbd2cSJim Jagielski void SAL_CALL RegressionCurveModel::addModifyListener( const uno::Reference< util::XModifyListener >& aListener )
207*b1cdbd2cSJim Jagielski throw (uno::RuntimeException)
208*b1cdbd2cSJim Jagielski {
209*b1cdbd2cSJim Jagielski try
210*b1cdbd2cSJim Jagielski {
211*b1cdbd2cSJim Jagielski uno::Reference< util::XModifyBroadcaster > xBroadcaster( m_xModifyEventForwarder, uno::UNO_QUERY_THROW );
212*b1cdbd2cSJim Jagielski xBroadcaster->addModifyListener( aListener );
213*b1cdbd2cSJim Jagielski }
214*b1cdbd2cSJim Jagielski catch( const uno::Exception & ex )
215*b1cdbd2cSJim Jagielski {
216*b1cdbd2cSJim Jagielski ASSERT_EXCEPTION( ex );
217*b1cdbd2cSJim Jagielski }
218*b1cdbd2cSJim Jagielski }
219*b1cdbd2cSJim Jagielski
removeModifyListener(const uno::Reference<util::XModifyListener> & aListener)220*b1cdbd2cSJim Jagielski void SAL_CALL RegressionCurveModel::removeModifyListener( const uno::Reference< util::XModifyListener >& aListener )
221*b1cdbd2cSJim Jagielski throw (uno::RuntimeException)
222*b1cdbd2cSJim Jagielski {
223*b1cdbd2cSJim Jagielski try
224*b1cdbd2cSJim Jagielski {
225*b1cdbd2cSJim Jagielski uno::Reference< util::XModifyBroadcaster > xBroadcaster( m_xModifyEventForwarder, uno::UNO_QUERY_THROW );
226*b1cdbd2cSJim Jagielski xBroadcaster->removeModifyListener( aListener );
227*b1cdbd2cSJim Jagielski }
228*b1cdbd2cSJim Jagielski catch( const uno::Exception & ex )
229*b1cdbd2cSJim Jagielski {
230*b1cdbd2cSJim Jagielski ASSERT_EXCEPTION( ex );
231*b1cdbd2cSJim Jagielski }
232*b1cdbd2cSJim Jagielski }
233*b1cdbd2cSJim Jagielski
234*b1cdbd2cSJim Jagielski // ____ XModifyListener ____
modified(const lang::EventObject & aEvent)235*b1cdbd2cSJim Jagielski void SAL_CALL RegressionCurveModel::modified( const lang::EventObject& aEvent )
236*b1cdbd2cSJim Jagielski throw (uno::RuntimeException)
237*b1cdbd2cSJim Jagielski {
238*b1cdbd2cSJim Jagielski m_xModifyEventForwarder->modified( aEvent );
239*b1cdbd2cSJim Jagielski }
240*b1cdbd2cSJim Jagielski
241*b1cdbd2cSJim Jagielski // ____ XEventListener (base of XModifyListener) ____
disposing(const lang::EventObject &)242*b1cdbd2cSJim Jagielski void SAL_CALL RegressionCurveModel::disposing( const lang::EventObject& /* Source */ )
243*b1cdbd2cSJim Jagielski throw (uno::RuntimeException)
244*b1cdbd2cSJim Jagielski {
245*b1cdbd2cSJim Jagielski // nothing
246*b1cdbd2cSJim Jagielski }
247*b1cdbd2cSJim Jagielski
248*b1cdbd2cSJim Jagielski // ____ OPropertySet ____
firePropertyChangeEvent()249*b1cdbd2cSJim Jagielski void RegressionCurveModel::firePropertyChangeEvent()
250*b1cdbd2cSJim Jagielski {
251*b1cdbd2cSJim Jagielski fireModifyEvent();
252*b1cdbd2cSJim Jagielski }
253*b1cdbd2cSJim Jagielski
fireModifyEvent()254*b1cdbd2cSJim Jagielski void RegressionCurveModel::fireModifyEvent()
255*b1cdbd2cSJim Jagielski {
256*b1cdbd2cSJim Jagielski m_xModifyEventForwarder->modified( lang::EventObject( static_cast< uno::XWeak* >( this )));
257*b1cdbd2cSJim Jagielski }
258*b1cdbd2cSJim Jagielski
259*b1cdbd2cSJim Jagielski // ================================================================================
260*b1cdbd2cSJim Jagielski
261*b1cdbd2cSJim Jagielski // ____ OPropertySet ____
GetDefaultValue(sal_Int32 nHandle) const262*b1cdbd2cSJim Jagielski uno::Any RegressionCurveModel::GetDefaultValue( sal_Int32 nHandle ) const
263*b1cdbd2cSJim Jagielski throw(beans::UnknownPropertyException)
264*b1cdbd2cSJim Jagielski {
265*b1cdbd2cSJim Jagielski const tPropertyValueMap& rStaticDefaults = *StaticXXXDefaults::get();
266*b1cdbd2cSJim Jagielski tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
267*b1cdbd2cSJim Jagielski if( aFound == rStaticDefaults.end() )
268*b1cdbd2cSJim Jagielski return uno::Any();
269*b1cdbd2cSJim Jagielski return (*aFound).second;
270*b1cdbd2cSJim Jagielski }
271*b1cdbd2cSJim Jagielski
getInfoHelper()272*b1cdbd2cSJim Jagielski ::cppu::IPropertyArrayHelper & SAL_CALL RegressionCurveModel::getInfoHelper()
273*b1cdbd2cSJim Jagielski {
274*b1cdbd2cSJim Jagielski return *StaticRegressionCurveInfoHelper::get();
275*b1cdbd2cSJim Jagielski }
276*b1cdbd2cSJim Jagielski
277*b1cdbd2cSJim Jagielski // ____ XPropertySet ____
getPropertySetInfo()278*b1cdbd2cSJim Jagielski uno::Reference< beans::XPropertySetInfo > SAL_CALL RegressionCurveModel::getPropertySetInfo()
279*b1cdbd2cSJim Jagielski throw (uno::RuntimeException)
280*b1cdbd2cSJim Jagielski {
281*b1cdbd2cSJim Jagielski return *StaticRegressionCurveInfo::get();
282*b1cdbd2cSJim Jagielski }
283*b1cdbd2cSJim Jagielski
284*b1cdbd2cSJim Jagielski // ================================================================================
285*b1cdbd2cSJim Jagielski
286*b1cdbd2cSJim Jagielski // needed by MSC compiler
287*b1cdbd2cSJim Jagielski using impl::RegressionCurveModel_Base;
288*b1cdbd2cSJim Jagielski
IMPLEMENT_FORWARD_XINTERFACE2(RegressionCurveModel,RegressionCurveModel_Base,OPropertySet)289*b1cdbd2cSJim Jagielski IMPLEMENT_FORWARD_XINTERFACE2( RegressionCurveModel, RegressionCurveModel_Base, OPropertySet )
290*b1cdbd2cSJim Jagielski IMPLEMENT_FORWARD_XTYPEPROVIDER2( RegressionCurveModel, RegressionCurveModel_Base, OPropertySet )
291*b1cdbd2cSJim Jagielski
292*b1cdbd2cSJim Jagielski
293*b1cdbd2cSJim Jagielski
294*b1cdbd2cSJim Jagielski // implementations
295*b1cdbd2cSJim Jagielski
296*b1cdbd2cSJim Jagielski // --------------------------------------------------------------------------------
297*b1cdbd2cSJim Jagielski
298*b1cdbd2cSJim Jagielski MeanValueRegressionCurve::MeanValueRegressionCurve(
299*b1cdbd2cSJim Jagielski const uno::Reference< uno::XComponentContext > & xContext )
300*b1cdbd2cSJim Jagielski : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_MEAN_VALUE )
301*b1cdbd2cSJim Jagielski {}
MeanValueRegressionCurve(const MeanValueRegressionCurve & rOther)302*b1cdbd2cSJim Jagielski MeanValueRegressionCurve::MeanValueRegressionCurve(
303*b1cdbd2cSJim Jagielski const MeanValueRegressionCurve & rOther ) :
304*b1cdbd2cSJim Jagielski RegressionCurveModel( rOther )
305*b1cdbd2cSJim Jagielski {}
~MeanValueRegressionCurve()306*b1cdbd2cSJim Jagielski MeanValueRegressionCurve::~MeanValueRegressionCurve()
307*b1cdbd2cSJim Jagielski {}
getSupportedServiceNames_Static()308*b1cdbd2cSJim Jagielski uno::Sequence< ::rtl::OUString > MeanValueRegressionCurve::getSupportedServiceNames_Static()
309*b1cdbd2cSJim Jagielski {
310*b1cdbd2cSJim Jagielski uno::Sequence< ::rtl::OUString > aServices( 2 );
311*b1cdbd2cSJim Jagielski aServices[ 0 ] = lcl_aServiceName;
312*b1cdbd2cSJim Jagielski aServices[ 1 ] = C2U( "com.sun.star.chart2.MeanValueRegressionCurve" );
313*b1cdbd2cSJim Jagielski return aServices;
314*b1cdbd2cSJim Jagielski }
315*b1cdbd2cSJim Jagielski // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
316*b1cdbd2cSJim Jagielski APPHELPER_XSERVICEINFO_IMPL( MeanValueRegressionCurve, lcl_aImplementationName_MeanValue );
317*b1cdbd2cSJim Jagielski
createClone()318*b1cdbd2cSJim Jagielski uno::Reference< util::XCloneable > SAL_CALL MeanValueRegressionCurve::createClone()
319*b1cdbd2cSJim Jagielski throw (uno::RuntimeException)
320*b1cdbd2cSJim Jagielski {
321*b1cdbd2cSJim Jagielski return uno::Reference< util::XCloneable >( new MeanValueRegressionCurve( *this ));
322*b1cdbd2cSJim Jagielski }
323*b1cdbd2cSJim Jagielski
324*b1cdbd2cSJim Jagielski // --------------------------------------------------------------------------------
325*b1cdbd2cSJim Jagielski
LinearRegressionCurve(const uno::Reference<uno::XComponentContext> & xContext)326*b1cdbd2cSJim Jagielski LinearRegressionCurve::LinearRegressionCurve(
327*b1cdbd2cSJim Jagielski const uno::Reference< uno::XComponentContext > & xContext )
328*b1cdbd2cSJim Jagielski : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_LINEAR )
329*b1cdbd2cSJim Jagielski {}
LinearRegressionCurve(const LinearRegressionCurve & rOther)330*b1cdbd2cSJim Jagielski LinearRegressionCurve::LinearRegressionCurve(
331*b1cdbd2cSJim Jagielski const LinearRegressionCurve & rOther ) :
332*b1cdbd2cSJim Jagielski RegressionCurveModel( rOther )
333*b1cdbd2cSJim Jagielski {}
~LinearRegressionCurve()334*b1cdbd2cSJim Jagielski LinearRegressionCurve::~LinearRegressionCurve()
335*b1cdbd2cSJim Jagielski {}
getSupportedServiceNames_Static()336*b1cdbd2cSJim Jagielski uno::Sequence< ::rtl::OUString > LinearRegressionCurve::getSupportedServiceNames_Static()
337*b1cdbd2cSJim Jagielski {
338*b1cdbd2cSJim Jagielski uno::Sequence< ::rtl::OUString > aServices( 2 );
339*b1cdbd2cSJim Jagielski aServices[ 0 ] = lcl_aServiceName;
340*b1cdbd2cSJim Jagielski aServices[ 1 ] = C2U( "com.sun.star.chart2.LinearRegressionCurve" );
341*b1cdbd2cSJim Jagielski return aServices;
342*b1cdbd2cSJim Jagielski }
343*b1cdbd2cSJim Jagielski // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
344*b1cdbd2cSJim Jagielski APPHELPER_XSERVICEINFO_IMPL( LinearRegressionCurve, lcl_aImplementationName_Linear );
345*b1cdbd2cSJim Jagielski
createClone()346*b1cdbd2cSJim Jagielski uno::Reference< util::XCloneable > SAL_CALL LinearRegressionCurve::createClone()
347*b1cdbd2cSJim Jagielski throw (uno::RuntimeException)
348*b1cdbd2cSJim Jagielski {
349*b1cdbd2cSJim Jagielski return uno::Reference< util::XCloneable >( new LinearRegressionCurve( *this ));
350*b1cdbd2cSJim Jagielski }
351*b1cdbd2cSJim Jagielski
352*b1cdbd2cSJim Jagielski // --------------------------------------------------------------------------------
353*b1cdbd2cSJim Jagielski
LogarithmicRegressionCurve(const uno::Reference<uno::XComponentContext> & xContext)354*b1cdbd2cSJim Jagielski LogarithmicRegressionCurve::LogarithmicRegressionCurve(
355*b1cdbd2cSJim Jagielski const uno::Reference< uno::XComponentContext > & xContext )
356*b1cdbd2cSJim Jagielski : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_LOGARITHM )
357*b1cdbd2cSJim Jagielski {}
LogarithmicRegressionCurve(const LogarithmicRegressionCurve & rOther)358*b1cdbd2cSJim Jagielski LogarithmicRegressionCurve::LogarithmicRegressionCurve(
359*b1cdbd2cSJim Jagielski const LogarithmicRegressionCurve & rOther ) :
360*b1cdbd2cSJim Jagielski RegressionCurveModel( rOther )
361*b1cdbd2cSJim Jagielski {}
~LogarithmicRegressionCurve()362*b1cdbd2cSJim Jagielski LogarithmicRegressionCurve::~LogarithmicRegressionCurve()
363*b1cdbd2cSJim Jagielski {}
getSupportedServiceNames_Static()364*b1cdbd2cSJim Jagielski uno::Sequence< ::rtl::OUString > LogarithmicRegressionCurve::getSupportedServiceNames_Static()
365*b1cdbd2cSJim Jagielski {
366*b1cdbd2cSJim Jagielski uno::Sequence< ::rtl::OUString > aServices( 2 );
367*b1cdbd2cSJim Jagielski aServices[ 0 ] = lcl_aServiceName;
368*b1cdbd2cSJim Jagielski aServices[ 1 ] = C2U( "com.sun.star.chart2.LogarithmicRegressionCurve" );
369*b1cdbd2cSJim Jagielski return aServices;
370*b1cdbd2cSJim Jagielski }
371*b1cdbd2cSJim Jagielski // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
372*b1cdbd2cSJim Jagielski APPHELPER_XSERVICEINFO_IMPL( LogarithmicRegressionCurve, lcl_aImplementationName_Logarithmic );
373*b1cdbd2cSJim Jagielski
createClone()374*b1cdbd2cSJim Jagielski uno::Reference< util::XCloneable > SAL_CALL LogarithmicRegressionCurve::createClone()
375*b1cdbd2cSJim Jagielski throw (uno::RuntimeException)
376*b1cdbd2cSJim Jagielski {
377*b1cdbd2cSJim Jagielski return uno::Reference< util::XCloneable >( new LogarithmicRegressionCurve( *this ));
378*b1cdbd2cSJim Jagielski }
379*b1cdbd2cSJim Jagielski
380*b1cdbd2cSJim Jagielski // --------------------------------------------------------------------------------
381*b1cdbd2cSJim Jagielski
ExponentialRegressionCurve(const uno::Reference<uno::XComponentContext> & xContext)382*b1cdbd2cSJim Jagielski ExponentialRegressionCurve::ExponentialRegressionCurve(
383*b1cdbd2cSJim Jagielski const uno::Reference< uno::XComponentContext > & xContext )
384*b1cdbd2cSJim Jagielski : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_EXPONENTIAL )
385*b1cdbd2cSJim Jagielski {}
ExponentialRegressionCurve(const ExponentialRegressionCurve & rOther)386*b1cdbd2cSJim Jagielski ExponentialRegressionCurve::ExponentialRegressionCurve(
387*b1cdbd2cSJim Jagielski const ExponentialRegressionCurve & rOther ) :
388*b1cdbd2cSJim Jagielski RegressionCurveModel( rOther )
389*b1cdbd2cSJim Jagielski {}
~ExponentialRegressionCurve()390*b1cdbd2cSJim Jagielski ExponentialRegressionCurve::~ExponentialRegressionCurve()
391*b1cdbd2cSJim Jagielski {}
getSupportedServiceNames_Static()392*b1cdbd2cSJim Jagielski uno::Sequence< ::rtl::OUString > ExponentialRegressionCurve::getSupportedServiceNames_Static()
393*b1cdbd2cSJim Jagielski {
394*b1cdbd2cSJim Jagielski uno::Sequence< ::rtl::OUString > aServices( 2 );
395*b1cdbd2cSJim Jagielski aServices[ 0 ] = lcl_aServiceName;
396*b1cdbd2cSJim Jagielski aServices[ 1 ] = C2U( "com.sun.star.chart2.ExponentialRegressionCurve" );
397*b1cdbd2cSJim Jagielski return aServices;
398*b1cdbd2cSJim Jagielski }
399*b1cdbd2cSJim Jagielski // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
400*b1cdbd2cSJim Jagielski APPHELPER_XSERVICEINFO_IMPL( ExponentialRegressionCurve, lcl_aImplementationName_Exponential );
401*b1cdbd2cSJim Jagielski
createClone()402*b1cdbd2cSJim Jagielski uno::Reference< util::XCloneable > SAL_CALL ExponentialRegressionCurve::createClone()
403*b1cdbd2cSJim Jagielski throw (uno::RuntimeException)
404*b1cdbd2cSJim Jagielski {
405*b1cdbd2cSJim Jagielski return uno::Reference< util::XCloneable >( new ExponentialRegressionCurve( *this ));
406*b1cdbd2cSJim Jagielski }
407*b1cdbd2cSJim Jagielski
408*b1cdbd2cSJim Jagielski // --------------------------------------------------------------------------------
409*b1cdbd2cSJim Jagielski
PotentialRegressionCurve(const uno::Reference<uno::XComponentContext> & xContext)410*b1cdbd2cSJim Jagielski PotentialRegressionCurve::PotentialRegressionCurve(
411*b1cdbd2cSJim Jagielski const uno::Reference< uno::XComponentContext > & xContext )
412*b1cdbd2cSJim Jagielski : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_POWER )
413*b1cdbd2cSJim Jagielski {}
PotentialRegressionCurve(const PotentialRegressionCurve & rOther)414*b1cdbd2cSJim Jagielski PotentialRegressionCurve::PotentialRegressionCurve(
415*b1cdbd2cSJim Jagielski const PotentialRegressionCurve & rOther ) :
416*b1cdbd2cSJim Jagielski RegressionCurveModel( rOther )
417*b1cdbd2cSJim Jagielski {}
~PotentialRegressionCurve()418*b1cdbd2cSJim Jagielski PotentialRegressionCurve::~PotentialRegressionCurve()
419*b1cdbd2cSJim Jagielski {}
getSupportedServiceNames_Static()420*b1cdbd2cSJim Jagielski uno::Sequence< ::rtl::OUString > PotentialRegressionCurve::getSupportedServiceNames_Static()
421*b1cdbd2cSJim Jagielski {
422*b1cdbd2cSJim Jagielski uno::Sequence< ::rtl::OUString > aServices( 2 );
423*b1cdbd2cSJim Jagielski aServices[ 0 ] = lcl_aServiceName;
424*b1cdbd2cSJim Jagielski aServices[ 1 ] = C2U( "com.sun.star.chart2.PotentialRegressionCurve" );
425*b1cdbd2cSJim Jagielski return aServices;
426*b1cdbd2cSJim Jagielski }
427*b1cdbd2cSJim Jagielski // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
428*b1cdbd2cSJim Jagielski APPHELPER_XSERVICEINFO_IMPL( PotentialRegressionCurve, lcl_aImplementationName_Potential );
429*b1cdbd2cSJim Jagielski
createClone()430*b1cdbd2cSJim Jagielski uno::Reference< util::XCloneable > SAL_CALL PotentialRegressionCurve::createClone()
431*b1cdbd2cSJim Jagielski throw (uno::RuntimeException)
432*b1cdbd2cSJim Jagielski {
433*b1cdbd2cSJim Jagielski return uno::Reference< util::XCloneable >( new PotentialRegressionCurve( *this ));
434*b1cdbd2cSJim Jagielski }
435*b1cdbd2cSJim Jagielski
436*b1cdbd2cSJim Jagielski
437*b1cdbd2cSJim Jagielski } // namespace chart
438