1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef CHART2_REGRESSIONCURVEMODEL_HXX
20 #define CHART2_REGRESSIONCURVEMODEL_HXX
22 #include "MutexContainer.hxx"
23 #include "OPropertySet.hxx"
24 #include "ServiceMacros.hxx"
25 #include "ModifyListenerHelper.hxx"
27 #include <cppuhelper/implbase6.hxx>
28 #include <comphelper/uno3.hxx>
30 #include <com/sun/star/chart2/XRegressionCurve.hpp>
32 #include <com/sun/star/uno/XComponentContext.hpp>
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 #include <com/sun/star/lang/XServiceName.hpp>
35 #include <com/sun/star/util/XCloneable.hpp>
42 typedef ::cppu::WeakImplHelper6
<
43 ::com::sun::star::lang::XServiceInfo
,
44 ::com::sun::star::lang::XServiceName
,
45 ::com::sun::star::chart2::XRegressionCurve
,
46 ::com::sun::star::util::XCloneable
,
47 ::com::sun::star::util::XModifyBroadcaster
,
48 ::com::sun::star::util::XModifyListener
>
49 RegressionCurveModel_Base
;
52 class RegressionCurveModel
:
53 public MutexContainer
,
54 public impl::RegressionCurveModel_Base
,
55 public ::property::OPropertySet
60 CURVE_TYPE_MEAN_VALUE
,
63 CURVE_TYPE_EXPONENTIAL
,
67 RegressionCurveModel( ::com::sun::star::uno::Reference
<
68 ::com::sun::star::uno::XComponentContext
> const & xContext
,
69 tCurveType eCurveType
);
70 RegressionCurveModel( const RegressionCurveModel
& rOther
);
71 virtual ~RegressionCurveModel();
73 /// merge XInterface implementations
75 /// merge XTypeProvider implementations
76 DECLARE_XTYPEPROVIDER()
79 // ____ OPropertySet ____
80 virtual ::com::sun::star::uno::Any
GetDefaultValue( sal_Int32 nHandle
) const
81 throw(::com::sun::star::beans::UnknownPropertyException
);
83 // ____ OPropertySet ____
84 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
86 // ____ XPropertySet ____
87 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
89 throw (::com::sun::star::uno::RuntimeException
);
91 // ____ XRegressionCurve ____
92 virtual ::com::sun::star::uno::Reference
<
93 ::com::sun::star::chart2::XRegressionCurveCalculator
> SAL_CALL
getCalculator()
94 throw (::com::sun::star::uno::RuntimeException
);
95 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getEquationProperties()
96 throw (::com::sun::star::uno::RuntimeException
);
97 virtual void SAL_CALL
setEquationProperties(
98 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xEquationProperties
)
99 throw (::com::sun::star::uno::RuntimeException
);
101 // ____ XServiceName ____
102 virtual OUString SAL_CALL
getServiceName()
103 throw (::com::sun::star::uno::RuntimeException
);
105 // ____ XCloneable ____
106 // not implemented here
107 // virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
108 // throw (::com::sun::star::uno::RuntimeException);
110 // ____ XModifyBroadcaster ____
111 virtual void SAL_CALL
addModifyListener(
112 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
113 throw (::com::sun::star::uno::RuntimeException
);
114 virtual void SAL_CALL
removeModifyListener(
115 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
116 throw (::com::sun::star::uno::RuntimeException
);
118 // ____ XModifyListener ____
119 virtual void SAL_CALL
modified(
120 const ::com::sun::star::lang::EventObject
& aEvent
)
121 throw (::com::sun::star::uno::RuntimeException
);
123 // ____ XEventListener (base of XModifyListener) ____
124 virtual void SAL_CALL
disposing(
125 const ::com::sun::star::lang::EventObject
& Source
)
126 throw (::com::sun::star::uno::RuntimeException
);
128 using ::cppu::OPropertySetHelper::disposing
;
130 // ____ OPropertySet ____
131 virtual void firePropertyChangeEvent();
133 void fireModifyEvent();
136 ::com::sun::star::uno::Reference
<
137 ::com::sun::star::uno::XComponentContext
>
140 const tCurveType m_eRegressionCurveType
;
142 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
> m_xModifyEventForwarder
;
143 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> m_xEquationProperties
;
146 // implementations for factory instantiation
148 class MeanValueRegressionCurve
: public RegressionCurveModel
151 explicit MeanValueRegressionCurve(
152 const ::com::sun::star::uno::Reference
<
153 ::com::sun::star::uno::XComponentContext
> & xContext
);
154 explicit MeanValueRegressionCurve(
155 const MeanValueRegressionCurve
& rOther
);
156 virtual ~MeanValueRegressionCurve();
158 // ____ XCloneable ____
159 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
160 throw (::com::sun::star::uno::RuntimeException
);
162 /// XServiceInfo declarations
163 APPHELPER_XSERVICEINFO_DECL()
164 /// establish methods for factory instatiation
165 APPHELPER_SERVICE_FACTORY_HELPER( MeanValueRegressionCurve
)
168 class LinearRegressionCurve
: public RegressionCurveModel
171 explicit LinearRegressionCurve(
172 const ::com::sun::star::uno::Reference
<
173 ::com::sun::star::uno::XComponentContext
> & xContext
);
174 explicit LinearRegressionCurve(
175 const LinearRegressionCurve
& rOther
);
176 virtual ~LinearRegressionCurve();
178 // ____ XCloneable ____
179 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
180 throw (::com::sun::star::uno::RuntimeException
);
182 /// XServiceInfo declarations
183 APPHELPER_XSERVICEINFO_DECL()
184 /// establish methods for factory instatiation
185 APPHELPER_SERVICE_FACTORY_HELPER( LinearRegressionCurve
)
188 class LogarithmicRegressionCurve
: public RegressionCurveModel
191 explicit LogarithmicRegressionCurve(
192 const ::com::sun::star::uno::Reference
<
193 ::com::sun::star::uno::XComponentContext
> & xContext
);
194 explicit LogarithmicRegressionCurve(
195 const LogarithmicRegressionCurve
& rOther
);
196 virtual ~LogarithmicRegressionCurve();
198 // ____ XCloneable ____
199 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
200 throw (::com::sun::star::uno::RuntimeException
);
202 /// XServiceInfo declarations
203 APPHELPER_XSERVICEINFO_DECL()
204 /// establish methods for factory instatiation
205 APPHELPER_SERVICE_FACTORY_HELPER( LogarithmicRegressionCurve
)
208 class ExponentialRegressionCurve
: public RegressionCurveModel
211 explicit ExponentialRegressionCurve(
212 const ::com::sun::star::uno::Reference
<
213 ::com::sun::star::uno::XComponentContext
> & xContext
);
214 explicit ExponentialRegressionCurve(
215 const ExponentialRegressionCurve
& rOther
);
216 virtual ~ExponentialRegressionCurve();
218 // ____ XCloneable ____
219 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
220 throw (::com::sun::star::uno::RuntimeException
);
222 /// XServiceInfo declarations
223 APPHELPER_XSERVICEINFO_DECL()
224 /// establish methods for factory instatiation
225 APPHELPER_SERVICE_FACTORY_HELPER( ExponentialRegressionCurve
)
228 class PotentialRegressionCurve
: public RegressionCurveModel
231 explicit PotentialRegressionCurve(
232 const ::com::sun::star::uno::Reference
<
233 ::com::sun::star::uno::XComponentContext
> & xContext
);
234 explicit PotentialRegressionCurve(
235 const PotentialRegressionCurve
& rOther
);
236 virtual ~PotentialRegressionCurve();
238 // ____ XCloneable ____
239 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
240 throw (::com::sun::star::uno::RuntimeException
);
242 /// XServiceInfo declarations
243 APPHELPER_XSERVICEINFO_DECL()
244 /// establish methods for factory instatiation
245 APPHELPER_SERVICE_FACTORY_HELPER( PotentialRegressionCurve
)
250 // CHART2_REGRESSIONCURVEMODEL_HXX
253 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */