LibreOffice Module chart2 (master) 1
RegressionCurveCalculator.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
22#include <rtl/ustrbuf.hxx>
23
24#include <com/sun/star/chart2/XRegressionCurveCalculator.hpp>
25
26namespace com::sun::star::util { class XNumberFormatsSupplier; }
27namespace com::sun::star::util { class XNumberFormatter; }
28
29namespace chart
30{
31
33 cppu::WeakImplHelper< css::chart2::XRegressionCurveCalculator >
34{
35public:
37 virtual ~RegressionCurveCalculator() override;
38
39 static bool isLinearScaling(
40 const css::uno::Reference< css::chart2::XScaling >& xScaling );
41
42 static bool isLogarithmicScaling(
43 const css::uno::Reference< css::chart2::XScaling >& xScaling );
44
45 // ____ XRegressionCurveCalculator ____
46 virtual void SAL_CALL setRegressionProperties(
47 sal_Int32 aDegree,
48 sal_Bool aForceIntercept,
49 double aInterceptValue,
50 sal_Int32 aPeriod,
51 sal_Int32 nMovingType) override;
52
53 virtual void SAL_CALL recalculateRegression(
54 const css::uno::Sequence< double >& aXValues,
55 const css::uno::Sequence< double >& aYValues ) override = 0;
56
57 virtual double SAL_CALL getCurveValue( double x ) override = 0;
58
59 virtual css::uno::Sequence< css::geometry::RealPoint2D > SAL_CALL getCurveValues(
60 double min,
61 double max,
62 sal_Int32 nPointCount,
63 const css::uno::Reference< css::chart2::XScaling >& xScalingX,
64 const css::uno::Reference< css::chart2::XScaling >& xScalingY,
65 sal_Bool bMaySkipPointsInCalculation ) override;
66
67 virtual double SAL_CALL getCorrelationCoefficient() override;
68
69 virtual OUString SAL_CALL getRepresentation() override;
70
71 virtual OUString SAL_CALL getFormattedRepresentation(
72 const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumFmtSupplier,
73 sal_Int32 nNumberFormatKey, sal_Int32 nFormulaLength ) override;
74
75 virtual void SAL_CALL setXYNames(
76 const OUString& aXName, const OUString& aYName ) override;
77
78protected:
79 virtual OUString ImplGetRepresentation(
80 const css::uno::Reference< css::util::XNumberFormatter >& xNumFormatter,
81 sal_Int32 nNumberFormatKey, sal_Int32* pFormulaLength = nullptr ) const = 0;
82
83 static OUString getFormattedString(
84 const css::uno::Reference< css::util::XNumberFormatter >& xNumFormatter,
85 sal_Int32 nNumberFormatKey,
86 double fNumber,
87 const sal_Int32* pStringLength );
88
89 static void addStringToEquation( OUStringBuffer& aStrEquation, sal_Int32& nLineLength, OUStringBuffer const & aAddString, const sal_Int32* pMaxLength );
90
92
93 sal_Int32 mDegree;
96 sal_Int32 mPeriod;
97 OUString mXName, mYName;
98 sal_Int32 mnMovingType;
99};
100
101} // namespace chart
102
103/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL setXYNames(const OUString &aXName, const OUString &aYName) override
static bool isLogarithmicScaling(const css::uno::Reference< css::chart2::XScaling > &xScaling)
virtual OUString ImplGetRepresentation(const css::uno::Reference< css::util::XNumberFormatter > &xNumFormatter, sal_Int32 nNumberFormatKey, sal_Int32 *pFormulaLength=nullptr) const =0
static void addStringToEquation(OUStringBuffer &aStrEquation, sal_Int32 &nLineLength, OUStringBuffer const &aAddString, const sal_Int32 *pMaxLength)
virtual void SAL_CALL recalculateRegression(const css::uno::Sequence< double > &aXValues, const css::uno::Sequence< double > &aYValues) override=0
virtual void SAL_CALL setRegressionProperties(sal_Int32 aDegree, sal_Bool aForceIntercept, double aInterceptValue, sal_Int32 aPeriod, sal_Int32 nMovingType) override
static OUString getFormattedString(const css::uno::Reference< css::util::XNumberFormatter > &xNumFormatter, sal_Int32 nNumberFormatKey, double fNumber, const sal_Int32 *pStringLength)
static bool isLinearScaling(const css::uno::Reference< css::chart2::XScaling > &xScaling)
virtual css::uno::Sequence< css::geometry::RealPoint2D > SAL_CALL getCurveValues(double min, double max, sal_Int32 nPointCount, const css::uno::Reference< css::chart2::XScaling > &xScalingX, const css::uno::Reference< css::chart2::XScaling > &xScalingY, sal_Bool bMaySkipPointsInCalculation) override
virtual double SAL_CALL getCurveValue(double x) override=0
virtual OUString SAL_CALL getRepresentation() override
virtual double SAL_CALL getCorrelationCoefficient() override
virtual OUString SAL_CALL getFormattedRepresentation(const css::uno::Reference< css::util::XNumberFormatsSupplier > &xNumFmtSupplier, sal_Int32 nNumberFormatKey, sal_Int32 nFormulaLength) override
unsigned char sal_Bool