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 INCLUDED_CHART2_SOURCE_INC_REGRESSIONCURVECALCULATOR_HXX
20 #define INCLUDED_CHART2_SOURCE_INC_REGRESSIONCURVECALCULATOR_HXX
22 #include <cppuhelper/implbase1.hxx>
24 #include <com/sun/star/chart2/XRegressionCurveCalculator.hpp>
25 #include <com/sun/star/util/XNumberFormatter.hpp>
30 class RegressionCurveCalculator
: public
31 cppu::WeakImplHelper1
< com::sun::star::chart2::XRegressionCurveCalculator
>
34 RegressionCurveCalculator();
35 virtual ~RegressionCurveCalculator();
37 static bool isLinearScaling(
38 const com::sun::star::uno::Reference
< com::sun::star::chart2::XScaling
>& xScaling
);
40 static bool isLogarithmicScaling(
41 const com::sun::star::uno::Reference
< com::sun::star::chart2::XScaling
>& xScaling
);
44 virtual OUString
ImplGetRepresentation(
45 const com::sun::star::uno::Reference
< com::sun::star::util::XNumberFormatter
>& xNumFormatter
,
46 sal_Int32 nNumberFormatKey
) const = 0;
48 static OUString
getFormattedString(
49 const com::sun::star::uno::Reference
< com::sun::star::util::XNumberFormatter
>& xNumFormatter
,
50 sal_Int32 nNumberFormatKey
,
53 double m_fCorrelationCoeffitient
;
57 double mInterceptValue
;
60 // ____ XRegressionCurveCalculator ____
61 virtual void SAL_CALL
setRegressionProperties(
63 sal_Bool aForceIntercept
,
64 double aInterceptValue
,
66 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
68 virtual void SAL_CALL
recalculateRegression(
69 const com::sun::star::uno::Sequence
< double >& aXValues
,
70 const com::sun::star::uno::Sequence
< double >& aYValues
)
71 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
= 0;
73 virtual double SAL_CALL
getCurveValue( double x
)
74 throw (com::sun::star::lang::IllegalArgumentException
,
75 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
= 0;
77 virtual com::sun::star::uno::Sequence
< com::sun::star::geometry::RealPoint2D
> SAL_CALL
getCurveValues(
80 sal_Int32 nPointCount
,
81 const com::sun::star::uno::Reference
< com::sun::star::chart2::XScaling
>& xScalingX
,
82 const com::sun::star::uno::Reference
< com::sun::star::chart2::XScaling
>& xScalingY
,
83 sal_Bool bMaySkipPointsInCalculation
)
84 throw (com::sun::star::lang::IllegalArgumentException
,
85 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
87 virtual double SAL_CALL
getCorrelationCoefficient()
88 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
90 virtual OUString SAL_CALL
getRepresentation()
91 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
93 virtual OUString SAL_CALL
getFormattedRepresentation(
94 const com::sun::star::uno::Reference
< com::sun::star::util::XNumberFormatsSupplier
>& xNumFmtSupplier
,
95 sal_Int32 nNumberFormatKey
)
96 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
101 // INCLUDED_CHART2_SOURCE_INC_REGRESSIONCURVECALCULATOR_HXX
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */