LCOV - code coverage report
Current view: top level - chart2/source/inc - Scaling.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 4 25.0 %
Date: 2012-08-25 Functions: 1 4 25.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 1 8 12.5 %

           Branch data     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 _CHART2_SCALING_HXX
      20                 :            : #define _CHART2_SCALING_HXX
      21                 :            : #include "ServiceMacros.hxx"
      22                 :            : #include <com/sun/star/chart2/XScaling.hpp>
      23                 :            : #include <com/sun/star/lang/XServiceInfo.hpp>
      24                 :            : #include <com/sun/star/lang/XServiceName.hpp>
      25                 :            : #include <com/sun/star/uno/XComponentContext.hpp>
      26                 :            : #include <cppuhelper/implbase3.hxx>
      27                 :            : 
      28                 :            : //.............................................................................
      29                 :            : namespace chart
      30                 :            : {
      31                 :            : //.............................................................................
      32                 :            : 
      33                 :            : //-----------------------------------------------------------------------------
      34                 :            : /**
      35                 :            : */
      36                 :            : 
      37                 :            : class LogarithmicScaling :
      38                 :            :         public ::cppu::WeakImplHelper3 <
      39                 :            :         ::com::sun::star::chart2::XScaling,
      40                 :            :         ::com::sun::star::lang::XServiceName,
      41                 :            :         ::com::sun::star::lang::XServiceInfo
      42                 :            :         >
      43                 :            : {
      44                 :            : public:
      45                 :            :     /// base is 10.0
      46                 :            :     explicit LogarithmicScaling(
      47                 :            :         const ::com::sun::star::uno::Reference<
      48                 :            :             ::com::sun::star::uno::XComponentContext > & xContext );
      49                 :            :     LogarithmicScaling( double fBase = 10.0 );
      50                 :            :     virtual ~LogarithmicScaling();
      51                 :            : 
      52                 :            :     /// establish methods for factory instatiation
      53         [ #  # ]:          0 :     APPHELPER_SERVICE_FACTORY_HELPER( LogarithmicScaling )
      54                 :            :     /// declare XServiceInfo methods
      55                 :            :     APPHELPER_XSERVICEINFO_DECL()
      56                 :            : 
      57                 :            :     // ____ XScaling ____
      58                 :            :     virtual double SAL_CALL doScaling( double value )
      59                 :            :         throw (::com::sun::star::uno::RuntimeException);
      60                 :            : 
      61                 :            :     virtual ::com::sun::star::uno::Reference<
      62                 :            :         ::com::sun::star::chart2::XScaling > SAL_CALL
      63                 :            :         getInverseScaling() throw (::com::sun::star::uno::RuntimeException);
      64                 :            : 
      65                 :            :     // ____ XServiceName ____
      66                 :            :     virtual ::rtl::OUString SAL_CALL getServiceName()
      67                 :            :         throw (::com::sun::star::uno::RuntimeException);
      68                 :            : 
      69                 :            : private:
      70                 :            :     const double m_fBase;
      71                 :            :     const double m_fLogOfBase;
      72                 :            : 
      73                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >      m_xContext;
      74                 :            : };
      75                 :            : 
      76                 :            : // ----------------------------------------
      77                 :            : 
      78                 :            : class ExponentialScaling :
      79                 :            :         public ::cppu::WeakImplHelper3 <
      80                 :            :         ::com::sun::star::chart2::XScaling,
      81                 :            :         ::com::sun::star::lang::XServiceName,
      82                 :            :         ::com::sun::star::lang::XServiceInfo
      83                 :            :         >
      84                 :            : {
      85                 :            : public:
      86                 :            :     /// base is 10.0
      87                 :            :     explicit ExponentialScaling(
      88                 :            :         const ::com::sun::star::uno::Reference<
      89                 :            :             ::com::sun::star::uno::XComponentContext > & xContext );
      90                 :            :     explicit ExponentialScaling( double fBase = 10.0 );
      91                 :            :     virtual ~ExponentialScaling();
      92                 :            : 
      93                 :            :     /// establish methods for factory instatiation
      94         [ #  # ]:          0 :     APPHELPER_SERVICE_FACTORY_HELPER( ExponentialScaling )
      95                 :            :     /// declare XServiceInfo methods
      96                 :            :     APPHELPER_XSERVICEINFO_DECL()
      97                 :            : 
      98                 :            :     // ____ XScaling ____
      99                 :            :         virtual double SAL_CALL
     100                 :            :     doScaling( double value )
     101                 :            :         throw (::com::sun::star::uno::RuntimeException);
     102                 :            : 
     103                 :            :         virtual ::com::sun::star::uno::Reference<
     104                 :            :         ::com::sun::star::chart2::XScaling > SAL_CALL
     105                 :            :     getInverseScaling() throw (::com::sun::star::uno::RuntimeException);
     106                 :            : 
     107                 :            :     // ____ XServiceName ____
     108                 :            :     virtual ::rtl::OUString SAL_CALL getServiceName()
     109                 :            :         throw (::com::sun::star::uno::RuntimeException);
     110                 :            : 
     111                 :            : private:
     112                 :            :     const double m_fBase;
     113                 :            : 
     114                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >      m_xContext;
     115                 :            : };
     116                 :            : 
     117                 :            : // ----------------------------------------
     118                 :            : 
     119                 :            : class LinearScaling : public ::cppu::WeakImplHelper3 <
     120                 :            :         ::com::sun::star::chart2::XScaling,
     121                 :            :         ::com::sun::star::lang::XServiceName,
     122                 :            :         ::com::sun::star::lang::XServiceInfo
     123                 :            :         >
     124                 :            : {
     125                 :            : public:
     126                 :            :     /// y(x) = x
     127                 :            :     explicit LinearScaling(
     128                 :            :         const ::com::sun::star::uno::Reference<
     129                 :            :             ::com::sun::star::uno::XComponentContext > & xContext );
     130                 :            :     /// y(x) = fSlope * x + fOffset
     131                 :            :     LinearScaling( double fSlope = 1.0, double fOffset = 0.0 );
     132                 :            :     virtual ~LinearScaling();
     133                 :            : 
     134                 :            :     /// establish methods for factory instatiation
     135         [ +  - ]:          6 :     APPHELPER_SERVICE_FACTORY_HELPER( LinearScaling )
     136                 :            :     /// declare XServiceInfo methods
     137                 :            :     APPHELPER_XSERVICEINFO_DECL()
     138                 :            : 
     139                 :            :     // ____ XScaling ____
     140                 :            :     virtual double SAL_CALL doScaling( double value )
     141                 :            :         throw (::com::sun::star::uno::RuntimeException);
     142                 :            : 
     143                 :            :     virtual ::com::sun::star::uno::Reference<
     144                 :            :         ::com::sun::star::chart2::XScaling > SAL_CALL
     145                 :            :         getInverseScaling() throw (::com::sun::star::uno::RuntimeException);
     146                 :            : 
     147                 :            :     // ____ XServiceName ____
     148                 :            :     virtual ::rtl::OUString SAL_CALL getServiceName()
     149                 :            :         throw (::com::sun::star::uno::RuntimeException);
     150                 :            : 
     151                 :            : private:
     152                 :            :     const double m_fSlope;
     153                 :            :     const double m_fOffset;
     154                 :            : 
     155                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >      m_xContext;
     156                 :            : };
     157                 :            : 
     158                 :            : // ----------------------------------------
     159                 :            : 
     160                 :            : class PowerScaling : public ::cppu::WeakImplHelper3 <
     161                 :            :         ::com::sun::star::chart2::XScaling,
     162                 :            :         ::com::sun::star::lang::XServiceName,
     163                 :            :         ::com::sun::star::lang::XServiceInfo
     164                 :            :         >
     165                 :            : {
     166                 :            : public:
     167                 :            :     /// exponent 10.0
     168                 :            :     explicit PowerScaling(
     169                 :            :         const ::com::sun::star::uno::Reference<
     170                 :            :             ::com::sun::star::uno::XComponentContext > & xContext );
     171                 :            :     explicit PowerScaling( double fExponent = 10.0 );
     172                 :            :     virtual ~PowerScaling();
     173                 :            : 
     174                 :            :     /// establish methods for factory instatiation
     175         [ #  # ]:          0 :     APPHELPER_SERVICE_FACTORY_HELPER( PowerScaling )
     176                 :            :     /// declare XServiceInfo methods
     177                 :            :     APPHELPER_XSERVICEINFO_DECL()
     178                 :            : 
     179                 :            :     // ____ XScaling ____
     180                 :            :         virtual double SAL_CALL
     181                 :            :     doScaling( double value )
     182                 :            :         throw (::com::sun::star::uno::RuntimeException);
     183                 :            : 
     184                 :            :         virtual ::com::sun::star::uno::Reference<
     185                 :            :         ::com::sun::star::chart2::XScaling > SAL_CALL
     186                 :            :     getInverseScaling() throw (::com::sun::star::uno::RuntimeException);
     187                 :            : 
     188                 :            :     // ____ XServiceName ____
     189                 :            :     virtual ::rtl::OUString SAL_CALL getServiceName()
     190                 :            :         throw (::com::sun::star::uno::RuntimeException);
     191                 :            : 
     192                 :            : private:
     193                 :            :     const double m_fExponent;
     194                 :            : 
     195                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >      m_xContext;
     196                 :            : };
     197                 :            : 
     198                 :            : //.............................................................................
     199                 :            : } //namespace chart
     200                 :            : //.............................................................................
     201                 :            : #endif
     202                 :            : 
     203                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10