LCOV - code coverage report
Current view: top level - chart2/source/tools - RegressionCurveModel.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 6 7 85.7 %
Date: 2014-11-03 Functions: 6 7 85.7 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : #ifndef INCLUDED_CHART2_SOURCE_TOOLS_REGRESSIONCURVEMODEL_HXX
      20             : #define INCLUDED_CHART2_SOURCE_TOOLS_REGRESSIONCURVEMODEL_HXX
      21             : 
      22             : #include "MutexContainer.hxx"
      23             : #include "OPropertySet.hxx"
      24             : #include "ServiceMacros.hxx"
      25             : #include "ModifyListenerHelper.hxx"
      26             : 
      27             : #include <cppuhelper/implbase6.hxx>
      28             : #include <comphelper/uno3.hxx>
      29             : 
      30             : #include <com/sun/star/chart2/XRegressionCurve.hpp>
      31             : 
      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>
      36             : 
      37             : namespace chart
      38             : {
      39             : 
      40             : namespace impl
      41             : {
      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;
      50             : }
      51             : 
      52             : class RegressionCurveModel :
      53             :         public MutexContainer,
      54             :         public impl::RegressionCurveModel_Base,
      55             :         public ::property::OPropertySet
      56             : {
      57             : public:
      58             :     enum tCurveType
      59             :     {
      60             :         CURVE_TYPE_MEAN_VALUE,
      61             :         CURVE_TYPE_LINEAR,
      62             :         CURVE_TYPE_LOGARITHM,
      63             :         CURVE_TYPE_EXPONENTIAL,
      64             :         CURVE_TYPE_POWER,
      65             :         CURVE_TYPE_POLYNOMIAL,
      66             :         CURVE_TYPE_MOVING_AVERAGE
      67             :     };
      68             : 
      69             :     RegressionCurveModel( ::com::sun::star::uno::Reference<
      70             :                               ::com::sun::star::uno::XComponentContext > const & xContext,
      71             :                           tCurveType eCurveType );
      72             :     RegressionCurveModel( const RegressionCurveModel & rOther );
      73             :     virtual ~RegressionCurveModel();
      74             : 
      75             :     /// merge XInterface implementations
      76             :      DECLARE_XINTERFACE()
      77             :     /// merge XTypeProvider implementations
      78             :      DECLARE_XTYPEPROVIDER()
      79             : 
      80             : protected:
      81             :     // ____ OPropertySet ____
      82             :     virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
      83             :         throw(::com::sun::star::beans::UnknownPropertyException) SAL_OVERRIDE;
      84             : 
      85             :     // ____ OPropertySet ____
      86             :     virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() SAL_OVERRIDE;
      87             : 
      88             :     // ____ XPropertySet ____
      89             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
      90             :         getPropertySetInfo()
      91             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      92             : 
      93             :     // ____ XRegressionCurve ____
      94             :     virtual ::com::sun::star::uno::Reference<
      95             :             ::com::sun::star::chart2::XRegressionCurveCalculator > SAL_CALL getCalculator()
      96             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      97             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getEquationProperties()
      98             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      99             :     virtual void SAL_CALL setEquationProperties(
     100             :         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xEquationProperties )
     101             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     102             : 
     103             :     // ____ XServiceName ____
     104             :     virtual OUString SAL_CALL getServiceName()
     105             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     106             : 
     107             :     // ____ XCloneable ____
     108             :     // not implemented here
     109             : //     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
     110             : //         throw (::com::sun::star::uno::RuntimeException);
     111             : 
     112             :     // ____ XModifyBroadcaster ____
     113             :     virtual void SAL_CALL addModifyListener(
     114             :         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
     115             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     116             :     virtual void SAL_CALL removeModifyListener(
     117             :         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
     118             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     119             : 
     120             :     // ____ XModifyListener ____
     121             :     virtual void SAL_CALL modified(
     122             :         const ::com::sun::star::lang::EventObject& aEvent )
     123             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     124             : 
     125             :     // ____ XEventListener (base of XModifyListener) ____
     126             :     virtual void SAL_CALL disposing(
     127             :         const ::com::sun::star::lang::EventObject& Source )
     128             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     129             : 
     130             :     using ::cppu::OPropertySetHelper::disposing;
     131             : 
     132             :     // ____ OPropertySet ____
     133             :     virtual void firePropertyChangeEvent() SAL_OVERRIDE;
     134             : 
     135             :     void fireModifyEvent();
     136             : 
     137             : private:
     138             :     ::com::sun::star::uno::Reference<
     139             :         ::com::sun::star::uno::XComponentContext >
     140             :                         m_xContext;
     141             : 
     142             :     const tCurveType    m_eRegressionCurveType;
     143             : 
     144             :     ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
     145             :     ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xEquationProperties;
     146             : };
     147             : 
     148             : // implementations for factory instantiation
     149             : 
     150             : class MeanValueRegressionCurve : public RegressionCurveModel
     151             : {
     152             : public:
     153             :     explicit MeanValueRegressionCurve(
     154             :         const ::com::sun::star::uno::Reference<
     155             :         ::com::sun::star::uno::XComponentContext > & xContext );
     156             :     explicit MeanValueRegressionCurve(
     157             :         const MeanValueRegressionCurve & rOther );
     158             :     virtual ~MeanValueRegressionCurve();
     159             : 
     160             :     // ____ XCloneable ____
     161             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
     162             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     163             : 
     164             :     /// XServiceInfo declarations
     165             :     APPHELPER_XSERVICEINFO_DECL()
     166             :     /// establish methods for factory instatiation
     167           0 :     APPHELPER_SERVICE_FACTORY_HELPER( MeanValueRegressionCurve )
     168             : };
     169             : 
     170             : class LinearRegressionCurve : public RegressionCurveModel
     171             : {
     172             : public:
     173             :     explicit LinearRegressionCurve(
     174             :         const ::com::sun::star::uno::Reference<
     175             :         ::com::sun::star::uno::XComponentContext > & xContext );
     176             :     explicit LinearRegressionCurve(
     177             :         const LinearRegressionCurve & rOther );
     178             :     virtual ~LinearRegressionCurve();
     179             : 
     180             :     // ____ XCloneable ____
     181             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
     182             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     183             : 
     184             :     /// XServiceInfo declarations
     185             :     APPHELPER_XSERVICEINFO_DECL()
     186             :     /// establish methods for factory instatiation
     187          14 :     APPHELPER_SERVICE_FACTORY_HELPER( LinearRegressionCurve )
     188             : };
     189             : 
     190             : class LogarithmicRegressionCurve : public RegressionCurveModel
     191             : {
     192             : public:
     193             :     explicit LogarithmicRegressionCurve(
     194             :         const ::com::sun::star::uno::Reference<
     195             :         ::com::sun::star::uno::XComponentContext > & xContext );
     196             :     explicit LogarithmicRegressionCurve(
     197             :         const LogarithmicRegressionCurve & rOther );
     198             :     virtual ~LogarithmicRegressionCurve();
     199             : 
     200             :     // ____ XCloneable ____
     201             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
     202             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     203             : 
     204             :     /// XServiceInfo declarations
     205             :     APPHELPER_XSERVICEINFO_DECL()
     206             :     /// establish methods for factory instatiation
     207           2 :     APPHELPER_SERVICE_FACTORY_HELPER( LogarithmicRegressionCurve )
     208             : };
     209             : 
     210             : class ExponentialRegressionCurve : public RegressionCurveModel
     211             : {
     212             : public:
     213             :     explicit ExponentialRegressionCurve(
     214             :         const ::com::sun::star::uno::Reference<
     215             :         ::com::sun::star::uno::XComponentContext > & xContext );
     216             :     explicit ExponentialRegressionCurve(
     217             :         const ExponentialRegressionCurve & rOther );
     218             :     virtual ~ExponentialRegressionCurve();
     219             : 
     220             :     // ____ XCloneable ____
     221             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
     222             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     223             : 
     224             :     /// XServiceInfo declarations
     225             :     APPHELPER_XSERVICEINFO_DECL()
     226             :     /// establish methods for factory instatiation
     227           2 :     APPHELPER_SERVICE_FACTORY_HELPER( ExponentialRegressionCurve )
     228             : };
     229             : 
     230             : class PotentialRegressionCurve : public RegressionCurveModel
     231             : {
     232             : public:
     233             :     explicit PotentialRegressionCurve(
     234             :         const ::com::sun::star::uno::Reference<
     235             :         ::com::sun::star::uno::XComponentContext > & xContext );
     236             :     explicit PotentialRegressionCurve(
     237             :         const PotentialRegressionCurve & rOther );
     238             :     virtual ~PotentialRegressionCurve();
     239             : 
     240             :     // ____ XCloneable ____
     241             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
     242             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     243             : 
     244             :     /// XServiceInfo declarations
     245             :     APPHELPER_XSERVICEINFO_DECL()
     246             :     /// establish methods for factory instatiation
     247           2 :     APPHELPER_SERVICE_FACTORY_HELPER( PotentialRegressionCurve )
     248             : };
     249             : 
     250             : class PolynomialRegressionCurve : public RegressionCurveModel
     251             : {
     252             : public:
     253             :     explicit PolynomialRegressionCurve(
     254             :         const ::com::sun::star::uno::Reference<
     255             :         ::com::sun::star::uno::XComponentContext > & xContext );
     256             :     explicit PolynomialRegressionCurve(
     257             :         const PolynomialRegressionCurve & rOther );
     258             :     virtual ~PolynomialRegressionCurve();
     259             : 
     260             :     // ____ XCloneable ____
     261             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
     262             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     263             : 
     264             :     /// XServiceInfo declarations
     265             :     APPHELPER_XSERVICEINFO_DECL()
     266             :     /// establish methods for factory instatiation
     267          14 :     APPHELPER_SERVICE_FACTORY_HELPER( PolynomialRegressionCurve )
     268             : };
     269             : 
     270             : class MovingAverageRegressionCurve : public RegressionCurveModel
     271             : {
     272             : public:
     273             :     explicit MovingAverageRegressionCurve(
     274             :         const ::com::sun::star::uno::Reference<
     275             :         ::com::sun::star::uno::XComponentContext > & xContext );
     276             :     explicit MovingAverageRegressionCurve(
     277             :         const MovingAverageRegressionCurve & rOther );
     278             :     virtual ~MovingAverageRegressionCurve();
     279             : 
     280             :     // ____ XCloneable ____
     281             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
     282             :         throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     283             : 
     284             :     /// XServiceInfo declarations
     285             :     APPHELPER_XSERVICEINFO_DECL()
     286             :     /// establish methods for factory instatiation
     287          14 :     APPHELPER_SERVICE_FACTORY_HELPER( MovingAverageRegressionCurve )
     288             : };
     289             : 
     290             : } //  namespace chart
     291             : 
     292             : // INCLUDED_CHART2_SOURCE_TOOLS_REGRESSIONCURVEMODEL_HXX
     293             : #endif
     294             : 
     295             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10