nss: upgrade to release 3.73
[LibreOffice.git] / chart2 / source / inc / RegressionCurveCalculator.hxx
blob1914c4effea98a89eef663f55edcbf8d0dcef167
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
21 #include <cppuhelper/implbase.hxx>
22 #include <rtl/ustrbuf.hxx>
24 #include <com/sun/star/chart2/XRegressionCurveCalculator.hpp>
26 namespace com::sun::star::util { class XNumberFormatsSupplier; }
27 namespace com::sun::star::util { class XNumberFormatter; }
29 namespace chart
32 class RegressionCurveCalculator : public
33 cppu::WeakImplHelper< css::chart2::XRegressionCurveCalculator >
35 public:
36 RegressionCurveCalculator();
37 virtual ~RegressionCurveCalculator() override;
39 static bool isLinearScaling(
40 const css::uno::Reference< css::chart2::XScaling >& xScaling );
42 static bool isLogarithmicScaling(
43 const css::uno::Reference< css::chart2::XScaling >& xScaling );
45 protected:
46 virtual OUString ImplGetRepresentation(
47 const css::uno::Reference< css::util::XNumberFormatter >& xNumFormatter,
48 sal_Int32 nNumberFormatKey, sal_Int32* pFormulaLength = nullptr ) const = 0;
50 static OUString getFormattedString(
51 const css::uno::Reference< css::util::XNumberFormatter >& xNumFormatter,
52 sal_Int32 nNumberFormatKey,
53 double fNumber,
54 const sal_Int32* pStringLength );
56 static void addStringToEquation( OUStringBuffer& aStrEquation, sal_Int32& nLineLength, OUStringBuffer const & aAddString, const sal_Int32* pMaxLength );
58 double m_fCorrelationCoefficient;
60 sal_Int32 mDegree;
61 bool mForceIntercept;
62 double mInterceptValue;
63 sal_Int32 mPeriod;
64 OUString mXName, mYName;
66 // ____ XRegressionCurveCalculator ____
67 virtual void SAL_CALL setRegressionProperties(
68 sal_Int32 aDegree,
69 sal_Bool aForceIntercept,
70 double aInterceptValue,
71 sal_Int32 aPeriod) override;
73 virtual void SAL_CALL recalculateRegression(
74 const css::uno::Sequence< double >& aXValues,
75 const css::uno::Sequence< double >& aYValues ) override = 0;
77 virtual double SAL_CALL getCurveValue( double x ) override = 0;
79 virtual css::uno::Sequence< css::geometry::RealPoint2D > SAL_CALL getCurveValues(
80 double min,
81 double max,
82 sal_Int32 nPointCount,
83 const css::uno::Reference< css::chart2::XScaling >& xScalingX,
84 const css::uno::Reference< css::chart2::XScaling >& xScalingY,
85 sal_Bool bMaySkipPointsInCalculation ) override;
87 virtual double SAL_CALL getCorrelationCoefficient() override;
89 virtual OUString SAL_CALL getRepresentation() override;
91 virtual OUString SAL_CALL getFormattedRepresentation(
92 const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumFmtSupplier,
93 sal_Int32 nNumberFormatKey, sal_Int32 nFormulaLength ) override;
95 virtual void SAL_CALL setXYNames(
96 const OUString& aXName, const OUString& aYName ) override;
99 } // namespace chart
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */