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 .
20 #include "CartesianCoordinateSystem.hxx"
22 #include "servicenames_coosystems.hxx"
24 using namespace ::com::sun::star
;
26 using ::com::sun::star::uno::RuntimeException
;
27 using ::com::sun::star::uno::Reference
;
28 using ::com::sun::star::uno::Sequence
;
33 static const OUString
lcl_aServiceNameCartesian2d( "com.sun.star.chart2.CartesianCoordinateSystem2d" );
34 static const OUString
lcl_aServiceNameCartesian3d( "com.sun.star.chart2.CartesianCoordinateSystem3d" );
36 static const OUString
lcl_aImplementationNameCartesian2d( "com.sun.star.comp.chart2.CartesianCoordinateSystem2d" );
37 static const OUString
lcl_aImplementationNameCartesian3d( "com.sun.star.comp.chart2.CartesianCoordinateSystem3d" );
44 CartesianCoordinateSystem::CartesianCoordinateSystem(
45 const uno::Reference
< uno::XComponentContext
> & xContext
,
46 sal_Int32 nDimensionCount
/* = 2 */,
47 sal_Bool bSwapXAndYAxis
/* = sal_False */ ) :
48 BaseCoordinateSystem( xContext
, nDimensionCount
, bSwapXAndYAxis
)
51 CartesianCoordinateSystem::CartesianCoordinateSystem(
52 const CartesianCoordinateSystem
& rSource
) :
53 BaseCoordinateSystem( rSource
)
56 CartesianCoordinateSystem::~CartesianCoordinateSystem()
59 // ____ XCoordinateSystem ____
60 OUString SAL_CALL
CartesianCoordinateSystem::getCoordinateSystemType()
61 throw (RuntimeException
)
63 return CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME
;
66 OUString SAL_CALL
CartesianCoordinateSystem::getViewServiceName()
67 throw (RuntimeException
)
69 return CHART2_COOSYSTEM_CARTESIAN_VIEW_SERVICE_NAME
;
72 // ____ XCloneable ____
73 uno::Reference
< util::XCloneable
> SAL_CALL
CartesianCoordinateSystem::createClone()
74 throw (RuntimeException
)
76 return Reference
< util::XCloneable
>( new CartesianCoordinateSystem( *this ));
79 // ____ XServiceInfo ____
80 Sequence
< OUString
> CartesianCoordinateSystem::getSupportedServiceNames_Static()
82 Sequence
< OUString
> aServices( 1 );
83 aServices
[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME
;
87 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
88 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem
,
89 OUString("com.sun.star.comp.chart.CartesianCoordinateSystem"))
92 // =================================
93 // ==== CartesianCoordinateSystem2d ====
94 // =================================
96 CartesianCoordinateSystem2d::CartesianCoordinateSystem2d(
97 const uno::Reference
< uno::XComponentContext
> & xContext
) :
98 CartesianCoordinateSystem( xContext
, 2, sal_False
)
101 CartesianCoordinateSystem2d::~CartesianCoordinateSystem2d()
104 // ____ XServiceInfo ____
105 Sequence
< OUString
> CartesianCoordinateSystem2d::getSupportedServiceNames_Static()
107 Sequence
< OUString
> aServices( 2 );
108 aServices
[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME
;
109 aServices
[ 1 ] = lcl_aServiceNameCartesian2d
;
113 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
114 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem2d
, lcl_aImplementationNameCartesian2d
)
116 // =================================
117 // ==== CartesianCoordinateSystem3d ====
118 // =================================
120 CartesianCoordinateSystem3d::CartesianCoordinateSystem3d(
121 const uno::Reference
< uno::XComponentContext
> & xContext
) :
122 CartesianCoordinateSystem( xContext
, 3, sal_False
)
125 CartesianCoordinateSystem3d::~CartesianCoordinateSystem3d()
128 // ____ XServiceInfo ____
129 Sequence
< OUString
> CartesianCoordinateSystem3d::getSupportedServiceNames_Static()
131 Sequence
< OUString
> aServices( 2 );
132 aServices
[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME
;
133 aServices
[ 1 ] = lcl_aServiceNameCartesian3d
;
137 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
138 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem3d
, lcl_aImplementationNameCartesian3d
)
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */