LibreOffice Module chart2 (master) 1
RegressionCurveModel.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
21#include "OPropertySet.hxx"
22
24#include <comphelper/uno3.hxx>
25#include <sal/types.h>
26
27#include <com/sun/star/chart2/XRegressionCurve.hpp>
28
29#include <com/sun/star/lang/XServiceInfo.hpp>
30#include <com/sun/star/lang/XServiceName.hpp>
31#include <com/sun/star/util/XCloneable.hpp>
33
34namespace chart
35{
36
37namespace impl
38{
39typedef ::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 >
47}
48
49class SAL_DLLPUBLIC_RTTI RegressionCurveModel :
52{
53public:
55 {
62 CURVE_TYPE_MOVING_AVERAGE
63 };
64
65 RegressionCurveModel( tCurveType eCurveType );
67 virtual ~RegressionCurveModel() override;
68
72 DECLARE_XTYPEPROVIDER()
73
74protected:
75 // ____ OPropertySet ____
76 virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) const override;
77
78 // ____ OPropertySet ____
79 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
80
81 // ____ XPropertySet ____
82 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
83 getPropertySetInfo() override;
84
85public:
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;
91
92 // ____ XServiceName ____
93 virtual OUString SAL_CALL getServiceName() override;
94
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;
100
101protected:
102 // ____ XModifyListener ____
103 virtual void SAL_CALL modified(
104 const css::lang::EventObject& aEvent ) override;
105
106 // ____ XEventListener (base of XModifyListener) ____
107 virtual void SAL_CALL disposing(
108 const css::lang::EventObject& Source ) override;
109
110 using ::cppu::OPropertySetHelper::disposing;
111
112 // ____ OPropertySet ____
113 virtual void firePropertyChangeEvent() override;
114
115 void fireModifyEvent();
116
117private:
118 const tCurveType m_eRegressionCurveType;
119
120 rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder;
121 css::uno::Reference< css::beans::XPropertySet > m_xEquationProperties;
122 void setPropertyMayHaveR2();
123};
124
125// implementations for factory instantiation
126
128{
129public:
130 explicit MeanValueRegressionCurve();
132 const MeanValueRegressionCurve & rOther );
133 virtual ~MeanValueRegressionCurve() override;
134
135 // ____ XCloneable ____
136 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
137
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;
142};
143
145{
146public:
147 explicit LinearRegressionCurve();
148 explicit LinearRegressionCurve( const LinearRegressionCurve & rOther );
149 virtual ~LinearRegressionCurve() override;
150
151 // ____ XCloneable ____
152 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
153
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;
158};
159
161{
162public:
165 virtual ~LogarithmicRegressionCurve() override;
166
167 // ____ XCloneable ____
168 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
169
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;
174};
175
177{
178public:
181 virtual ~ExponentialRegressionCurve() override;
182
183 // ____ XCloneable ____
184 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
185
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;
190};
191
193{
194public:
195 explicit PotentialRegressionCurve();
196 explicit PotentialRegressionCurve( const PotentialRegressionCurve & rOther );
197 virtual ~PotentialRegressionCurve() override;
198
199 // ____ XCloneable ____
200 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
201
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;
206};
207
209{
210public:
211 explicit PolynomialRegressionCurve();
212 explicit PolynomialRegressionCurve( const PolynomialRegressionCurve & rOther );
213 virtual ~PolynomialRegressionCurve() override;
214
215 // ____ XCloneable ____
216 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
217
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;
222};
223
225{
226public:
229 virtual ~MovingAverageRegressionCurve() override;
230
231 // ____ XCloneable ____
232 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
233
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;
238};
239
240} // namespace chart
241
242/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This helper class serves as forwarder of modify events.
::cppu::WeakImplHelper< css::lang::XServiceInfo, css::lang::XServiceName, css::chart2::XRegressionCurve, css::util::XCloneable, css::util::XModifyBroadcaster, css::util::XModifyListener > RegressionCurveModel_Base
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
unsigned char sal_Bool
#define DECLARE_XINTERFACE()