LibreOffice Module chart2 (master) 1
Scaling.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
21#include <com/sun/star/chart2/XScaling.hpp>
22#include <com/sun/star/lang/XServiceInfo.hpp>
23#include <com/sun/star/lang/XServiceName.hpp>
25
26namespace chart
27{
28
29class LogarithmicScaling final :
30 public ::cppu::WeakImplHelper<
31 css::chart2::XScaling,
32 css::lang::XServiceName,
33 css::lang::XServiceInfo
34 >
35{
36public:
38 explicit LogarithmicScaling();
39 LogarithmicScaling( double fBase );
40 virtual ~LogarithmicScaling() override;
41
43 virtual OUString SAL_CALL getImplementationName() override;
44 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
45 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
46
47 // ____ XScaling ____
48 virtual double SAL_CALL doScaling( double value ) override;
49
50 virtual css::uno::Reference<
51 css::chart2::XScaling > SAL_CALL
52 getInverseScaling() override;
53
54 // ____ XServiceName ____
55 virtual OUString SAL_CALL getServiceName() override;
56
57private:
58 const double m_fBase;
59 const double m_fLogOfBase;
60};
61
62class ExponentialScaling final :
63 public ::cppu::WeakImplHelper<
64 css::chart2::XScaling,
65 css::lang::XServiceName,
66 css::lang::XServiceInfo
67 >
68{
69public:
71 explicit ExponentialScaling();
72 explicit ExponentialScaling( double fBase );
73 virtual ~ExponentialScaling() override;
74
76 virtual OUString SAL_CALL getImplementationName() override;
77 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
78 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
79
80 // ____ XScaling ____
81 virtual double SAL_CALL
82 doScaling( double value ) override;
83
84 virtual css::uno::Reference< css::chart2::XScaling > SAL_CALL
85 getInverseScaling() override;
86
87 // ____ XServiceName ____
88 virtual OUString SAL_CALL getServiceName() override;
89
90private:
91 const double m_fBase;
92};
93
94class LinearScaling final : public ::cppu::WeakImplHelper<
95 css::chart2::XScaling,
96 css::lang::XServiceName,
97 css::lang::XServiceInfo
98 >
99{
100public:
102 explicit LinearScaling();
104 LinearScaling( double fSlope, double fOffset );
105 virtual ~LinearScaling() override;
106
108 virtual OUString SAL_CALL getImplementationName() override;
109 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
110 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
111
112 // ____ XScaling ____
113 virtual double SAL_CALL doScaling( double value ) override;
114
115 virtual css::uno::Reference< css::chart2::XScaling > SAL_CALL
116 getInverseScaling() override;
117
118 // ____ XServiceName ____
119 virtual OUString SAL_CALL getServiceName() override;
120
121private:
122 const double m_fSlope;
123 const double m_fOffset;
124};
125
126class PowerScaling final : public ::cppu::WeakImplHelper<
127 css::chart2::XScaling,
128 css::lang::XServiceName,
129 css::lang::XServiceInfo
130 >
131{
132public:
134 explicit PowerScaling();
135 explicit PowerScaling( double fExponent );
136 virtual ~PowerScaling() override;
137
139 virtual OUString SAL_CALL getImplementationName() override;
140 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
141 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
142
143 // ____ XScaling ____
144 virtual double SAL_CALL
145 doScaling( double value ) override;
146
147 virtual css::uno::Reference< css::chart2::XScaling > SAL_CALL
148 getInverseScaling() override;
149
150 // ____ XServiceName ____
151 virtual OUString SAL_CALL getServiceName() override;
152
153private:
154 const double m_fExponent;
155};
156
157} //namespace chart
158
159/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: Scaling.cxx:128
virtual css::uno::Reference< css::chart2::XScaling > SAL_CALL getInverseScaling() override
Definition: Scaling.cxx:113
virtual OUString SAL_CALL getImplementationName() override
declare XServiceInfo methods
Definition: Scaling.cxx:123
virtual double SAL_CALL doScaling(double value) override
Definition: Scaling.cxx:106
virtual ~ExponentialScaling() override
Definition: Scaling.cxx:102
const double m_fBase
Definition: Scaling.hxx:91
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: Scaling.cxx:133
virtual OUString SAL_CALL getServiceName() override
Definition: Scaling.cxx:118
ExponentialScaling()
base is 10.0
Definition: Scaling.cxx:92
virtual OUString SAL_CALL getImplementationName() override
declare XServiceInfo methods
Definition: Scaling.cxx:173
virtual double SAL_CALL doScaling(double value) override
Definition: Scaling.cxx:151
const double m_fOffset
Definition: Scaling.hxx:123
virtual ~LinearScaling() override
Definition: Scaling.cxx:148
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: Scaling.cxx:178
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: Scaling.cxx:183
virtual css::uno::Reference< css::chart2::XScaling > SAL_CALL getInverseScaling() override
Definition: Scaling.cxx:159
virtual OUString SAL_CALL getServiceName() override
Definition: Scaling.cxx:168
const double m_fSlope
Definition: Scaling.hxx:122
LinearScaling()
y(x) = x
Definition: Scaling.cxx:138
const double m_fLogOfBase
Definition: Scaling.hxx:59
virtual css::uno::Reference< css::chart2::XScaling > SAL_CALL getInverseScaling() override
Definition: Scaling.cxx:67
LogarithmicScaling()
base is 10.0
Definition: Scaling.cxx:44
virtual ~LogarithmicScaling() override
Definition: Scaling.cxx:56
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: Scaling.cxx:87
virtual double SAL_CALL doScaling(double value) override
Definition: Scaling.cxx:60
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: Scaling.cxx:82
virtual OUString SAL_CALL getImplementationName() override
declare XServiceInfo methods
Definition: Scaling.cxx:77
const double m_fBase
Definition: Scaling.hxx:58
virtual OUString SAL_CALL getServiceName() override
Definition: Scaling.cxx:72
PowerScaling()
exponent 10.0
Definition: Scaling.cxx:188
virtual ~PowerScaling() override
Definition: Scaling.cxx:196
virtual css::uno::Reference< css::chart2::XScaling > SAL_CALL getInverseScaling() override
Definition: Scaling.cxx:207
virtual OUString SAL_CALL getImplementationName() override
declare XServiceInfo methods
Definition: Scaling.cxx:222
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: Scaling.cxx:227
const double m_fExponent
Definition: Scaling.hxx:154
virtual OUString SAL_CALL getServiceName() override
Definition: Scaling.cxx:217
virtual double SAL_CALL doScaling(double value) override
Definition: Scaling.cxx:199
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: Scaling.cxx:232
Any value
unsigned char sal_Bool