Update ooo320-m1
[ooovba.git] / chart2 / source / model / main / CartesianCoordinateSystem.cxx
blob94708376384676e9d7097db123ff67530a9805f5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: CartesianCoordinateSystem.cxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_chart2.hxx"
33 #include "CartesianCoordinateSystem.hxx"
34 #include "macros.hxx"
35 #include "servicenames_coosystems.hxx"
37 using namespace ::com::sun::star;
39 using ::com::sun::star::uno::RuntimeException;
40 using ::com::sun::star::uno::Reference;
41 using ::com::sun::star::uno::Sequence;
42 using ::rtl::OUString;
44 namespace
47 static const ::rtl::OUString lcl_aServiceNameCartesian2d(
48 RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.CartesianCoordinateSystem2d" ));
49 static const ::rtl::OUString lcl_aServiceNameCartesian3d(
50 RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.CartesianCoordinateSystem3d" ));
52 static const ::rtl::OUString lcl_aImplementationNameCartesian2d(
53 RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.CartesianCoordinateSystem2d" ));
54 static const ::rtl::OUString lcl_aImplementationNameCartesian3d(
55 RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.CartesianCoordinateSystem3d" ));
58 namespace chart
61 // explicit
62 CartesianCoordinateSystem::CartesianCoordinateSystem(
63 const uno::Reference< uno::XComponentContext > & xContext,
64 sal_Int32 nDimensionCount /* = 2 */,
65 sal_Bool bSwapXAndYAxis /* = sal_False */ ) :
66 BaseCoordinateSystem( xContext, nDimensionCount, bSwapXAndYAxis )
69 CartesianCoordinateSystem::CartesianCoordinateSystem(
70 const CartesianCoordinateSystem & rSource ) :
71 BaseCoordinateSystem( rSource )
74 CartesianCoordinateSystem::~CartesianCoordinateSystem()
77 // ____ XCoordinateSystem ____
78 ::rtl::OUString SAL_CALL CartesianCoordinateSystem::getCoordinateSystemType()
79 throw (RuntimeException)
81 return CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
84 ::rtl::OUString SAL_CALL CartesianCoordinateSystem::getViewServiceName()
85 throw (RuntimeException)
87 return CHART2_COOSYSTEM_CARTESIAN_VIEW_SERVICE_NAME;
90 // ____ XCloneable ____
91 uno::Reference< util::XCloneable > SAL_CALL CartesianCoordinateSystem::createClone()
92 throw (RuntimeException)
94 return Reference< util::XCloneable >( new CartesianCoordinateSystem( *this ));
97 // ____ XServiceInfo ____
98 Sequence< OUString > CartesianCoordinateSystem::getSupportedServiceNames_Static()
100 Sequence< OUString > aServices( 1 );
101 aServices[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
102 return aServices;
105 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
106 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem,
107 C2U( "com.sun.star.comp.chart.CartesianCoordinateSystem" ))
110 // =================================
111 // ==== CartesianCoordinateSystem2d ====
112 // =================================
114 CartesianCoordinateSystem2d::CartesianCoordinateSystem2d(
115 const uno::Reference< uno::XComponentContext > & xContext ) :
116 CartesianCoordinateSystem( xContext, 2, sal_False )
119 CartesianCoordinateSystem2d::~CartesianCoordinateSystem2d()
122 // ____ XServiceInfo ____
123 Sequence< OUString > CartesianCoordinateSystem2d::getSupportedServiceNames_Static()
125 Sequence< OUString > aServices( 2 );
126 aServices[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
127 aServices[ 1 ] = lcl_aServiceNameCartesian2d;
128 return aServices;
131 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
132 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem2d, lcl_aImplementationNameCartesian2d )
134 // =================================
135 // ==== CartesianCoordinateSystem3d ====
136 // =================================
138 CartesianCoordinateSystem3d::CartesianCoordinateSystem3d(
139 const uno::Reference< uno::XComponentContext > & xContext ) :
140 CartesianCoordinateSystem( xContext, 3, sal_False )
143 CartesianCoordinateSystem3d::~CartesianCoordinateSystem3d()
146 // ____ XServiceInfo ____
147 Sequence< OUString > CartesianCoordinateSystem3d::getSupportedServiceNames_Static()
149 Sequence< OUString > aServices( 2 );
150 aServices[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
151 aServices[ 1 ] = lcl_aServiceNameCartesian3d;
152 return aServices;
155 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
156 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem3d, lcl_aImplementationNameCartesian3d )
158 } // namespace chart