1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_CHART2_SOURCE_VIEW_AXES_DATESCALING_HXX
20 #define INCLUDED_CHART2_SOURCE_VIEW_AXES_DATESCALING_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 #include <tools/date.hxx>
33 public ::cppu::WeakImplHelper3
<
34 ::com::sun::star::chart2::XScaling
,
35 ::com::sun::star::lang::XServiceName
,
36 ::com::sun::star::lang::XServiceInfo
40 DateScaling( const Date
& rNullDate
, sal_Int32 nTimeUnit
, bool bShifted
);
41 virtual ~DateScaling();
43 /// declare XServiceInfo methods
44 virtual OUString SAL_CALL
getImplementationName()
45 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
46 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
47 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
48 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames()
49 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
51 static OUString
getImplementationName_Static();
52 static css::uno::Sequence
< OUString
> getSupportedServiceNames_Static();
55 virtual double SAL_CALL
doScaling( double value
)
56 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
58 virtual ::com::sun::star::uno::Reference
<
59 ::com::sun::star::chart2::XScaling
> SAL_CALL
60 getInverseScaling() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
62 // ____ XServiceName ____
63 virtual OUString SAL_CALL
getServiceName()
64 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
67 const Date m_aNullDate
;
68 const sal_Int32 m_nTimeUnit
;
69 const bool m_bShifted
;
72 class InverseDateScaling
:
73 public ::cppu::WeakImplHelper3
<
74 ::com::sun::star::chart2::XScaling
,
75 ::com::sun::star::lang::XServiceName
,
76 ::com::sun::star::lang::XServiceInfo
80 InverseDateScaling( const Date
& rNullDate
, sal_Int32 nTimeUnit
, bool bShifted
);
81 virtual ~InverseDateScaling();
83 /// declare XServiceInfo methods
84 virtual OUString SAL_CALL
getImplementationName()
85 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
86 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
87 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
88 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames()
89 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
91 static OUString
getImplementationName_Static();
92 static css::uno::Sequence
< OUString
> getSupportedServiceNames_Static();
95 virtual double SAL_CALL
doScaling( double value
)
96 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
98 virtual ::com::sun::star::uno::Reference
<
99 ::com::sun::star::chart2::XScaling
> SAL_CALL
100 getInverseScaling() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
102 // ____ XServiceName ____
103 virtual OUString SAL_CALL
getServiceName()
104 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
107 const Date m_aNullDate
;
108 const sal_Int32 m_nTimeUnit
;
109 const bool m_bShifted
;
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */