LibreOffice Module chart2 (master) 1
DateScaling.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#include <tools/date.hxx>
26
27namespace chart
28{
29
31 public ::cppu::WeakImplHelper<
32 css::chart2::XScaling,
33 css::lang::XServiceName,
34 css::lang::XServiceInfo
35 >
36{
37public:
38 DateScaling( const Date& rNullDate, sal_Int32 nTimeUnit, bool bShifted );
39 virtual ~DateScaling() override;
40
42 virtual OUString SAL_CALL getImplementationName() override;
43 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
44 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
45
46 // ____ XScaling ____
47 virtual double SAL_CALL doScaling( double value ) override;
48
49 virtual css::uno::Reference<
50 css::chart2::XScaling > SAL_CALL
51 getInverseScaling() override;
52
53 // ____ XServiceName ____
54 virtual OUString SAL_CALL getServiceName() override;
55
56private:
58 const sal_Int32 m_nTimeUnit;
59 const bool m_bShifted;
60};
61
63 public ::cppu::WeakImplHelper<
64 css::chart2::XScaling,
65 css::lang::XServiceName,
66 css::lang::XServiceInfo
67 >
68{
69public:
70 InverseDateScaling( const Date& rNullDate, sal_Int32 nTimeUnit, bool bShifted );
71 virtual ~InverseDateScaling() override;
72
74 virtual OUString SAL_CALL getImplementationName() override;
75 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
76 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
77
78 // ____ XScaling ____
79 virtual double SAL_CALL doScaling( double value ) override;
80
81 virtual css::uno::Reference< css::chart2::XScaling > SAL_CALL
82 getInverseScaling() override;
83
84 // ____ XServiceName ____
85 virtual OUString SAL_CALL getServiceName() override;
86
87private:
89 const sal_Int32 m_nTimeUnit;
90 const bool m_bShifted;
91};
92
93} //namespace chart
94
95/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Reference< css::chart2::XScaling > SAL_CALL getInverseScaling() override
Definition: DateScaling.cxx:95
virtual double SAL_CALL doScaling(double value) override
Definition: DateScaling.cxx:56
virtual ~DateScaling() override
Definition: DateScaling.cxx:52
virtual OUString SAL_CALL getServiceName() override
DateScaling(const Date &rNullDate, sal_Int32 nTimeUnit, bool bShifted)
Definition: DateScaling.cxx:45
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual OUString SAL_CALL getImplementationName() override
declare XServiceInfo methods
const sal_Int32 m_nTimeUnit
Definition: DateScaling.hxx:58
const Date m_aNullDate
Definition: DateScaling.hxx:57
const bool m_bShifted
Definition: DateScaling.hxx:59
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
const sal_Int32 m_nTimeUnit
Definition: DateScaling.hxx:89
virtual ~InverseDateScaling() override
virtual OUString SAL_CALL getImplementationName() override
declare XServiceInfo methods
InverseDateScaling(const Date &rNullDate, sal_Int32 nTimeUnit, bool bShifted)
virtual double SAL_CALL doScaling(double value) override
virtual css::uno::Reference< css::chart2::XScaling > SAL_CALL getInverseScaling() override
virtual OUString SAL_CALL getServiceName() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Any value
unsigned char sal_Bool